Merge branch 'develop' of github.com:chatwoot/chatwoot into feature/cw-2159

This commit is contained in:
Shivam Mishra
2023-06-30 12:25:43 +05:30
24 changed files with 67 additions and 470 deletions
@@ -39,5 +39,7 @@ export default {
UNTIL_NEXT_MONTH: 'until_next_month',
UNTIL_CUSTOM_TIME: 'until_custom_time',
},
EXAMPLE_URL: 'https://example.com',
EXAMPLE_WEBHOOK_URL: 'https://example/api/webhook',
};
export const DEFAULT_REDIRECT_URL = '/app/';
@@ -8,6 +8,8 @@ import {
isMonday,
isToday,
setHours,
setMinutes,
setSeconds,
} from 'date-fns';
import wootConstants from 'dashboard/constants/globals';
@@ -36,7 +38,7 @@ export const findNextDay = currentDate => {
};
export const setHoursToNine = date => {
return setHours(date, 9, 0, 0);
return setSeconds(setMinutes(setHours(date, 9), 0), 0);
};
export const findSnoozeTime = (snoozeType, currentDate = new Date()) => {
@@ -40,6 +40,11 @@ describe('#Snooze Helpers', () => {
nextDay.setHours(9, 0, 0, 0);
expect(setHoursToNine(nextDay)).toEqual(nextDay);
});
it('should return date with 9.00AM time if date with 10am is passes', () => {
const nextDay = new Date('06/17/2023 10:00:00');
nextDay.setHours(9, 0, 0, 0);
expect(setHoursToNine(nextDay)).toEqual(nextDay);
});
});
describe('findSnoozeTime', () => {
@@ -9,11 +9,7 @@
"404": "There are no canned responses available in this account.",
"TITLE": "Manage canned responses",
"DESC": "Canned Responses are predefined reply templates which can be used to quickly send out replies to tickets.",
"TABLE_HEADER": [
"Short Code",
"Content",
"Actions"
]
"TABLE_HEADER": ["Short Code", "Content", "Actions"]
},
"ADD": {
"TITLE": "Add Canned Response",
@@ -34,7 +30,7 @@
},
"API": {
"SUCCESS_MESSAGE": "Canned Response added successfully",
"ERROR_MESSAGE": "Could not create canned response, Please try again later"
"ERROR_MESSAGE": "Could not create canned response. Please try again later."
}
},
"EDIT": {
@@ -56,14 +52,14 @@
"BUTTON_TEXT": "Edit",
"API": {
"SUCCESS_MESSAGE": "Canned Response updated successfully",
"ERROR_MESSAGE": "Could not update canned response, Please try again later"
"ERROR_MESSAGE": "Could not update canned response. Please try again later."
}
},
"DELETE": {
"BUTTON_TEXT": "Delete",
"API": {
"SUCCESS_MESSAGE": "Canned response deleted successfully",
"ERROR_MESSAGE": "Could not delete canned response, Please try again later"
"ERROR_MESSAGE": "Could not delete canned response. Please try again later."
},
"CONFIRM": {
"TITLE": "Confirm Deletion",
@@ -78,7 +78,7 @@
"BUTTON_LABEL": "Export",
"TITLE": "Export Contacts",
"DESC": "Export contacts to a CSV file.",
"SUCCESS_MESSAGE": "Export is in progress, You will be notified via email when export file is ready to dowanlod.",
"SUCCESS_MESSAGE": "Export is in progress. You will be notified on email when the export file is ready to download.",
"ERROR_MESSAGE": "There was an error, please try again"
},
"DELETE_NOTE": {
@@ -179,7 +179,8 @@
}
},
"ADD": {
"CREATE_FLOW": [{
"CREATE_FLOW": [
{
"title": "Help center information",
"route": "new_portal_information",
"body": "Basic information about portal",
@@ -235,13 +236,13 @@
"DOMAIN": {
"LABEL": "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"
},
"HOME_PAGE_LINK": {
"LABEL": "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"
},
"THEME_COLOR": {
@@ -21,7 +21,7 @@
},
"END_POINT": {
"LABEL": "Webhook URL",
"PLACEHOLDER": "Example: https://example/api/webhook",
"PLACEHOLDER": "Example: %{webhookExampleURL}",
"ERROR": "Please enter a valid URL"
},
"EDIT_SUBMIT": "Update webhook",
@@ -61,7 +61,7 @@
:class="{ error: $v.domain.$error }"
:label="$t('HELP_CENTER.PORTAL.ADD.DOMAIN.LABEL')"
:placeholder="$t('HELP_CENTER.PORTAL.ADD.DOMAIN.PLACEHOLDER')"
:help-text="$t('HELP_CENTER.PORTAL.ADD.DOMAIN.HELP_TEXT')"
:help-text="domainExampleHelpText"
:error="domainError"
@blur="$v.domain.$touch"
/>
@@ -86,6 +86,9 @@ import { isDomain } from 'shared/helpers/Validators';
import thumbnail from 'dashboard/components/widgets/Thumbnail';
import { convertToCategorySlug } from 'dashboard/helper/commons.js';
import { buildPortalURL } from 'dashboard/helper/portalHelper';
import wootConstants from 'dashboard/constants/globals';
const { EXAMPLE_URL } = wootConstants;
export default {
components: {
@@ -147,6 +150,11 @@ export default {
domainHelpText() {
return buildPortalURL(this.slug);
},
domainExampleHelpText() {
return this.$t('HELP_CENTER.PORTAL.ADD.DOMAIN.HELP_TEXT', {
exampleURL: EXAMPLE_URL,
});
},
},
mounted() {
const portal = this.portal || {};
@@ -41,7 +41,7 @@
: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="
$v.homePageLink.$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 alertMixin from 'shared/mixins/alertMixin';
import wootConstants from 'dashboard/constants/globals';
const { EXAMPLE_URL } = wootConstants;
export default {
components: {},
@@ -102,6 +105,13 @@ export default {
url,
},
},
computed: {
homepageExampleHelpText() {
return this.$t('HELP_CENTER.PORTAL.ADD.HOME_PAGE_LINK.HELP_TEXT', {
exampleURL: EXAMPLE_URL,
});
},
},
mounted() {
this.color = getRandomColor();
this.updateDataFromStore();
@@ -7,9 +7,7 @@
v-model.trim="url"
type="text"
name="url"
:placeholder="
$t('INTEGRATION_SETTINGS.WEBHOOK.FORM.END_POINT.PLACEHOLDER')
"
:placeholder="webhookURLInputPlaceholder"
@input="$v.url.$touch"
/>
<span v-if="$v.url.$error" class="message">
@@ -53,6 +51,9 @@
<script>
import { required, url, minLength } from 'vuelidate/lib/validators';
import webhookMixin from './webhookMixin';
import wootConstants from 'dashboard/constants/globals';
const { EXAMPLE_WEBHOOK_URL } = wootConstants;
const SUPPORTED_WEBHOOK_EVENTS = [
'conversation_created',
@@ -98,6 +99,16 @@ export default {
supportedWebhookEvents: SUPPORTED_WEBHOOK_EVENTS,
};
},
computed: {
webhookURLInputPlaceholder() {
return this.$t(
'INTEGRATION_SETTINGS.WEBHOOK.FORM.END_POINT.PLACEHOLDER',
{
webhookExampleURL: EXAMPLE_WEBHOOK_URL,
}
);
},
},
methods: {
onSubmit() {
this.$emit('submit', {