chore: Remove URLs from translations (#7414)

This commit is contained in:
Sivin Varghese
2023-06-29 15:09:02 +05:30
committed by GitHub
parent ea78020f2f
commit 191b8a64fe
6 changed files with 41 additions and 9 deletions

View File

@@ -39,5 +39,7 @@ export default {
UNTIL_NEXT_MONTH: 'until_next_month', UNTIL_NEXT_MONTH: 'until_next_month',
UNTIL_CUSTOM_TIME: 'until_custom_time', UNTIL_CUSTOM_TIME: 'until_custom_time',
}, },
EXAMPLE_URL: 'https://example.com',
EXAMPLE_WEBHOOK_URL: 'https://example/api/webhook',
}; };
export const DEFAULT_REDIRECT_URL = '/app/'; export const DEFAULT_REDIRECT_URL = '/app/';

View File

@@ -179,7 +179,8 @@
} }
}, },
"ADD": { "ADD": {
"CREATE_FLOW": [{ "CREATE_FLOW": [
{
"title": "Help center information", "title": "Help center information",
"route": "new_portal_information", "route": "new_portal_information",
"body": "Basic information about portal", "body": "Basic information about portal",
@@ -235,13 +236,13 @@
"DOMAIN": { "DOMAIN": {
"LABEL": "Custom Domain", "LABEL": "Custom Domain",
"PLACEHOLDER": "Portal custom domain", "PLACEHOLDER": "Portal custom domain",
"HELP_TEXT": "Add only If you want to use a custom domain for your portals. Eg: https://example.com", "HELP_TEXT": "Add only If you want to use a custom domain for your portals. Eg: %{exampleURL}",
"ERROR": "Enter a valid domain URL" "ERROR": "Enter a valid domain URL"
}, },
"HOME_PAGE_LINK": { "HOME_PAGE_LINK": {
"LABEL": "Home Page Link", "LABEL": "Home Page Link",
"PLACEHOLDER": "Portal home page link", "PLACEHOLDER": "Portal home page link",
"HELP_TEXT": "The link used to return from the portal to the home page. Eg: https://example.com", "HELP_TEXT": "The link used to return from the portal to the home page. Eg: %{exampleURL}",
"ERROR": "Enter a valid home page URL" "ERROR": "Enter a valid home page URL"
}, },
"THEME_COLOR": { "THEME_COLOR": {

View File

@@ -21,7 +21,7 @@
}, },
"END_POINT": { "END_POINT": {
"LABEL": "Webhook URL", "LABEL": "Webhook URL",
"PLACEHOLDER": "Example: https://example/api/webhook", "PLACEHOLDER": "Example: %{webhookExampleURL}",
"ERROR": "Please enter a valid URL" "ERROR": "Please enter a valid URL"
}, },
"EDIT_SUBMIT": "Update webhook", "EDIT_SUBMIT": "Update webhook",

View File

@@ -61,7 +61,7 @@
:class="{ error: $v.domain.$error }" :class="{ error: $v.domain.$error }"
:label="$t('HELP_CENTER.PORTAL.ADD.DOMAIN.LABEL')" :label="$t('HELP_CENTER.PORTAL.ADD.DOMAIN.LABEL')"
:placeholder="$t('HELP_CENTER.PORTAL.ADD.DOMAIN.PLACEHOLDER')" :placeholder="$t('HELP_CENTER.PORTAL.ADD.DOMAIN.PLACEHOLDER')"
:help-text="$t('HELP_CENTER.PORTAL.ADD.DOMAIN.HELP_TEXT')" :help-text="domainExampleHelpText"
:error="domainError" :error="domainError"
@blur="$v.domain.$touch" @blur="$v.domain.$touch"
/> />
@@ -86,6 +86,9 @@ import { isDomain } from 'shared/helpers/Validators';
import thumbnail from 'dashboard/components/widgets/Thumbnail'; import thumbnail from 'dashboard/components/widgets/Thumbnail';
import { convertToCategorySlug } from 'dashboard/helper/commons.js'; import { convertToCategorySlug } from 'dashboard/helper/commons.js';
import { buildPortalURL } from 'dashboard/helper/portalHelper'; import { buildPortalURL } from 'dashboard/helper/portalHelper';
import wootConstants from 'dashboard/constants/globals';
const { EXAMPLE_URL } = wootConstants;
export default { export default {
components: { components: {
@@ -147,6 +150,11 @@ export default {
domainHelpText() { domainHelpText() {
return buildPortalURL(this.slug); return buildPortalURL(this.slug);
}, },
domainExampleHelpText() {
return this.$t('HELP_CENTER.PORTAL.ADD.DOMAIN.HELP_TEXT', {
exampleURL: EXAMPLE_URL,
});
},
}, },
mounted() { mounted() {
const portal = this.portal || {}; const portal = this.portal || {};

View File

@@ -41,7 +41,7 @@
:placeholder=" :placeholder="
$t('HELP_CENTER.PORTAL.ADD.HOME_PAGE_LINK.PLACEHOLDER') $t('HELP_CENTER.PORTAL.ADD.HOME_PAGE_LINK.PLACEHOLDER')
" "
:help-text="$t('HELP_CENTER.PORTAL.ADD.HOME_PAGE_LINK.HELP_TEXT')" :help-text="homepageExampleHelpText"
:error=" :error="
$v.homePageLink.$error $v.homePageLink.$error
? $t('HELP_CENTER.PORTAL.ADD.HOME_PAGE_LINK.ERROR') ? $t('HELP_CENTER.PORTAL.ADD.HOME_PAGE_LINK.ERROR')
@@ -74,6 +74,9 @@ import { url } from 'vuelidate/lib/validators';
import { getRandomColor } from 'dashboard/helper/labelColor'; import { getRandomColor } from 'dashboard/helper/labelColor';
import alertMixin from 'shared/mixins/alertMixin'; import alertMixin from 'shared/mixins/alertMixin';
import wootConstants from 'dashboard/constants/globals';
const { EXAMPLE_URL } = wootConstants;
export default { export default {
components: {}, components: {},
@@ -102,6 +105,13 @@ export default {
url, url,
}, },
}, },
computed: {
homepageExampleHelpText() {
return this.$t('HELP_CENTER.PORTAL.ADD.HOME_PAGE_LINK.HELP_TEXT', {
exampleURL: EXAMPLE_URL,
});
},
},
mounted() { mounted() {
this.color = getRandomColor(); this.color = getRandomColor();
this.updateDataFromStore(); this.updateDataFromStore();

View File

@@ -7,9 +7,7 @@
v-model.trim="url" v-model.trim="url"
type="text" type="text"
name="url" name="url"
:placeholder=" :placeholder="webhookURLInputPlaceholder"
$t('INTEGRATION_SETTINGS.WEBHOOK.FORM.END_POINT.PLACEHOLDER')
"
@input="$v.url.$touch" @input="$v.url.$touch"
/> />
<span v-if="$v.url.$error" class="message"> <span v-if="$v.url.$error" class="message">
@@ -53,6 +51,9 @@
<script> <script>
import { required, url, minLength } from 'vuelidate/lib/validators'; import { required, url, minLength } from 'vuelidate/lib/validators';
import webhookMixin from './webhookMixin'; import webhookMixin from './webhookMixin';
import wootConstants from 'dashboard/constants/globals';
const { EXAMPLE_WEBHOOK_URL } = wootConstants;
const SUPPORTED_WEBHOOK_EVENTS = [ const SUPPORTED_WEBHOOK_EVENTS = [
'conversation_created', 'conversation_created',
@@ -98,6 +99,16 @@ export default {
supportedWebhookEvents: SUPPORTED_WEBHOOK_EVENTS, supportedWebhookEvents: SUPPORTED_WEBHOOK_EVENTS,
}; };
}, },
computed: {
webhookURLInputPlaceholder() {
return this.$t(
'INTEGRATION_SETTINGS.WEBHOOK.FORM.END_POINT.PLACEHOLDER',
{
webhookExampleURL: EXAMPLE_WEBHOOK_URL,
}
);
},
},
methods: { methods: {
onSubmit() { onSubmit() {
this.$emit('submit', { this.$emit('submit', {