Merge branch 'release/2.9.1'

This commit is contained in:
Sojan 2022-09-22 14:22:29 -07:00
commit 7ad5ddaf8a
70 changed files with 209 additions and 100 deletions

View file

@ -135,7 +135,7 @@ GEM
byebug (11.1.3)
climate_control (1.1.1)
coderay (1.1.3)
commonmarker (0.23.5)
commonmarker (0.23.6)
concurrent-ruby (1.1.10)
connection_pool (2.2.5)
crack (0.4.5)

View file

@ -16,7 +16,9 @@ class Api::V1::Accounts::MacrosController < Api::V1::Accounts::BaseController
@macro.save!
end
def show; end
def show
head :not_found if @macro.nil?
end
def destroy
@macro.destroy!

View file

@ -1,6 +1,7 @@
class Public::Api::V1::PortalsController < PublicController
before_action :ensure_custom_domain_request, only: [:show]
before_action :portal
before_action :redirect_to_portal_with_locale, only: [:show]
layout 'portal'
def show; end
@ -9,5 +10,12 @@ class Public::Api::V1::PortalsController < PublicController
def portal
@portal ||= Portal.find_by!(slug: params[:slug], archived: false)
@locale = params[:locale] || @portal.default_locale
end
def redirect_to_portal_with_locale
return if params[:locale].present?
redirect_to "/hc/#{@portal.slug}/#{@portal.default_locale}"
end
end

View file

