Browse Source

refactor: remove snackbar component from main layout

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/2071/head
Pranav C 3 years ago
parent
commit
37c7d4ccbe
  1. 3
      packages/nc-gui/layouts/default.vue
  2. 22
      packages/nc-gui/store/settings.js
  3. 8
      packages/nc-gui/store/tabs.js

3
packages/nc-gui/layouts/default.vue

@ -1,6 +1,5 @@
<template> <template>
<v-app v-if="isProjectInfoLoaded"> <v-app v-if="isProjectInfoLoaded">
<snackbar />
<v-app-bar <v-app-bar
class="elevation-0" class="elevation-0"
color="primary" color="primary"
@ -338,7 +337,6 @@ import XBtn from '../components/global/XBtn'
import dlgUnexpectedError from '../components/utils/DlgUnexpectedError' import dlgUnexpectedError from '../components/utils/DlgUnexpectedError'
import settings from '../components/Settings' import settings from '../components/Settings'
import { copyTextToClipboard } from '@/helpers/xutils' import { copyTextToClipboard } from '@/helpers/xutils'
import Snackbar from '~/components/Snackbar'
import Language from '~/components/utils/Language' import Language from '~/components/utils/Language'
import Loader from '~/components/Loader' import Loader from '~/components/Loader'
import PreviewAs from '~/components/PreviewAs' import PreviewAs from '~/components/PreviewAs'
@ -353,7 +351,6 @@ export default {
ReleaseInfo, ReleaseInfo,
Language, Language,
XBtn, XBtn,
Snackbar,
dlgUnexpectedError, dlgUnexpectedError,
settings, settings,
ImportantAnnouncement ImportantAnnouncement

22
packages/nc-gui/store/settings.js

@ -209,17 +209,17 @@ export const actions = {
commit('MutToggleDarkMode', status) commit('MutToggleDarkMode', status)
}, },
ActCheckMaxTable({ state, commit, rootState }, { tableIndex }) { ActCheckMaxTable({ state, commit, rootState }, { tableIndex }) {
const prepareToastMessage = () => { // const prepareToastMessage = () => {
return `You are allowed to access only ${rootState.users.ui_ability.rules.maxTables} tables.<br/> // return `You are allowed to access only ${rootState.users.ui_ability.rules.maxTables} tables.<br/>
You can either upgrade or <a href="#/referral" style="color: white;font-weight: bold;">refer</a> us. ` // You can either upgrade or <a href="#/referral" style="color: white;font-weight: bold;">refer</a> us. `
} // }
//
if (process.env.ui_ability) { // if (process.env.ui_ability) {
if (tableIndex > rootState.users.ui_ability.rules.maxTables) { // if (tableIndex > rootState.users.ui_ability.rules.maxTables) {
this.commit('snackbar/setSnack', prepareToastMessage()) // this.commit('snackbar/setSnack', prepareToastMessage())
return false // return false
} // }
} // }
return true return true
}, },
ActSetTheme({ state, commit, rootState }, { theme, themeName, custom }) { ActSetTheme({ state, commit, rootState }, { theme, themeName, custom }) {

8
packages/nc-gui/store/tabs.js

@ -377,10 +377,10 @@ export const actions = {
}, },
async ActAddTab({ commit, state, rootState }, item) { async ActAddTab({ commit, state, rootState }, item) {
if (rootState.users.ui_ability.rules.maxTabs <= state.list.length) { // if (rootState.users.ui_ability.rules.maxTabs <= state.list.length) {
this.commit('snackbar/setSnack', `Free plan limits to ${rootState.users.ui_ability.rules.maxTabs} tabs. Please <a href="https://nocodb.com/pricing" style="color: white;font-weight: bold;">upgrade</a> your plan for unlimited tabs.`) // this.commit('snackbar/setSnack', `Free plan limits to ${rootState.users.ui_ability.rules.maxTabs} tabs. Please <a href="https://nocodb.com/pricing" style="color: white;font-weight: bold;">upgrade</a> your plan for unlimited tabs.`)
return // return
} // }
commit('add', item) commit('add', item)
await Vue.nextTick() await Vue.nextTick()
const index = state.list.length - 1 const index = state.list.length - 1

Loading…
Cancel
Save