chore: Update buttons in labels page (#11126)
This commit is contained in:
@@ -5,7 +5,12 @@ import validations, { getLabelTitleErrorMessage } from './validations';
|
|||||||
import { getRandomColor } from 'dashboard/helper/labelColor';
|
import { getRandomColor } from 'dashboard/helper/labelColor';
|
||||||
import { useVuelidate } from '@vuelidate/core';
|
import { useVuelidate } from '@vuelidate/core';
|
||||||
|
|
||||||
|
import NextButton from 'dashboard/components-next/button/Button.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
NextButton,
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
prefillTitle: {
|
prefillTitle: {
|
||||||
type: String,
|
type: String,
|
||||||
@@ -105,16 +110,20 @@ export default {
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center justify-end w-full gap-2 px-0 py-2">
|
<div class="flex items-center justify-end w-full gap-2 px-0 py-2">
|
||||||
<woot-button
|
<NextButton
|
||||||
:is-disabled="v$.title.$invalid || uiFlags.isCreating"
|
faded
|
||||||
:is-loading="uiFlags.isCreating"
|
slate
|
||||||
|
type="reset"
|
||||||
|
:label="$t('LABEL_MGMT.FORM.CANCEL')"
|
||||||
|
@click.prevent="onClose"
|
||||||
|
/>
|
||||||
|
<NextButton
|
||||||
|
type="submit"
|
||||||
data-testid="label-submit"
|
data-testid="label-submit"
|
||||||
>
|
:label="$t('LABEL_MGMT.FORM.CREATE')"
|
||||||
{{ $t('LABEL_MGMT.FORM.CREATE') }}
|
:disabled="v$.title.$invalid || uiFlags.isCreating"
|
||||||
</woot-button>
|
:is-loading="uiFlags.isCreating"
|
||||||
<woot-button class="button clear" @click.prevent="onClose">
|
/>
|
||||||
{{ $t('LABEL_MGMT.FORM.CANCEL') }}
|
|
||||||
</woot-button>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,7 +4,12 @@ import { useAlert } from 'dashboard/composables';
|
|||||||
import validations, { getLabelTitleErrorMessage } from './validations';
|
import validations, { getLabelTitleErrorMessage } from './validations';
|
||||||
import { useVuelidate } from '@vuelidate/core';
|
import { useVuelidate } from '@vuelidate/core';
|
||||||
|
|
||||||
|
import NextButton from 'dashboard/components-next/button/Button.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
NextButton,
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
selectedResponse: {
|
selectedResponse: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@@ -109,15 +114,19 @@ export default {
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center justify-end w-full gap-2 px-0 py-2">
|
<div class="flex items-center justify-end w-full gap-2 px-0 py-2">
|
||||||
<woot-button
|
<NextButton
|
||||||
:is-disabled="v$.title.$invalid || uiFlags.isUpdating"
|
faded
|
||||||
|
slate
|
||||||
|
type="reset"
|
||||||
|
:label="$t('LABEL_MGMT.FORM.CANCEL')"
|
||||||
|
@click.prevent="onClose"
|
||||||
|
/>
|
||||||
|
<NextButton
|
||||||
|
type="submit"
|
||||||
|
:label="$t('LABEL_MGMT.FORM.EDIT')"
|
||||||
|
:disabled="v$.title.$invalid || uiFlags.isUpdating"
|
||||||
:is-loading="uiFlags.isUpdating"
|
:is-loading="uiFlags.isUpdating"
|
||||||
>
|
/>
|
||||||
{{ $t('LABEL_MGMT.FORM.EDIT') }}
|
|
||||||
</woot-button>
|
|
||||||
<woot-button class="button clear" @click.prevent="onClose">
|
|
||||||
{{ $t('LABEL_MGMT.FORM.CANCEL') }}
|
|
||||||
</woot-button>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import AddLabel from './AddLabel.vue';
|
|||||||
import EditLabel from './EditLabel.vue';
|
import EditLabel from './EditLabel.vue';
|
||||||
import BaseSettingsHeader from '../components/BaseSettingsHeader.vue';
|
import BaseSettingsHeader from '../components/BaseSettingsHeader.vue';
|
||||||
import SettingsLayout from '../SettingsLayout.vue';
|
import SettingsLayout from '../SettingsLayout.vue';
|
||||||
|
import Button from 'dashboard/components-next/button/Button.vue';
|
||||||
|
|
||||||
const getters = useStoreGetters();
|
const getters = useStoreGetters();
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
@@ -94,13 +95,11 @@ onBeforeMount(() => {
|
|||||||
feature-name="labels"
|
feature-name="labels"
|
||||||
>
|
>
|
||||||
<template #actions>
|
<template #actions>
|
||||||
<woot-button
|
<Button
|
||||||
class="rounded-md button nice"
|
icon="i-lucide-circle-plus"
|
||||||
icon="add-circle"
|
:label="$t('LABEL_MGMT.HEADER_BTN_TXT')"
|
||||||
@click="openAddPopup"
|
@click="openAddPopup"
|
||||||
>
|
/>
|
||||||
{{ $t('LABEL_MGMT.HEADER_BTN_TXT') }}
|
|
||||||
</woot-button>
|
|
||||||
</template>
|
</template>
|
||||||
</BaseSettingsHeader>
|
</BaseSettingsHeader>
|
||||||
</template>
|
</template>
|
||||||
@@ -140,23 +139,21 @@ onBeforeMount(() => {
|
|||||||
</td>
|
</td>
|
||||||
<td class="py-4 min-w-xs">
|
<td class="py-4 min-w-xs">
|
||||||
<div class="flex gap-1 justify-end">
|
<div class="flex gap-1 justify-end">
|
||||||
<woot-button
|
<Button
|
||||||
v-tooltip.top="$t('LABEL_MGMT.FORM.EDIT')"
|
v-tooltip.top="$t('LABEL_MGMT.FORM.EDIT')"
|
||||||
variant="smooth"
|
icon="i-lucide-pen"
|
||||||
size="tiny"
|
slate
|
||||||
color-scheme="secondary"
|
xs
|
||||||
class-names="grey-btn"
|
faded
|
||||||
:is-loading="loading[label.id]"
|
:is-loading="loading[label.id]"
|
||||||
icon="edit"
|
|
||||||
@click="openEditPopup(label)"
|
@click="openEditPopup(label)"
|
||||||
/>
|
/>
|
||||||
<woot-button
|
<Button
|
||||||
v-tooltip.top="$t('LABEL_MGMT.FORM.DELETE')"
|
v-tooltip.top="$t('LABEL_MGMT.FORM.DELETE')"
|
||||||
variant="smooth"
|
icon="i-lucide-trash-2"
|
||||||
color-scheme="alert"
|
xs
|
||||||
size="tiny"
|
ruby
|
||||||
icon="dismiss-circle"
|
faded
|
||||||
class-names="grey-btn"
|
|
||||||
:is-loading="loading[label.id]"
|
:is-loading="loading[label.id]"
|
||||||
@click="openDeletePopup(label, index)"
|
@click="openDeletePopup(label, index)"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user