From b711b0920ee82a18ebb45b09752b3a6b3d9e7500 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Fri, 23 Sep 2022 12:45:18 +0530 Subject: [PATCH] chore(nc-gui): env var for info-msg duration Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- package.json | 2 +- packages/nc-gui/nuxt.config.ts | 1 + packages/nc-gui/plugins/ant.ts | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 78c6af53b5..f47e2eb0f9 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "start:xcdb-api:cache-v1-backup": "npm run build:common ; cd ./packages/nocodb; npm install ../nocodb-sdk; npm install; NC_DISABLE_TELE=true NC_INFLECTION=camelize DATABASE_URL=sqlite:../../../scripts/cypress/fixtures/sqlite-sakila/sakila.db npm run watch:run:cypress", "start:xcdb-api:cache": "npm run build:common ; cd ./packages/nocodb; npm install ../nocodb-sdk; npm install; NC_EXPORT_MAX_TIMEOUT=60000 NC_DISABLE_TELE=true NC_INFLECTION=camelize DATABASE_URL=sqlite:../../../scripts/cypress/fixtures/sqlite-sakila/sakila.db npm run watch:run:cypress", "start:web-v1-backup": "npm run build:common ; cd ./packages/nc-gui; npm install ../nocodb-sdk; npm install; npm run dev", - "start:web": "npm run build:common ; cd ./packages/nc-gui; npm install ../nocodb-sdk; npm install; npm run dev", + "start:web": "npm run build:common ; cd ./packages/nc-gui; npm install ../nocodb-sdk; npm install; ANT_MESSAGE_DURATION=0.2 npm run dev", "cypress-v1-backup:run": "cypress run --config-file ./scripts/cypress/cypress.json", "cypress-v1-backup:open": "cypress open --config-file ./scripts/cypress/cypress.json", "cypress:run": "cypress run --config-file ./scripts/cypress/cypress.json", diff --git a/packages/nc-gui/nuxt.config.ts b/packages/nc-gui/nuxt.config.ts index 2efa5691bc..9e9fee7ee6 100644 --- a/packages/nc-gui/nuxt.config.ts +++ b/packages/nc-gui/nuxt.config.ts @@ -84,6 +84,7 @@ export default defineNuxtConfig({ define: { 'process.env.DEBUG': 'false', 'process.nextTick': () => {}, + 'process.env.ANT_MESSAGE_DURATION': process.env.ANT_MESSAGE_DURATION, }, server: { watch: { diff --git a/packages/nc-gui/plugins/ant.ts b/packages/nc-gui/plugins/ant.ts index 3d030a6442..9c8a4e4e05 100644 --- a/packages/nc-gui/plugins/ant.ts +++ b/packages/nc-gui/plugins/ant.ts @@ -1,7 +1,10 @@ -import { Menu as AntMenu, Modal as AntModal } from 'ant-design-vue' +import { Menu as AntMenu, Modal as AntModal, message } from 'ant-design-vue' import { defineNuxtPlugin } from '#imports' export default defineNuxtPlugin((nuxtApp) => { nuxtApp.vueApp.component(AntMenu.name, AntMenu) nuxtApp.vueApp.component(AntModal.name, AntModal) + message.config({ + duration: +(process.env.ANT_MESSAGE_DURATION ?? 3), + }) })