@ -188,6 +188,10 @@ export default {
return false;
},
message() {
if (this.contentType === 'input_csat') {
return this.$t('CONVERSATION.CSAT_REPLY_MESSAGE');
}
// If the message is an email, emailMessageContent would be present
// In that case, we would use letter package to render the email
if (this.emailMessageContent && this.isIncoming) {

View file

@ -0,0 +1,15 @@
export const buildPortalURL = portalSlug => {
const { hostURL, helpCenterURL } = window.chatwootConfig;
const baseURL = helpCenterURL || hostURL || '';
return `${baseURL}/hc/${portalSlug}`;
};
export const buildPortalArticleURL = (
portalSlug,
categorySlug,
locale,
articleId
) => {
const portalURL = buildPortalURL(portalSlug);
return `${portalURL}/${locale}/${categorySlug}/${articleId}`;
};

View file

@ -0,0 +1,29 @@
import { buildPortalArticleURL, buildPortalURL } from '../portalHelper';
describe('PortalHelper', () => {
describe('buildPortalURL', () => {
it('returns the correct url', () => {
window.chatwootConfig = {
hostURL: 'https://app.chatwoot.com',
helpCenterURL: 'https://help.chatwoot.com',
};
expect(buildPortalURL('handbook')).toEqual(
'https://help.chatwoot.com/hc/handbook'
);
window.chatwootConfig = {};
});
});
describe('buildPortalArticleURL', () => {
it('returns the correct url', () => {
window.chatwootConfig = {
hostURL: 'https://app.chatwoot.com',
helpCenterURL: 'https://help.chatwoot.com',
};
expect(buildPortalArticleURL('handbook', 'culture', 'fr', 1)).toEqual(
'https://help.chatwoot.com/hc/handbook/fr/culture/1'
);
window.chatwootConfig = {};
});
});
});

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,6 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal-Slug für URLs",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug ist erforderlich"
},
"DOMAIN": {
@ -247,7 +246,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Kategorie-Slug für URLs",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug ist erforderlich"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -1,6 +1,7 @@
{
"CONVERSATION": {
"SELECT_A_CONVERSATION": "Please select a conversation from left pane",
"CSAT_REPLY_MESSAGE": "Please rate the conversation",
"404": "Sorry, we cannot find the conversation. Please try again",
"SWITCH_VIEW_LAYOUT": "Switch the layout",
"DASHBOARD_APP_TAB_MESSAGES": "Messages",

View file

@ -160,7 +160,8 @@
}
},
"ADD": {
"CREATE_FLOW": [{
"CREATE_FLOW": [
{
"title": "Help center information",
"route": "new_portal_information",
"body": "Basic information about portal",
@ -211,7 +212,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -352,7 +353,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {
@ -383,7 +384,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug مورد نیاز است"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Slug دسته برای آدرس ها",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug مورد نیاز است"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Slug portale per URLs",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug è obbligatorio"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Slug categoria per url",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug è obbligatorio"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Slug do Portal para URLs",
"HELP_TEXT": "app.chatwoot.com/portal/meu-portal",
"HELP_TEXT": "app.chatwoot.com/hc/meu-portal",
"ERROR": "Slug é obrigatório"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Categoria de slug para URLs",
"HELP_TEXT": "app.chatwoot.com/portal/meu-portal/en-US/categories/meu-slug",
"HELP_TEXT": "app.chatwoot.com/hc/meu-portal/en-US/categories/meu-slug",
"ERROR": "Slug é obrigatório"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Метка",
"PLACEHOLDER": "Слаг портала для url",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Необходимо указать метку"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Метка",
"PLACEHOLDER": "Метка категории для url",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Необходимо указать метку"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Slug portala za adrese",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug je obavezan"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Slug kategorije za adrese",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug je obavezan"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Мітка",
"PLACEHOLDER": "Портал slug для URL-адрес",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Необхідно вказати мітку"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Мітка",
"PLACEHOLDER": "Мітка категорії для URL-адрес",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Необхідно вказати мітку"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/zh-CN/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/zh-CN/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -164,7 +164,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Portal slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal",
"ERROR": "Slug is required"
},
"DOMAIN": {
@ -247,7 +247,7 @@
"SLUG": {
"LABEL": "Slug",
"PLACEHOLDER": "Category slug for urls",
"HELP_TEXT": "app.chatwoot.com/portal/my-portal/en-US/categories/my-slug",
"HELP_TEXT": "app.chatwoot.com/hc/my-portal/en-US/categories/my-slug",
"ERROR": "Slug is required"
},
"DESCRIPTION": {

View file

@ -1,8 +1,9 @@
<template>
<div class="edit-article--container">
<input
<resizable-text-area
v-model="articleTitle"
type="text"
rows="1"
class="article-heading"
:placeholder="$t('HELP_CENTER.EDIT_ARTICLE.TITLE_PLACEHOLDER')"
@focus="onFocus"
@ -23,11 +24,13 @@
<script>
import { debounce } from '@chatwoot/utils';
import ResizableTextArea from 'shared/components/ResizableTextArea';
import WootMessageEditor from 'dashboard/components/widgets/WootWriter/Editor.vue';
export default {
components: {
WootMessageEditor,
ResizableTextArea,
},
props: {
article: {
@ -83,7 +86,8 @@ export default {
font-size: var(--font-size-giga);
font-weight: var(--font-weight-bold);
min-height: var(--space-jumbo);
max-height: var(--space-jumbo);
max-height: 64rem;
height: auto;
border: 0px solid transparent;
padding: 0;
color: var(--s-900);

View file

@ -243,7 +243,7 @@ export default {
this.$emit('add-locale', this.portal.id);
},
openSite() {
this.$emit('open-site');
this.$emit('open-site', this.portal.slug);
},
openSettings() {
this.fetchPortalsAndItsCategories();

View file

@ -50,7 +50,7 @@
:error="slugError"
:label="$t('HELP_CENTER.PORTAL.ADD.SLUG.LABEL')"
:placeholder="$t('HELP_CENTER.PORTAL.ADD.SLUG.PLACEHOLDER')"
:help-text="$t('HELP_CENTER.PORTAL.ADD.SLUG.HELP_TEXT')"
:help-text="domainHelpText"
@input="$v.slug.$touch"
/>
</div>
@ -80,6 +80,7 @@
import thumbnail from 'dashboard/components/widgets/Thumbnail';
import { required, minLength } from 'vuelidate/lib/validators';
import { convertToCategorySlug } from 'dashboard/helper/commons.js';
import { buildPortalURL } from 'dashboard/helper/portalHelper';
export default {
components: {
@ -132,6 +133,9 @@ export default {
domainError() {
return this.$v.domain.$error;
},
domainHelpText() {
return buildPortalURL(this.slug);
},
},
mounted() {
const portal = this.portal || {};

View file

@ -51,6 +51,7 @@ import Spinner from 'shared/components/Spinner';
import portalMixin from '../../mixins/portalMixin';
import alertMixin from 'shared/mixins/alertMixin';
import wootConstants from 'dashboard/constants';
import { buildPortalArticleURL } from 'dashboard/helper/portalHelper';
const { ARTICLE_STATUS_TYPES } = wootConstants;
export default {
@ -86,7 +87,12 @@ export default {
},
portalLink() {
const slug = this.$route.params.portalSlug;
return `/hc/${slug}/${this.article.category.slug}/${this.article.id}`;
return buildPortalArticleURL(
slug,
this.article.category.slug,
this.article.category.locale,
this.article.id
);
},
},
mounted() {

View file

@ -1,5 +1,5 @@
<template>
<div class="container">
<div class="container overflow-auto">
<article-header
:header-title="headerTitle"
:count="articleCount"
@ -149,6 +149,7 @@ export default {
.container {
padding: 0 var(--space-normal);
width: 100%;
overflow: auto;
.articles--loader {
align-items: center;
display: flex;

View file

@ -126,5 +126,6 @@ export default {
}
.is-sidebar-open {
flex: 0.7;
flex-grow: 1;
}
</style>

View file

@ -21,6 +21,7 @@
:portal="portal"
:status="portalStatus"
@add-locale="addLocale"
@open-site="openPortal"
/>
<div v-if="isFetching" class="portals--loader">
<spinner />
@ -51,6 +52,8 @@ import PortalListItem from '../../components/PortalListItem';
import Spinner from 'shared/components/Spinner.vue';
import EmptyState from 'dashboard/components/widgets/EmptyState';
import AddLocale from '../../components/AddLocale';
import { buildPortalURL } from 'dashboard/helper/portalHelper';
export default {
components: {
PortalListItem,
@ -79,6 +82,9 @@ export default {
},
},
methods: {
openPortal(portalSlug) {
window.open(buildPortalURL(portalSlug), '_blank');
},
addPortal() {
this.$router.push({ name: 'new_portal_information' });
},

View file

@ -11,4 +11,12 @@ class ApplicationRecord < ActiveRecord::Base
"#{self.class.name}Drop".constantize.new(self)
end
private
def normalize_empty_string_to_nil(attrs = [])
attrs.each do |attr|
self[attr] = nil if self[attr].blank?
end
end
end

View file

@ -38,6 +38,7 @@ class Portal < ApplicationRecord
source: :user
has_one_attached :logo
before_validation -> { normalize_empty_string_to_nil(%i[custom_domain homepage_link]) }
validates :account_id, presence: true
validates :name, presence: true
validates :slug, presence: true, uniqueness: true

View file

@ -9,6 +9,8 @@ json.meta article.meta
json.category do
json.id article.category_id
json.name article.category.name
json.slug article.category.slug
json.locale article.category.locale
end
if article.portal.present?

View file

@ -33,6 +33,7 @@
<script>
window.chatwootConfig = {
hostURL: '<%= ENV.fetch('FRONTEND_URL', '') %>',
helpCenterURL: '<%= ENV.fetch('HELPCENTER_URL', '') %>',
fbAppId: '<%= ENV.fetch('FB_APP_ID', nil) %>',
fbApiVersion: '<%= @global_config['FACEBOOK_API_VERSION'] %>',
signupEnabled: '<%= @global_config['ENABLE_ACCOUNT_SIGNUP'] %>',

View file

@ -15,7 +15,7 @@
</div>
<% else %>
<% category.articles.published.take(5).each do |article| %>
<div class="flex justify-between content-center h-8 my-1">
<div class="flex justify-between content-center my-1">
<a
class="text-slate-800 hover:underline leading-8"
href="/hc/<%= portal.slug %>/<%= category.locale %>/<%= category.slug %>/<%= article.id %>"

View file

@ -17,6 +17,7 @@
</div>
<% end %>
</div>
<% if @portal.config["allowed_locales"].length > 1 %>
<div class="flex items-center">
<div class="inline-flex relative w-24">
<select
@ -32,5 +33,6 @@
</div>
</div>
</div>
<% end %>
</nav>
</header>

View file

@ -1,7 +1,7 @@
<%= render "public/api/v1/portals/hero", portal: @portal %>
<div class="max-w-5xl w-full flex-grow mx-auto py-8 px-4">
<div class="grid grid-cols-1 lg:grid-cols-2 gap-x-32 gap-y-0 lg:gap-y-12">
<% @portal.categories.where(locale: params[:locale]).each do |category| %>
<% @portal.categories.where(locale: @locale).each do |category| %>
<%= render "public/api/v1/portals/category-block", category: category, portal: @portal %>
<% end %>
</div>

View file

@ -1,5 +1,5 @@
shared: &shared
version: '2.9.0'
version: '2.9.1'
development:
<<: *shared

View file

@ -287,6 +287,7 @@ Rails.application.routes.draw do
end
end
get 'hc/:slug', to: 'public/api/v1/portals#show'
get 'hc/:slug/:locale', to: 'public/api/v1/portals#show'
get 'hc/:slug/:locale/categories', to: 'public/api/v1/portals/categories#index'
get 'hc/:slug/:locale/:category_slug', to: 'public/api/v1/portals/categories#show'

View file

@ -1,6 +1,6 @@
{
"name": "@chatwoot/chatwoot",
"version": "2.9.0",
"version": "2.9.1",
"license": "MIT",
"scripts": {
"eslint": "eslint app/**/*.{js,vue}",

View file

@ -173,6 +173,13 @@ RSpec.describe 'Api::V1::Accounts::MacrosController', type: :request do
expect(json_response['payload']['name']).to eql(macro.name)
expect(json_response['payload']['created_by']['id']).to eql(administrator.id)
end
it 'return not_found status when macros not available' do
get "/api/v1/accounts/#{account.id}/macros/15",
headers: administrator.create_new_auth_token
expect(response).to have_http_status(:not_found)
end
end
end

View file

@ -32,6 +32,11 @@ RSpec.describe Portal, type: :model do
expect(portal).not_to be_valid
expect(portal.errors.full_messages[0]).to eq('Cofig in portal on some_other_key is not supported.')
end
it 'converts empty string to nil' do
portal.update(custom_domain: '')
expect(portal.custom_domain).to be_nil
end
end
end
end

View file

@ -5,6 +5,7 @@ module.exports = {
'./app/javascript/widget/**/*.vue',
'./app/javascript/shared/**/*.vue',
'./app/javascript/survey/**/*.vue',
'./app/views/**/*.html.erb',
],
future: {
removeDeprecatedGapUtilities: true,