diff --git a/app/javascript/dashboard/components/widgets/Avatar.vue b/app/javascript/dashboard/components/widgets/Avatar.vue index daf044288..df654ee7e 100644 --- a/app/javascript/dashboard/components/widgets/Avatar.vue +++ b/app/javascript/dashboard/components/widgets/Avatar.vue @@ -78,7 +78,7 @@ export default { if (initials.length > 2 && initials.search(/[A-Z]/) !== -1) { initials = initials.replace(/[a-z]+/g, ''); } - initials = initials.substr(0, 2).toUpperCase(); + initials = initials.substring(0, 2).toUpperCase(); return initials; }, }, diff --git a/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue b/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue index 1b0b9ca36..bbc2f017e 100644 --- a/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue +++ b/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue @@ -477,7 +477,7 @@ export default { const hasNextWord = updatedMessage.includes(' '); const isShortCodeActive = this.hasSlashCommand && !hasNextWord; if (isShortCodeActive) { - this.mentionSearchKey = updatedMessage.substr(1, updatedMessage.length); + this.mentionSearchKey = updatedMessage.substring(1); this.showMentions = true; } else { this.mentionSearchKey = ''; diff --git a/app/javascript/dashboard/routes/dashboard/conversation/contact/ConversationForm.vue b/app/javascript/dashboard/routes/dashboard/conversation/contact/ConversationForm.vue index 9dda5c02c..c9294aa2a 100644 --- a/app/javascript/dashboard/routes/dashboard/conversation/contact/ConversationForm.vue +++ b/app/javascript/dashboard/routes/dashboard/conversation/contact/ConversationForm.vue @@ -239,7 +239,7 @@ export default { const hasNextWord = value.includes(' '); const isShortCodeActive = this.hasSlashCommand && !hasNextWord; if (isShortCodeActive) { - this.cannedResponseSearchKey = value.substr(1, value.length); + this.cannedResponseSearchKey = value.substring(1); this.showCannedResponseMenu = true; } else { this.cannedResponseSearchKey = ''; diff --git a/app/javascript/dashboard/routes/dashboard/settings/inbox/WidgetBuilder.vue b/app/javascript/dashboard/routes/dashboard/settings/inbox/WidgetBuilder.vue index 8da5183d7..bdc20e14e 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/inbox/WidgetBuilder.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/inbox/WidgetBuilder.vue @@ -243,7 +243,7 @@ export default { this.$t('INBOX_MGMT.WIDGET_BUILDER.SCRIPT_SETTINGS', { options: JSON.stringify(options), }) + - script.substring(13, script.length) + script.substring(13) ); }, getWidgetViewOptions() { diff --git a/app/javascript/shared/mixins/campaignMixin.js b/app/javascript/shared/mixins/campaignMixin.js index b9353ff29..ebf98aa37 100644 --- a/app/javascript/shared/mixins/campaignMixin.js +++ b/app/javascript/shared/mixins/campaignMixin.js @@ -1,10 +1,10 @@ import { CAMPAIGN_TYPES } from '../constants/campaign'; + export default { computed: { campaignType() { const pageURL = window.location.href; - const type = pageURL.substr(pageURL.lastIndexOf('/') + 1); - return type; + return pageURL.substring(pageURL.lastIndexOf('/') + 1); }, isOngoingType() { return this.campaignType === CAMPAIGN_TYPES.ONGOING; diff --git a/app/javascript/survey/views/Response.vue b/app/javascript/survey/views/Response.vue index 6ec4ec100..828a9cbee 100644 --- a/app/javascript/survey/views/Response.vue +++ b/app/javascript/survey/views/Response.vue @@ -93,7 +93,7 @@ export default { computed: { surveyId() { const pageURL = window.location.href; - return pageURL.substr(pageURL.lastIndexOf('/') + 1); + return pageURL.substring(pageURL.lastIndexOf('/') + 1); }, isRatingSubmitted() { return this.surveyDetails && this.surveyDetails.rating; diff --git a/app/models/working_hour.rb b/app/models/working_hour.rb index 5ad4d0446..01b972bd4 100644 --- a/app/models/working_hour.rb +++ b/app/models/working_hour.rb @@ -40,7 +40,7 @@ class WorkingHour < ApplicationRecord validate :open_all_day_and_closed_all_day def self.today - # While getting the day of the week, consider the timezone as well. `first` would + # While getting the day of the week, consider the timezone as well. `first` would # return the first working hour from the list of working hours available per week. inbox = first.inbox find_by(day_of_week: Time.zone.now.in_time_zone(inbox.timezone).to_date.wday)