chore: translation updates

This commit is contained in:
Muhsin Keloth
2024-05-13 19:04:06 +05:30
parent 4825ab1a29
commit e1bfd9a17a
4 changed files with 27 additions and 22 deletions
@@ -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",
@@ -75,7 +75,7 @@ export default {
},
{
key: 1,
name: this.$t('INTEGRATION_SETTINGS.LINEAR.LINK'),
name: this.$t('INTEGRATION_SETTINGS.LINEAR.LINK.TITLE'),
},
];
},
@@ -4,20 +4,27 @@
<multiselect
v-model="selectedOptions"
class="no-margin !pl-0"
placeholder="Type to search"
select-label="Select issue"
label="name"
:placeholder="$t('INTEGRATION_SETTINGS.LINEAR.LINK.SEARCH')"
:select-label="$t('INTEGRATION_SETTINGS.LINEAR.LINK.SELECT')"
label="title"
track-by="id"
:options="options"
:option-height="24"
:show-labels="false"
:max-height="500"
@search-change="handleSearchChange"
@select="handleInput"
>
<template #noResult>
{{ emptyText }}
<div class="flex items-center justify-center">
{{ emptyText }}
</div>
</template>
<template #noOptions>
<div class="flex items-center justify-center">
{{ $t('INTEGRATION_SETTINGS.LINEAR.LINK.EMPTY_LIST') }}
</div>
</template>
<template #noOptions> No options </template>
</multiselect>
</div>
<div class="flex items-center justify-end w-full gap-2 mt-8">
@@ -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;
}
@@ -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;
}