mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 11:37:58 +00:00
feat: Adds helper text for custom fields in contact sidebars (#9317)
* feat: Adds helper text for custom fields in contact sidebars * Update app/javascript/dashboard/components/ui/HelperTextPopup.vue Co-authored-by: Shivam Mishra <scm.mymail@gmail.com> * chore: Review fix --------- Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex items-center justify-between w-full">
|
<div class="flex items-center justify-between w-full">
|
||||||
<span
|
<span
|
||||||
class="w-full font-medium text-sm mb-0"
|
class="w-full inline-flex gap-1.5 items-start font-medium whitespace-nowrap text-sm mb-0"
|
||||||
:class="
|
:class="
|
||||||
$v.editedValue.$error
|
$v.editedValue.$error
|
||||||
? 'text-red-400 dark:text-red-500'
|
? 'text-red-400 dark:text-red-500'
|
||||||
@@ -20,6 +20,11 @@
|
|||||||
"
|
"
|
||||||
>
|
>
|
||||||
{{ label }}
|
{{ label }}
|
||||||
|
<helper-text-popup
|
||||||
|
v-if="description"
|
||||||
|
:message="description"
|
||||||
|
class="mt-0.5"
|
||||||
|
/>
|
||||||
</span>
|
</span>
|
||||||
<woot-button
|
<woot-button
|
||||||
v-if="showCopyAndDeleteButton"
|
v-if="showCopyAndDeleteButton"
|
||||||
@@ -41,7 +46,7 @@
|
|||||||
ref="inputfield"
|
ref="inputfield"
|
||||||
v-model="editedValue"
|
v-model="editedValue"
|
||||||
:type="inputType"
|
:type="inputType"
|
||||||
class="!h-8 ltr:rounded-r-none rtl:rounded-l-none !mb-0 !text-sm"
|
class="!h-8 ltr:!rounded-r-none rtl:!rounded-l-none !mb-0 !text-sm"
|
||||||
autofocus="true"
|
autofocus="true"
|
||||||
:class="{ error: $v.editedValue.$error }"
|
:class="{ error: $v.editedValue.$error }"
|
||||||
@blur="$v.editedValue.$touch"
|
@blur="$v.editedValue.$touch"
|
||||||
@@ -130,22 +135,25 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mixin as clickaway } from 'vue-clickaway';
|
|
||||||
import { format, parseISO } from 'date-fns';
|
import { format, parseISO } from 'date-fns';
|
||||||
import { required, url } from 'vuelidate/lib/validators';
|
import { required, url } from 'vuelidate/lib/validators';
|
||||||
import { BUS_EVENTS } from 'shared/constants/busEvents';
|
import { BUS_EVENTS } from 'shared/constants/busEvents';
|
||||||
import MultiselectDropdown from 'shared/components/ui/MultiselectDropdown.vue';
|
import MultiselectDropdown from 'shared/components/ui/MultiselectDropdown.vue';
|
||||||
|
import HelperTextPopup from 'dashboard/components/ui/HelperTextPopup.vue';
|
||||||
import { isValidURL } from '../helper/URLHelper';
|
import { isValidURL } from '../helper/URLHelper';
|
||||||
import customAttributeMixin from '../mixins/customAttributeMixin';
|
import customAttributeMixin from '../mixins/customAttributeMixin';
|
||||||
|
|
||||||
const DATE_FORMAT = 'yyyy-MM-dd';
|
const DATE_FORMAT = 'yyyy-MM-dd';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
MultiselectDropdown,
|
MultiselectDropdown,
|
||||||
|
HelperTextPopup,
|
||||||
},
|
},
|
||||||
mixins: [customAttributeMixin, clickaway],
|
mixins: [customAttributeMixin],
|
||||||
props: {
|
props: {
|
||||||
label: { type: String, required: true },
|
label: { type: String, required: true },
|
||||||
|
description: { type: String, default: '' },
|
||||||
values: { type: Array, default: () => [] },
|
values: { type: Array, default: () => [] },
|
||||||
value: { type: [String, Number, Boolean], default: '' },
|
value: { type: [String, Number, Boolean], default: '' },
|
||||||
showActions: { type: Boolean, default: false },
|
showActions: { type: Boolean, default: false },
|
||||||
|
|||||||
24
app/javascript/dashboard/components/ui/HelperTextPopup.vue
Normal file
24
app/javascript/dashboard/components/ui/HelperTextPopup.vue
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<script setup>
|
||||||
|
defineProps({
|
||||||
|
message: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<div class="relative group w-[inherit] whitespace-normal z-20">
|
||||||
|
<fluent-icon
|
||||||
|
icon="info"
|
||||||
|
size="14"
|
||||||
|
class="mt-0.5 text-slate-600 absolute dark:text-slate-400"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
class="bg-white dark:bg-slate-900 w-fit ltr:left-4 rtl:right-4 top-0 border p-2.5 group-hover:flex items-center hidden absolute border-slate-75 dark:border-slate-800 rounded-lg shadow-md"
|
||||||
|
>
|
||||||
|
<p class="text-slate-800 dark:text-slate-75 mb-0 text-xs">
|
||||||
|
{{ message }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
:attribute-type="attribute.attribute_display_type"
|
:attribute-type="attribute.attribute_display_type"
|
||||||
:values="attribute.attribute_values"
|
:values="attribute.attribute_values"
|
||||||
:label="attribute.attribute_display_name"
|
:label="attribute.attribute_display_name"
|
||||||
|
:description="attribute.attribute_description"
|
||||||
:value="attribute.value"
|
:value="attribute.value"
|
||||||
:show-actions="true"
|
:show-actions="true"
|
||||||
:attribute-regex="attribute.regex_pattern"
|
:attribute-regex="attribute.regex_pattern"
|
||||||
|
|||||||
Reference in New Issue
Block a user