Browse Source

Merge pull request #6400 from nocodb/fix/misc-ui

Miscellaneous UI fixes
pull/6415/head
Raju Udava 1 year ago committed by GitHub
parent
commit
9ed4cca086
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/nc-gui/layouts/shared-view.vue
  2. 11
      packages/nc-gui/pages/index.vue
  3. 2
      packages/nc-gui/pages/index/[typeOrId].vue
  4. 2
      packages/nc-gui/pages/index/[typeOrId]/form/[viewId]/index.vue
  5. 1
      packages/noco-docs/docusaurus.config.js
  6. 23
      packages/noco-docs/package-lock.json
  7. 1
      packages/noco-docs/package.json
  8. 16
      packages/noco-docs/src/modules/tele.js

2
packages/nc-gui/layouts/shared-view.vue

@ -79,7 +79,7 @@ export default {
<div class="flex-1" />
</a-layout-header>
<div class="w-full overflow-hidden" style="height: calc(100vh)">
<div class="w-full overflow-hidden" style="height: calc(100vh - var(--topbar-height))">
<slot />
</div>
</a-layout>

11
packages/nc-gui/pages/index.vue

@ -40,6 +40,12 @@ const isSharedView = computed(() => {
return !routeName.startsWith('index-typeOrId-projectId-') && !['index', 'index-typeOrId'].includes(routeName)
})
const isSharedFormView = computed(() => {
const routeName = (route.value.name as string) || ''
// check route is shared form view route
return routeName.startsWith('index-typeOrId-form-viewId')
})
async function handleRouteTypeIdChange() {
// avoid loading projects for shared views
if (isSharedView.value) {
@ -91,7 +97,10 @@ provide(ToggleDialogInj, toggleDialog)
<template>
<div>
<NuxtLayout v-if="isSharedView" name="shared-view">
<NuxtLayout v-if="isSharedFormView">
<NuxtPage />
</NuxtLayout>
<NuxtLayout v-else-if="isSharedView" name="shared-view">
<NuxtPage />
</NuxtLayout>
<NuxtLayout v-else name="dashboard">

2
packages/nc-gui/pages/index/[typeOrId].vue

@ -5,7 +5,7 @@ const route = router.currentRoute
</script>
<template>
<div>
<div class="h-full">
<NuxtPage :transition="false" :page-key="route.params.typeOrId" />
</div>
</template>

2
packages/nc-gui/pages/index/[typeOrId]/form/[viewId]/index.vue

@ -38,7 +38,7 @@ router.afterEach((to) => shouldRedirect(to.name as string))
<template>
<div
class="scrollbar-thin-dull overflow-y-auto overflow-x-hidden flex flex-col color-transition nc-form-view relative bg-primary bg-opacity-10 dark:(bg-slate-900) h-[100vh] min-h-[600px]"
class="scrollbar-thin-dull overflow-y-auto overflow-x-hidden flex flex-col color-transition nc-form-view relative bg-primary bg-opacity-10 dark:(bg-slate-900) h-[100vh] min-h-[600px] py-4"
>
<NuxtPage />

1
packages/noco-docs/docusaurus.config.js

@ -121,6 +121,7 @@ const config = {
darkTheme: darkCodeTheme,
},
}),
clientModules: [require.resolve('./src/modules/tele.js')],
};
module.exports = config;

23
packages/noco-docs/package-lock.json generated

@ -14,6 +14,7 @@
"@mdx-js/react": "^1.6.22",
"clsx": "^1.2.1",
"docusaurus-plugin-sass": "^0.2.5",
"nc-analytics": "^0.0.3",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",
@ -28,6 +29,18 @@
"node": ">=16.14"
}
},
"../../../nc-tele": {
"name": "xc-test123",
"version": "2.0.1",
"extraneous": true,
"license": "ISC",
"devDependencies": {
"@types/lodash.debounce": "^4.0.7",
"esbuild": "^0.19.3",
"lodash.debounce": "^4.0.8",
"uuid": "^9.0.1"
}
},
"node_modules/@algolia/autocomplete-core": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/@algolia/autocomplete-core/-/autocomplete-core-1.9.3.tgz",
@ -8219,6 +8232,11 @@
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
}
},
"node_modules/nc-analytics": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/nc-analytics/-/nc-analytics-0.0.3.tgz",
"integrity": "sha512-enZVnSr4RvvalD9dmF+Af6+v5YEW+bCIDmP2cxyZ0Ppyj1BKfzQUngoZ75a3Imr6c+O0u3tWKcPB9Y5lEZIkQA=="
},
"node_modules/negotiator": {
"version": "0.6.3",
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
@ -18723,6 +18741,11 @@
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz",
"integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA=="
},
"nc-analytics": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/nc-analytics/-/nc-analytics-0.0.3.tgz",
"integrity": "sha512-enZVnSr4RvvalD9dmF+Af6+v5YEW+bCIDmP2cxyZ0Ppyj1BKfzQUngoZ75a3Imr6c+O0u3tWKcPB9Y5lEZIkQA=="
},
"negotiator": {
"version": "0.6.3",
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",

1
packages/noco-docs/package.json

@ -33,6 +33,7 @@
"@mdx-js/react": "^1.6.22",
"clsx": "^1.2.1",
"docusaurus-plugin-sass": "^0.2.5",
"nc-analytics": "^0.0.3",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",

16
packages/noco-docs/src/modules/tele.js

@ -0,0 +1,16 @@
import { init, push } from 'nc-analytics';
init();
export function onRouteDidUpdate({ location, previousLocation }) {
// Don't execute if we are still on the same page; the lifecycle may be fired
// because the hash changes (e.g. when navigating between headings)
if (location.pathname !== previousLocation?.pathname || location.hash !== previousLocation?.hash) {
push({
event: '$pageview',
$current_url: location.pathname,
hash: location.hash,
});
}
}
Loading…
Cancel
Save