diff --git a/app/javascript/dashboard/assets/scss/_layout.scss b/app/javascript/dashboard/assets/scss/_layout.scss index 54a03c403..b9c8a9bf1 100644 --- a/app/javascript/dashboard/assets/scss/_layout.scss +++ b/app/javascript/dashboard/assets/scss/_layout.scss @@ -11,6 +11,7 @@ body { 'Segoe UI', Roboto, 'Helvetica Neue', + Tahoma, Arial, sans-serif !important; -moz-osx-font-smoothing: grayscale; diff --git a/app/javascript/dashboard/assets/scss/widgets/_buttons.scss b/app/javascript/dashboard/assets/scss/widgets/_buttons.scss index 54fc27e25..587b810ca 100644 --- a/app/javascript/dashboard/assets/scss/widgets/_buttons.scss +++ b/app/javascript/dashboard/assets/scss/widgets/_buttons.scss @@ -118,7 +118,7 @@ button { @apply border border-woot-500 bg-transparent dark:bg-transparent dark:border-woot-500 text-woot-500 dark:text-woot-500 hover:bg-woot-50 dark:hover:bg-woot-900; &.secondary { - @apply text-slate-700 border-slate-200 dark:border-slate-600 dark:text-slate-100 hover:bg-slate-50 dark:hover:bg-slate-700; + @apply text-slate-700 border-slate-100 dark:border-slate-800 dark:text-slate-100 hover:bg-slate-50 dark:hover:bg-slate-700; } &.success { diff --git a/app/javascript/dashboard/components/CustomAttribute.vue b/app/javascript/dashboard/components/CustomAttribute.vue index f89579773..b50ad54cb 100644 --- a/app/javascript/dashboard/components/CustomAttribute.vue +++ b/app/javascript/dashboard/components/CustomAttribute.vue @@ -2,23 +2,27 @@

-
+
{{ label }}
-
+
{{ urlValue }}

{{ displayValue || '---' }}

@@ -126,6 +130,7 @@ diff --git a/app/javascript/dashboard/routes/dashboard/conversation/contact/ContactForm.vue b/app/javascript/dashboard/routes/dashboard/conversation/contact/ContactForm.vue index bbe545a3d..b958d4211 100644 --- a/app/javascript/dashboard/routes/dashboard/conversation/contact/ContactForm.vue +++ b/app/javascript/dashboard/routes/dashboard/conversation/contact/ContactForm.vue @@ -125,8 +125,9 @@ > {{ socialProfile.prefixURL }} + {{ socialProfile.prefixURL }} + -
-

- {{ $t('CUSTOM_ATTRIBUTES.FORM.ATTRIBUTE_SELECT.TITLE') }} -

-
- -
-
-
- - - -
- {{ $t('CUSTOM_ATTRIBUTES.FORM.ATTRIBUTE_SELECT.NO_RESULT') }} -
- - {{ $t('CUSTOM_ATTRIBUTES.FORM.ADD.TITLE') }} - -
-
-
- - - - - diff --git a/app/javascript/dashboard/routes/dashboard/conversation/customAttributes/CustomAttributeDropDownItem.vue b/app/javascript/dashboard/routes/dashboard/conversation/customAttributes/CustomAttributeDropDownItem.vue deleted file mode 100644 index 8bae9c1b0..000000000 --- a/app/javascript/dashboard/routes/dashboard/conversation/customAttributes/CustomAttributeDropDownItem.vue +++ /dev/null @@ -1,79 +0,0 @@ - - - - - diff --git a/app/javascript/dashboard/routes/dashboard/conversation/customAttributes/CustomAttributeSelector.vue b/app/javascript/dashboard/routes/dashboard/conversation/customAttributes/CustomAttributeSelector.vue deleted file mode 100644 index 60ef9d860..000000000 --- a/app/javascript/dashboard/routes/dashboard/conversation/customAttributes/CustomAttributeSelector.vue +++ /dev/null @@ -1,138 +0,0 @@ - - - - - diff --git a/app/javascript/dashboard/routes/dashboard/conversation/customAttributes/CustomAttributes.vue b/app/javascript/dashboard/routes/dashboard/conversation/customAttributes/CustomAttributes.vue index ca721d4d8..cf54e7087 100644 --- a/app/javascript/dashboard/routes/dashboard/conversation/customAttributes/CustomAttributes.vue +++ b/app/javascript/dashboard/routes/dashboard/conversation/customAttributes/CustomAttributes.vue @@ -1,23 +1,35 @@ @@ -25,13 +37,14 @@ import CustomAttribute from 'dashboard/components/CustomAttribute.vue'; import alertMixin from 'shared/mixins/alertMixin'; import attributeMixin from 'dashboard/mixins/attributeMixin'; +import uiSettingsMixin from 'dashboard/mixins/uiSettings'; import { copyTextToClipboard } from 'shared/helpers/clipboard'; export default { components: { CustomAttribute, }, - mixins: [alertMixin, attributeMixin], + mixins: [alertMixin, attributeMixin, uiSettingsMixin], props: { attributeType: { type: String, @@ -42,8 +55,67 @@ export default { default: '', }, contactId: { type: Number, default: null }, + attributeFrom: { + type: String, + required: true, + }, + }, + data() { + return { + showAllAttributes: false, + }; + }, + computed: { + toggleButtonText() { + return !this.showAllAttributes + ? this.$t('CUSTOM_ATTRIBUTES.SHOW_MORE') + : this.$t('CUSTOM_ATTRIBUTES.SHOW_LESS'); + }, + filteredAttributes() { + return this.attributes.map(attribute => { + // Check if the attribute key exists in customAttributes + const hasValue = Object.hasOwnProperty.call( + this.customAttributes, + attribute.attribute_key + ); + + const isCheckbox = attribute.attribute_display_type === 'checkbox'; + const defaultValue = isCheckbox ? false : ''; + + return { + ...attribute, + // Set value from customAttributes if it exists, otherwise use default value + value: hasValue + ? this.customAttributes[attribute.attribute_key] + : defaultValue, + }; + }); + }, + displayedAttributes() { + // Show only the first 5 attributes or all depending on showAllAttributes + if (this.showAllAttributes || this.filteredAttributes.length <= 5) { + return this.filteredAttributes; + } + return this.filteredAttributes.slice(0, 5); + }, + showMoreUISettingsKey() { + return `show_all_attributes_${this.attributeFrom}`; + }, + }, + mounted() { + this.initializeSettings(); }, methods: { + initializeSettings() { + this.showAllAttributes = + this.uiSettings[this.showMoreUISettingsKey] || false; + }, + onClickToggle() { + this.showAllAttributes = !this.showAllAttributes; + this.updateUISettings({ + [this.showMoreUISettingsKey]: this.showAllAttributes, + }); + }, async onUpdate(key, value) { const updatedAttributes = { ...this.customAttributes, [key]: value }; try { @@ -96,16 +168,17 @@ export default { }, }; +