fix: apply ESLint rule vue/custom-event-name-casing

This commit is contained in:
iamsivin
2024-07-25 23:40:54 +05:30
parent 2ef9274450
commit ecb0b4a4f4
144 changed files with 509 additions and 515 deletions
@@ -27,27 +27,27 @@ export default {
<template>
<div
v-if="showShowCurrentAccountContext"
class="text-slate-700 dark:text-slate-200 rounded-md text-xs py-2 px-2 mt-2 relative border border-slate-50 dark:border-slate-800/50 hover:bg-slate-50 dark:hover:bg-slate-800 cursor-pointer"
class="relative px-2 py-2 mt-2 text-xs border rounded-md cursor-pointer text-slate-700 dark:text-slate-200 border-slate-50 dark:border-slate-800/50 hover:bg-slate-50 dark:hover:bg-slate-800"
@mouseover="setShowSwitch"
@mouseleave="resetShowSwitch"
>
{{ $t('SIDEBAR.CURRENTLY_VIEWING_ACCOUNT') }}
<p
class="text-ellipsis overflow-hidden whitespace-nowrap font-medium mb-0 text-slate-800 dark:text-slate-100"
class="mb-0 overflow-hidden font-medium text-ellipsis whitespace-nowrap text-slate-800 dark:text-slate-100"
>
{{ account.name }}
</p>
<transition name="fade">
<div
v-if="showSwitchButton"
class="ltr:overlay-shadow ltr:dark:overlay-shadow-dark rtl:rtl-overlay-shadow rtl:dark:rtl-overlay-shadow-dark flex items-center h-full rounded-md justify-end absolute top-0 right-0 w-full"
class="absolute top-0 right-0 flex items-center justify-end w-full h-full rounded-md ltr:overlay-shadow ltr:dark:overlay-shadow-dark rtl:rtl-overlay-shadow rtl:dark:rtl-overlay-shadow-dark"
>
<div class="my-0 mx-2">
<div class="mx-2 my-0">
<woot-button
variant="clear"
size="tiny"
icon="arrow-swap"
@click="$emit('toggle-accounts')"
@click="$emit('toggleAccounts')"
>
{{ $t('SIDEBAR.SWITCH') }}
</woot-button>
@@ -27,7 +27,7 @@ export default {
<template>
<woot-modal
:show="showAccountModal"
:on-close="() => $emit('close-account-modal')"
:on-close="() => $emit('closeAccountModal')"
>
<woot-modal-header
:header-title="$t('SIDEBAR_ITEMS.CHANGE_ACCOUNTS')"
@@ -41,18 +41,18 @@ export default {
class="pt-0 pb-0"
>
<button
class="flex justify-between items-center expanded clear link cursor-pointer px-4 py-3 w-full rounded-lg hover:underline hover:bg-slate-25 dark:hover:bg-slate-900"
class="flex items-center justify-between w-full px-4 py-3 rounded-lg cursor-pointer expanded clear link hover:underline hover:bg-slate-25 dark:hover:bg-slate-900"
@click="onChangeAccount(account.id)"
>
<span class="w-full">
<label :for="account.name" class="text-left rtl:text-right">
<div
class="text-slate-700 text-lg dark:text-slate-100 font-medium hover:underline-offset-4 leading-5"
class="text-lg font-medium leading-5 text-slate-700 dark:text-slate-100 hover:underline-offset-4"
>
{{ account.name }}
</div>
<div
class="text-slate-500 text-xs dark:text-slate-500 font-medium hover:underline-offset-4"
class="text-xs font-medium text-slate-500 dark:text-slate-500 hover:underline-offset-4"
>
{{ account.role }}
</div>
@@ -71,11 +71,11 @@ export default {
<div
v-if="globalConfig.createNewAccountFromDashboard"
class="flex justify-end items-center px-8 pb-8 pt-4 gap-2"
class="flex items-center justify-end gap-2 px-8 pt-4 pb-8"
>
<button
class="button success large expanded nice w-full"
@click="$emit('show-create-account-modal')"
class="w-full button success large expanded nice"
@click="$emit('showCreateAccountModal')"
>
{{ $t('CREATE_ACCOUNT.NEW_ACCOUNT') }}
</button>
@@ -40,7 +40,7 @@ export default {
const account_id = await this.$store.dispatch('accounts/create', {
account_name: this.accountName,
});
this.$emit('close-account-create-modal');
this.$emit('closeAccountCreateModal');
useAlert(this.$t('CREATE_ACCOUNT.API.SUCCESS_MESSAGE'));
window.location = `/app/accounts/${account_id}/dashboard`;
} catch (error) {
@@ -56,17 +56,14 @@ export default {
</script>
<template>
<woot-modal
:show="show"
:on-close="() => $emit('close-account-create-modal')"
>
<div class="h-auto overflow-auto flex flex-col">
<woot-modal :show="show" :on-close="() => $emit('closeAccountCreateModal')">
<div class="flex flex-col h-auto overflow-auto">
<woot-modal-header
:header-title="$t('CREATE_ACCOUNT.NEW_ACCOUNT')"
:header-content="$t('CREATE_ACCOUNT.SELECTOR_SUBTITLE')"
/>
<div v-if="!hasAccounts" class="text-sm mt-6 mx-8 mb-0">
<div class="items-center rounded-md flex alert">
<div v-if="!hasAccounts" class="mx-8 mt-6 mb-0 text-sm">
<div class="flex items-center rounded-md alert">
<div class="ml-1 mr-3">
<fluent-icon icon="warning" />
</div>
@@ -17,7 +17,7 @@ export default {
},
methods: {
handleClick() {
this.$emit('toggle-menu');
this.$emit('toggleMenu');
},
},
};
@@ -26,7 +26,7 @@ export default {
<woot-button
v-tooltip.right="$t(`SIDEBAR.PROFILE_SETTINGS`)"
variant="link"
class="items-center flex rounded-full"
class="flex items-center rounded-full"
@click="handleClick"
>
<Thumbnail
@@ -23,7 +23,7 @@ export default {
methods: {
openNotificationPanel() {
if (this.$route.name !== 'notifications_index') {
this.$emit('open-notification-panel');
this.$emit('openNotificationPanel');
}
},
},
@@ -32,7 +32,7 @@ export default {
<template>
<div class="mb-4">
<button
class="text-slate-600 dark:text-slate-100 w-10 h-10 my-2 p-0 flex items-center justify-center rounded-lg hover:bg-slate-25 dark:hover:bg-slate-700 dark:hover:text-slate-100 hover:text-slate-600 relative"
class="relative flex items-center justify-center w-10 h-10 p-0 my-2 rounded-lg text-slate-600 dark:text-slate-100 hover:bg-slate-25 dark:hover:bg-slate-700 dark:hover:text-slate-100 hover:text-slate-600"
:class="{
'bg-woot-50 dark:bg-slate-800 text-woot-500 hover:bg-woot-50':
isNotificationPanelActive,
@@ -38,7 +38,7 @@ export default {
navigate(e);
},
handleKeyboardHelpClick() {
this.$emit('key-shortcut-modal');
this.$emit('openKeyShortcutModal');
this.$emit('close');
},
logout() {
@@ -60,7 +60,7 @@ export default {
<div
v-if="show"
v-on-clickaway="onClickAway"
class="left-3 rtl:left-auto rtl:right-3 bottom-16 w-64 absolute z-30 rounded-md shadow-xl bg-white dark:bg-slate-800 py-2 px-2 border border-slate-25 dark:border-slate-700"
class="absolute z-30 w-64 px-2 py-2 bg-white border rounded-md shadow-xl left-3 rtl:left-auto rtl:right-3 bottom-16 dark:bg-slate-800 border-slate-25 dark:border-slate-700"
:class="{ 'block visible': show }"
>
<AvailabilityStatus />
@@ -71,7 +71,7 @@ export default {
color-scheme="secondary"
size="small"
icon="arrow-swap"
@click="$emit('toggle-accounts')"
@click="$emit('toggleAccounts')"
>
{{ $t('SIDEBAR_ITEMS.CHANGE_ACCOUNTS') }}
</woot-button>
@@ -82,7 +82,7 @@ export default {
color-scheme="secondary"
size="small"
icon="chat-help"
@click="$emit('show-support-chat-window')"
@click="$emit('showSupportChatWindow')"
>
{{ $t('SIDEBAR_ITEMS.CONTACT_SUPPORT') }}
</woot-button>
@@ -106,7 +106,7 @@ export default {
>
<a
:href="href"
class="button small clear secondary bg-white dark:bg-slate-800 h-8"
class="h-8 bg-white button small clear secondary dark:bg-slate-800"
:class="{ 'is-active': isActive }"
@click="e => handleProfileSettingClick(e, navigate)"
>
@@ -131,7 +131,7 @@ export default {
<WootDropdownItem v-if="currentUser.type === 'SuperAdmin'">
<a
href="/super_admin"
class="button small clear secondary bg-white dark:bg-slate-800 h-8"
class="h-8 bg-white button small clear secondary dark:bg-slate-800"
target="_blank"
rel="noopener nofollow noreferrer"
@click="$emit('close')"
@@ -54,21 +54,21 @@ export default {
this.showOptionsMenu = !this.showOptionsMenu;
},
toggleAccountModal() {
this.$emit('toggle-accounts');
this.$emit('toggleAccounts');
},
toggleSupportChatWindow() {
window.$chatwoot.toggle();
},
openNotificationPanel() {
this.$track(ACCOUNT_EVENTS.OPENED_NOTIFICATIONS);
this.$emit('open-notification-panel');
this.$emit('openNotificationPanel');
},
},
};
</script>
<template>
<div
class="h-full w-16 bg-white dark:bg-slate-900 border-r border-slate-50 dark:border-slate-800/50 rtl:border-l rtl:border-r-0 flex justify-between flex-col"
class="flex flex-col justify-between w-16 h-full bg-white border-r dark:bg-slate-900 border-slate-50 dark:border-slate-800/50 rtl:border-l rtl:border-r-0"
>
<div class="flex flex-col items-center">
<Logo
@@ -94,13 +94,13 @@ export default {
:open-in-new-page="true"
:to="helpDocsURL"
/>
<NotificationBell @open-notification-panel="openNotificationPanel" />
<AgentDetails @toggle-menu="toggleOptions" />
<NotificationBell @openNotificationPanel="openNotificationPanel" />
<AgentDetails @toggleMenu="toggleOptions" />
<OptionsMenu
:show="showOptionsMenu"
@toggle-accounts="toggleAccountModal"
@show-support-chat-window="toggleSupportChatWindow"
@key-shortcut-modal="$emit('key-shortcut-modal')"
@toggleAccounts="toggleAccountModal"
@showSupportChatWindow="toggleSupportChatWindow"
@openKeyShortcutModal="$emit('openKeyShortcutModal')"
@close="toggleOptions"
/>
</div>
@@ -223,10 +223,10 @@ export default {
},
methods: {
showAddLabelPopup() {
this.$emit('add-label');
this.$emit('addLabel');
},
toggleAccountModal() {
this.$emit('toggle-accounts');
this.$emit('toggleAccounts');
},
showNewLink(featureFlag) {
return this.isFeatureEnabledonAccount(this.accountId, featureFlag);
@@ -237,13 +237,13 @@ export default {
<template>
<div
v-if="hasSecondaryMenu"
class="h-full overflow-auto w-48 flex flex-col bg-white dark:bg-slate-900 border-r dark:border-slate-800/50 rtl:border-r-0 rtl:border-l border-slate-50 text-sm px-2 pb-8"
class="flex flex-col w-48 h-full px-2 pb-8 overflow-auto text-sm bg-white border-r dark:bg-slate-900 dark:border-slate-800/50 rtl:border-r-0 rtl:border-l border-slate-50"
>
<AccountContext @toggle-accounts="toggleAccountModal" />
<AccountContext @toggleAccounts="toggleAccountModal" />
<transition-group
name="menu-list"
tag="ul"
class="pt-2 list-none ml-0 mb-0"
class="pt-2 mb-0 ml-0 list-none"
>
<SecondaryNavItem
v-for="menuItem in accessibleMenuItems"
@@ -254,7 +254,7 @@ export default {
v-for="menuItem in additionalSecondaryMenuItems[menuConfig.parentNav]"
:key="menuItem.key"
:menu-item="menuItem"
@add-label="showAddLabelPopup"
@addLabel="showAddLabelPopup"
/>
</transition-group>
</div>
@@ -169,7 +169,7 @@ export default {
} else if (this.menuItem.showModalForNewItem) {
if (this.menuItem.modalName === 'AddLabel') {
e.preventDefault();
this.$emit('add-label');
this.$emit('addLabel');
}
}
},