Browse Source

chore: show announcement

Signed-off-by: Wing-Kam Wong <wingkwong.code@gmail.com>
pull/1700/head
Wing-Kam Wong 3 years ago
parent
commit
419774e6d2
  1. 21
      packages/nc-gui/components/importantAnnouncement.vue
  2. 5
      packages/nc-gui/layouts/default.vue
  3. 8
      packages/nc-gui/store/app.js

21
packages/nc-gui/components/importantAnnouncement.vue

@ -3,7 +3,7 @@
<template #activator="{on}"> <template #activator="{on}">
<transition name="announcement"> <transition name="announcement">
<v-btn <v-btn
v-if="!loading" v-show="announcementAlert"
text text
small small
class="mb-0 mr-2 py-0 " class="mb-0 mr-2 py-0 "
@ -29,14 +29,21 @@
mdi-script-text-outline mdi-script-text-outline
</v-icon> </v-icon>
<span class="caption"> <span class="caption">
API Changes in v0.90.0 v0.90.0 API Changes
</span>
</v-list-item>
<v-list-item dense href="https://github.com/nocodb/nocodb/releases/tag/0.90.0" target="_blank">
<v-icon small class="mr-2">
mdi-script-text-outline
</v-icon>
<span class="caption">
v0.90.0 Release Note
</span> </span>
</v-list-item> </v-list-item>
<v-list-item @click="announcementAlert = false"> <v-list-item @click="announcementAlert = false">
<v-icon small class="mr-2"> <v-icon small class="mr-2">
mdi-close mdi-close
</v-icon> </v-icon>
<span class="caption"> <span class="caption">
<!--Hide menu--> <!--Hide menu-->
{{ $t('general.hideMenu') }} {{ $t('general.hideMenu') }}
@ -53,6 +60,14 @@ export default {
loading: true loading: true
}), }),
computed: { computed: {
announcementAlert: {
get() {
return !this.loading && !this.$store.state.app.hiddenAnnouncement
},
set(val) {
return this.$store.commit('app/MutHiddenAnnouncement', val ? null : true)
}
},
}, },
mounted() { mounted() {
setTimeout(() => { setTimeout(() => {

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

@ -52,6 +52,7 @@
<div style="flex: 1" class="d-flex justify-end"> <div style="flex: 1" class="d-flex justify-end">
<v-toolbar-items class="hidden-sm-and-down nc-topright-menu"> <v-toolbar-items class="hidden-sm-and-down nc-topright-menu">
<important-announcement />
<release-info /> <release-info />
<language class="mr-3" /> <language class="mr-3" />
@ -282,6 +283,7 @@ 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'
import ShareOrInviteModal from '~/components/auth/shareOrInviteModal' import ShareOrInviteModal from '~/components/auth/shareOrInviteModal'
import ImportantAnnouncement from '../components/importantAnnouncement.vue'
export default { export default {
components: { components: {
@ -293,7 +295,8 @@ export default {
XBtn, XBtn,
Snackbar, Snackbar,
dlgUnexpectedError, dlgUnexpectedError,
settings settings,
ImportantAnnouncement
}, },
data: () => ({ data: () => ({
clickCount: true, clickCount: true,

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

@ -1,7 +1,8 @@
export const state = () => ({ export const state = () => ({
releaseVersion: null, releaseVersion: null,
hiddenRelease: null, hiddenRelease: null,
latestRelease: null latestRelease: null,
hiddenAnnouncement: null,
}) })
export const mutations = { export const mutations = {
@ -13,7 +14,10 @@ export const mutations = {
}, },
MutLatestRelease(state, latestRelease) { MutLatestRelease(state, latestRelease) {
state.latestRelease = latestRelease state.latestRelease = latestRelease
} },
MutHiddenAnnouncement(state, hiddenAnnouncement) {
state.hiddenAnnouncement = hiddenAnnouncement
},
} }
/** /**

Loading…
Cancel
Save