From 76a4140224a1bfbbcd31e222c4cd18baedc05b38 Mon Sep 17 00:00:00 2001 From: Honza Sterba Date: Wed, 20 Nov 2024 13:39:17 +0000 Subject: [PATCH 1/2] fix: Feature flags are not be stored on account creation (#10387) when creating an account via the platform API the feature flags do not get stored Co-authored-by: Sojan Jose --- app/controllers/platform/api/v1/accounts_controller.rb | 1 + .../platform/api/v1/accounts_controller_spec.rb | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/platform/api/v1/accounts_controller.rb b/app/controllers/platform/api/v1/accounts_controller.rb index 9e6d53fef..e11cf9d4a 100644 --- a/app/controllers/platform/api/v1/accounts_controller.rb +++ b/app/controllers/platform/api/v1/accounts_controller.rb @@ -4,6 +4,7 @@ class Platform::Api::V1::AccountsController < PlatformController def create @resource = Account.create!(account_params) update_resource_features + @resource.save! @platform_app.platform_app_permissibles.find_or_create_by(permissible: @resource) end diff --git a/spec/controllers/platform/api/v1/accounts_controller_spec.rb b/spec/controllers/platform/api/v1/accounts_controller_spec.rb index db1713bb6..c7b5b275b 100644 --- a/spec/controllers/platform/api/v1/accounts_controller_spec.rb +++ b/spec/controllers/platform/api/v1/accounts_controller_spec.rb @@ -60,11 +60,10 @@ RSpec.describe 'Platform Accounts API', type: :request do } }, headers: { api_access_token: platform_app.access_token.token }, as: :json json_response = response.parsed_body + created_account = Account.find(json_response['id']) + expect(created_account.enabled_features.keys).to match_array(%w[inbox_management ip_lookup help_center]) expect(json_response['name']).to include('Test Account') - expect(json_response['features']['inbox_management']).to be(true) - expect(json_response['features']['ip_lookup']).to be(true) - expect(json_response['features']['help_center']).to be(true) - expect(json_response['features']['disable_branding']).to be_nil + expect(json_response['features'].keys).to match_array(%w[inbox_management ip_lookup help_center]) end it 'creates an account with limits settings' do From b0d6089bb603940127909e0def72c45f1750fa8d Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Wed, 20 Nov 2024 20:21:35 +0530 Subject: [PATCH 2/2] feat: Updates on new components (#10444) --- .../Campaigns/CampaignCard/CampaignCard.vue | 96 +++++++------- .../CampaignCard/LiveChatCampaignDetails.vue | 8 +- .../EmptyState/LiveChatCampaignEmptyState.vue | 1 - .../EmptyState/SMSCampaignEmptyState.vue | 1 - .../Pages/CampaignPage/CampaignList.vue | 1 - .../EditLiveChatCampaignDialog.vue | 16 +-- .../dashboard/components-next/CardLayout.vue | 21 ++- .../HelpCenter/ArticleCard/ArticleCard.vue | 123 +++++++++--------- .../HelpCenter/CategoryCard/CategoryCard.vue | 98 +++++++------- .../HelpCenter/LocaleCard/LocaleCard.vue | 100 +++++++------- .../ArticleEditorControls.vue | 17 +-- .../Pages/CategoryPage/EditCategoryDialog.vue | 20 ++- .../Pages/LocalePage/AddLocaleDialog.vue | 22 ++-- .../AddCustomDomainDialog.vue | 28 ++-- .../DNSConfigurationDialog.vue | 31 +++-- .../PortalSettingsPage/PortalBaseSettings.vue | 8 +- .../PortalSwitcher/CreatePortalDialog.vue | 46 ++++--- .../PortalSwitcher/PortalSwitcher.vue | 9 +- .../components-next/avatar/Avatar.story.vue | 101 ++++++++++---- .../components-next/avatar/Avatar.vue | 59 +++++++-- .../avatar/EditableAvatar.story.vue | 36 ----- .../components-next/avatar/EditableAvatar.vue | 105 --------------- .../components-next/button/Button.vue | 8 +- .../components-next/combobox/ComboBox.vue | 6 +- .../combobox/ComboBoxDropdown.vue | 18 ++- .../components-next/dialog/Dialog.story.vue | 54 +++++--- .../components-next/dialog/Dialog.vue | 76 +++++++---- .../dropdown-menu/DropdownMenu.story.vue | 14 ++ .../dropdown-menu/DropdownMenu.vue | 78 +++++++++-- .../dashboard/components-next/input/Input.vue | 57 +++++++- .../components-next/taginput/TagInput.vue | 8 ++ .../components-next/thumbnail/Thumbnail.vue | 117 ----------------- .../dashboard/i18n/locale/en/components.json | 4 + 33 files changed, 684 insertions(+), 703 deletions(-) delete mode 100644 app/javascript/dashboard/components-next/avatar/EditableAvatar.story.vue delete mode 100644 app/javascript/dashboard/components-next/avatar/EditableAvatar.vue delete mode 100644 app/javascript/dashboard/components-next/thumbnail/Thumbnail.vue diff --git a/app/javascript/dashboard/components-next/Campaigns/CampaignCard/CampaignCard.vue b/app/javascript/dashboard/components-next/Campaigns/CampaignCard/CampaignCard.vue index dbdbb5b45..229553253 100644 --- a/app/javascript/dashboard/components-next/Campaigns/CampaignCard/CampaignCard.vue +++ b/app/javascript/dashboard/components-next/Campaigns/CampaignCard/CampaignCard.vue @@ -82,60 +82,56 @@ const inboxIcon = computed(() => { diff --git a/app/javascript/dashboard/components-next/Campaigns/CampaignCard/LiveChatCampaignDetails.vue b/app/javascript/dashboard/components-next/Campaigns/CampaignCard/LiveChatCampaignDetails.vue index 6f8c548d4..6a883ce6b 100644 --- a/app/javascript/dashboard/components-next/Campaigns/CampaignCard/LiveChatCampaignDetails.vue +++ b/app/javascript/dashboard/components-next/Campaigns/CampaignCard/LiveChatCampaignDetails.vue @@ -1,7 +1,8 @@ - + diff --git a/app/javascript/dashboard/components-next/avatar/EditableAvatar.story.vue b/app/javascript/dashboard/components-next/avatar/EditableAvatar.story.vue deleted file mode 100644 index ca0e38173..000000000 --- a/app/javascript/dashboard/components-next/avatar/EditableAvatar.story.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - diff --git a/app/javascript/dashboard/components-next/avatar/EditableAvatar.vue b/app/javascript/dashboard/components-next/avatar/EditableAvatar.vue deleted file mode 100644 index 2c71963c1..000000000 --- a/app/javascript/dashboard/components-next/avatar/EditableAvatar.vue +++ /dev/null @@ -1,105 +0,0 @@ - - - diff --git a/app/javascript/dashboard/components-next/button/Button.vue b/app/javascript/dashboard/components-next/button/Button.vue index 67918be2e..02dcfad53 100644 --- a/app/javascript/dashboard/components-next/button/Button.vue +++ b/app/javascript/dashboard/components-next/button/Button.vue @@ -6,7 +6,7 @@ import Icon from 'dashboard/components-next/icon/Icon.vue'; const props = defineProps({ label: { - type: String, + type: [String, Number], default: '', }, variant: { @@ -47,9 +47,9 @@ const STYLE_CONFIG = { blue: { solid: 'bg-n-brand text-white hover:brightness-110 outline-transparent', faded: - 'bg-n-brand/10 text-n-slate-12 hover:bg-n-brand/20 outline-transparent', + 'bg-n-brand/10 text-n-blue-text hover:bg-n-brand/20 outline-transparent', outline: 'text-n-blue-text outline-n-blue-border', - link: 'text-n-brand hover:underline outline-transparent', + link: 'text-n-blue-text hover:underline outline-transparent', }, ruby: { solid: 'bg-n-ruby-9 text-white hover:bg-n-ruby-10 outline-transparent', @@ -161,7 +161,7 @@ const linkButtonClasses = computed(() => { - {{ label }} + {{ label }} diff --git a/app/javascript/dashboard/components-next/combobox/ComboBox.vue b/app/javascript/dashboard/components-next/combobox/ComboBox.vue index 7fce6f64c..de84974e6 100644 --- a/app/javascript/dashboard/components-next/combobox/ComboBox.vue +++ b/app/javascript/dashboard/components-next/combobox/ComboBox.vue @@ -43,7 +43,7 @@ const props = defineProps({ }, }); -const emit = defineEmits(['update:modelValue']); +const emit = defineEmits(['update:modelValue', 'search']); const { t } = useI18n(); @@ -118,13 +118,13 @@ watch( diff --git a/app/javascript/dashboard/components-next/combobox/ComboBoxDropdown.vue b/app/javascript/dashboard/components-next/combobox/ComboBoxDropdown.vue index 4a0e3856c..a39657624 100644 --- a/app/javascript/dashboard/components-next/combobox/ComboBoxDropdown.vue +++ b/app/javascript/dashboard/components-next/combobox/ComboBoxDropdown.vue @@ -11,10 +11,6 @@ const props = defineProps({ type: Array, required: true, }, - searchValue: { - type: String, - required: true, - }, searchPlaceholder: { type: String, default: '', @@ -33,10 +29,15 @@ const props = defineProps({ }, }); -const emit = defineEmits(['update:searchValue', 'select']); +const emit = defineEmits(['update:searchValue', 'select', 'search']); const { t } = useI18n(); +const searchValue = defineModel('searchValue', { + type: String, + default: '', +}); + const searchInput = ref(null); const isSelected = option => { @@ -46,6 +47,11 @@ const isSelected = option => { return option.value === props.selectedValues; }; +const onInputSearch = event => { + searchValue.value = event.target.value; + emit('search', event.target.value); +}; + defineExpose({ focus: () => searchInput.value?.focus(), }); @@ -64,7 +70,7 @@ defineExpose({ type="search" :placeholder="searchPlaceholder || t('COMBOBOX.SEARCH_PLACEHOLDER')" class="w-full py-2 pl-10 pr-2 text-sm border-none rounded-t-md bg-n-solid-1 text-slate-900 dark:text-slate-50" - @input="emit('update:searchValue', $event.target.value)" + @input="onInputSearch" />
    { alertDialog.value.open(); @@ -17,6 +18,9 @@ const openEditDialog = () => { const openConfirmDialog = () => { confirmDialog.value.open(); }; +const openConfirmDialogWithCustomFooter = () => { + confirmDialogWithCustomFooter.value.open(); +}; // eslint-disable-next-line no-unused-vars const onConfirm = dialog => {}; @@ -44,24 +48,22 @@ const onConfirm = dialog => {}; confirm-button-label="Save" @confirm="onConfirm()" > - +
    + + +
    @@ -77,5 +79,21 @@ const onConfirm = dialog => {}; @confirm="onConfirm()" /> + + +