Files
Jonathan Adeline 38ccc54c2e chore: update Iconoir to 7.12.2 (#7012)
* chore(deps): update Iconoir to 7.12.2

* test: update grid visibility selector for Iconoir 7

* fix: restore open and slashed eye icons

* docs: document Iconoir 7 plugin changes
2026-12-04 15:36:56 +04:00

157 lines
5.5 KiB
Vue

<template>
<div>
<div class="toasts__container-top">
<PermissionsUpdatedToast v-if="permissionsUpdated" />
<UserSessionExpiredToast
v-if="isUserSessionExpired"
></UserSessionExpiredToast>
<UserPasswordChangedToast
v-if="isUserPasswordChanged"
></UserPasswordChangedToast>
<WorkspaceOutdatedToast v-if="workspaceOutdated && !reconnecting" />
<ConnectingToast v-if="reconnecting" />
<FailedConnectingToast v-if="failedConnecting"></FailedConnectingToast>
<AuthorizationErrorToast v-if="unauthorized"></AuthorizationErrorToast>
<InstallTemplateToast
v-for="toast in installTemplateToasts"
:key="toast.id"
:toast="toast"
></InstallTemplateToast>
<DownloadTemplateToast
v-for="toast in downloadTemplateToasts"
:key="toast.id"
:toast="toast"
></DownloadTemplateToast>
<Toast
v-for="toast in normalToasts"
:key="toast.id"
:type="toast.type"
:icon="toastIcon(toast.type)"
close-button
@close="closeToast(toast)"
>
<template #title>{{ toast.title }}</template>
<span>{{ toast.message }}</span>
</Toast>
</div>
<div class="toasts__container-bottom">
<UndoRedoToast
v-if="undoRedoIsNotHidden"
:state="undoRedoState"
></UndoRedoToast>
<CopyingToast v-if="copying"></CopyingToast>
<PastingToast v-if="pasting"></PastingToast>
<ClearingToast v-if="clearing"></ClearingToast>
<RestoreToast
v-for="toast in restoreToasts"
:key="toast.id"
:toast="toast"
></RestoreToast>
</div>
</div>
</template>
<script>
import { mapGetters, mapState } from 'vuex'
import Toast from '@baserow/modules/core/components/toasts/Toast'
import ConnectingToast from '@baserow/modules/core/components/toasts/ConnectingToast'
import FailedConnectingToast from '@baserow/modules/core/components/toasts/FailedConnectingToast'
import RestoreToast from '@baserow/modules/core/components/toasts/RestoreToast'
import CopyingToast from '@baserow/modules/core/components/toasts/CopyingToast'
import PastingToast from '@baserow/modules/core/components/toasts/PastingToast'
import ClearingToast from '@baserow/modules/core/components/toasts/ClearingToast'
import AuthorizationErrorToast from '@baserow/modules/core/components/toasts/AuthorizationErrorToast'
import UserSessionExpiredToast from '@baserow/modules/core/components/toasts/UserSessionExpiredToast'
import UserPasswordChangedToast from '@baserow/modules/core/components/toasts/UserPasswordChangedToast'
import UndoRedoToast from '@baserow/modules/core/components/toasts/UndoRedoToast'
import { UNDO_REDO_STATES } from '@baserow/modules/core/utils/undoRedoConstants'
import PermissionsUpdatedToast from '@baserow/modules/core/components/toasts/PermissionsUpdatedToast'
import WorkspaceOutdatedToast from '@baserow/modules/core/components/toasts/WorkspaceOutdatedToast'
import InstallTemplateToast from '@baserow/modules/core/components/toasts/InstallTemplateToast'
import DownloadTemplateToast from '@baserow/modules/core/components/toasts/DownloadTemplateToast'
export default {
name: 'Toasts',
components: {
PermissionsUpdatedToast,
WorkspaceOutdatedToast,
InstallTemplateToast,
DownloadTemplateToast,
RestoreToast,
Toast,
ConnectingToast,
FailedConnectingToast,
CopyingToast,
PastingToast,
ClearingToast,
AuthorizationErrorToast,
UndoRedoToast,
UserSessionExpiredToast,
UserPasswordChangedToast,
},
computed: {
undoRedoIsNotHidden() {
return this.undoRedoState !== UNDO_REDO_STATES.HIDDEN
},
restoreToasts() {
return this.toasts.filter((n) => n.type === 'restore')
},
installTemplateToasts() {
return this.toasts.filter((n) => n.type === 'installTemplate')
},
downloadTemplateToasts() {
return this.toasts.filter((n) => n.type === 'downloadTemplate')
},
normalToasts() {
return this.toasts.filter(
(n) =>
!['restore', 'installTemplate', 'downloadTemplate'].includes(n.type)
)
},
...mapState({
unauthorized: (state) => state.toast.authorizationError,
failedConnecting: (state) => state.toast.failedConnecting,
reconnecting: (state) => state.toast.reconnecting,
copying: (state) => state.toast.copying,
pasting: (state) => state.toast.pasting,
clearing: (state) => state.toast.clearing,
toasts: (state) => state.toast.items,
undoRedoState: (state) => state.toast.undoRedoState,
isUserSessionExpired: (state) => state.toast.userSessionExpired,
isUserPasswordChanged: (state) => state.toast.userPasswordChanged,
permissionsUpdated: (state) => state.toast.permissionsUpdated,
workspaceOutdated: (state) => state.toast.workspaceOutdated,
}),
...mapGetters({ isAuthenticated: 'auth/isAuthenticated' }),
},
watch: {
isAuthenticated(value) {
if (!value) {
this.$store.dispatch('toast/userLoggedOut')
}
},
},
methods: {
toastIcon(toastType) {
switch (toastType) {
case 'warning':
return 'iconoir-warning-circle'
case 'success':
return 'iconoir-check-circle'
case 'info-primary':
return 'iconoir-info-circle'
case 'error':
return 'iconoir-warning-triangle'
default:
return 'iconoir-info-circle'
}
},
closeToast(toast) {
this.$store.dispatch('toast/remove', toast)
},
},
}
</script>