From e1bfd9a17ac416b32351e17674ef4a8c548def80 Mon Sep 17 00:00:00 2001 From: Muhsin Keloth Date: Mon, 13 May 2024 19:04:06 +0530 Subject: [PATCH] chore: translation updates --- .../i18n/locale/en/integrations.json | 9 +++++- .../conversation/linear/CreateOrLinkIssue.vue | 2 +- .../conversation/linear/LinkIssue.vue | 32 +++++++++---------- .../dashboard/conversation/linear/index.vue | 6 ++-- 4 files changed, 27 insertions(+), 22 deletions(-) diff --git a/app/javascript/dashboard/i18n/locale/en/integrations.json b/app/javascript/dashboard/i18n/locale/en/integrations.json index 04ae94e2f..d97971e07 100644 --- a/app/javascript/dashboard/i18n/locale/en/integrations.json +++ b/app/javascript/dashboard/i18n/locale/en/integrations.json @@ -209,7 +209,14 @@ "LOADING": "Fetching linear issues...", "LOADING_ERROR": "There was an error fetching the linear issues, please try again", "CREATE": "Create", - "LINK": "Link", + "LINK": { + "SEARCH": "Search linear issues", + "SELECT": "Select issue", + "TITLE": "Link", + "EMPTY_LIST": "No linear issues found", + "LOADING": "Loading", + "ERROR": "There was an error fetching the linear issues, please try again" + }, "ADD_OR_LINK": { "TITLE": "Create/link linear issue", "DESCRIPTION": "Create or link a linear issue to the conversation", diff --git a/app/javascript/dashboard/routes/dashboard/conversation/linear/CreateOrLinkIssue.vue b/app/javascript/dashboard/routes/dashboard/conversation/linear/CreateOrLinkIssue.vue index c46c4902c..ae306e882 100644 --- a/app/javascript/dashboard/routes/dashboard/conversation/linear/CreateOrLinkIssue.vue +++ b/app/javascript/dashboard/routes/dashboard/conversation/linear/CreateOrLinkIssue.vue @@ -75,7 +75,7 @@ export default { }, { key: 1, - name: this.$t('INTEGRATION_SETTINGS.LINEAR.LINK'), + name: this.$t('INTEGRATION_SETTINGS.LINEAR.LINK.TITLE'), }, ]; }, diff --git a/app/javascript/dashboard/routes/dashboard/conversation/linear/LinkIssue.vue b/app/javascript/dashboard/routes/dashboard/conversation/linear/LinkIssue.vue index f18a24c5d..8423e5d1e 100644 --- a/app/javascript/dashboard/routes/dashboard/conversation/linear/LinkIssue.vue +++ b/app/javascript/dashboard/routes/dashboard/conversation/linear/LinkIssue.vue @@ -4,20 +4,27 @@ + -
@@ -67,12 +74,12 @@ export default { computed: { emptyText() { if (this.isFetching) { - return 'Loading...'; + return this.$t('INTEGRATION_SETTINGS.LINEAR.LINK.LOADING'); } if (this.searchQuery) { return ''; } - return 'No results found'; + return this.$t('INTEGRATION_SETTINGS.LINEAR.LINK.EMPTY_LIST'); }, isSubmitDisabled() { return !this.selectedOptions || this.isLinking; @@ -88,16 +95,9 @@ export default { try { this.isFetching = true; const response = await LinearAPI.searchIssues(value); - const options = response.data.map(issue => ({ - id: issue.id, - name: issue.title, - description: issue.description, - })); - this.options = options; + this.options = response.data; } catch (error) { - this.showAlert( - this.$t('INTEGRATION_SETTINGS.LINEAR.ADD_OR_LINK.LOADING_TEAM_ERROR') - ); + this.showAlert(this.$t('INTEGRATION_SETTINGS.LINEAR.LINK.ERROR')); } finally { this.isFetching = false; } diff --git a/app/javascript/dashboard/routes/dashboard/conversation/linear/index.vue b/app/javascript/dashboard/routes/dashboard/conversation/linear/index.vue index 6aa4c2d44..63dd18676 100644 --- a/app/javascript/dashboard/routes/dashboard/conversation/linear/index.vue +++ b/app/javascript/dashboard/routes/dashboard/conversation/linear/index.vue @@ -91,12 +91,10 @@ export default { try { this.isFetching = true; const response = await LinearAPI.getLinkedIssue(this.conversationId); - const { issues } = response.data; + const { issues = [] } = response.data; this.linkedIssue = issues.length ? issues[0] : null; } catch (error) { - this.showAlert( - this.$t('INTEGRATION_SETTINGS.LINEAR.ADD_OR_LINK.LOADING_ERROR') - ); + this.showAlert(this.$t('INTEGRATION_SETTINGS.LINEAR.LOADING_ERROR')); } finally { this.isFetching = false; }