Browse Source

Merge pull request #9780 from nocodb/nc-feat/extension-bulk-update

Nc Feat: bulk update extension
pull/9802/head
Ramesh Mane 2 weeks ago committed by GitHub
parent
commit
b948bfa11b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      packages/nc-gui/assets/nc-icons/cell-longtext.svg
  2. 14
      packages/nc-gui/components/extensions/Extension.vue
  3. 4
      packages/nc-gui/components/extensions/Market.vue
  4. 4
      packages/nc-gui/components/smartsheet/column/EditOrAdd.vue
  5. 12
      packages/nc-gui/composables/useExtensions.ts
  6. 2
      packages/nc-gui/composables/useSharedView.ts
  7. 8
      packages/nc-gui/extensions/json-exporter/index.vue

2
packages/nc-gui/assets/nc-icons/cell-longtext.svg

@ -3,6 +3,6 @@
<path d="M21 6H11" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M21 6H11" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M21 14H3" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M21 14H3" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M17 18H3" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M17 18H3" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M3 10L5.41056 5.17889C5.44741 5.10518 5.55259 5.10518 5.58944 5.17889L8 10" stroke="#1F293A" stroke-width="2" stroke-linecap="round"/> <path d="M3 10L5.41056 5.17889C5.44741 5.10518 5.55259 5.10518 5.58944 5.17889L8 10" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
<path d="M4 9H7" stroke="currentColor" stroke-width="2" stroke-linecap="round"/> <path d="M4 9H7" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 757 B

After

Width:  |  Height:  |  Size: 762 B

14
packages/nc-gui/components/extensions/Extension.vue

@ -6,7 +6,7 @@ interface Prop {
const { extensionId, error } = defineProps<Prop>() const { extensionId, error } = defineProps<Prop>()
const { extensionList, extensionsLoaded, availableExtensions, eventBus } = useExtensions() const { extensionList, extensionsLoaded, availableExtensions } = useExtensions()
const isLoadedExtension = ref<boolean>(true) const isLoadedExtension = ref<boolean>(true)
@ -67,10 +67,14 @@ onMounted(() => {
return return
} }
import(`../../extensions/${extensionManifest.value.entry}/index.vue`).then((mod) => { import(`../../extensions/${extensionManifest.value.entry}/index.vue`)
component.value = markRaw(mod.default) .then((mod) => {
isLoadedExtension.value = false component.value = markRaw(mod.default)
}) isLoadedExtension.value = false
})
.catch((e) => {
throw new Error(e)
})
}) })
.catch((err) => { .catch((err) => {
if (!extensionManifest.value) { if (!extensionManifest.value) {

4
packages/nc-gui/components/extensions/Market.vue

@ -1,6 +1,4 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { VNodeRef } from '@vue/runtime-core'
interface Prop { interface Prop {
modelValue?: boolean modelValue?: boolean
} }
@ -73,7 +71,7 @@ const handleSetActiveTab = (tab: TabItem) => {
handleShowSearchInput() handleShowSearchInput()
} }
onClickOutside(searchWrapperRef, (e) => { onClickOutside(searchWrapperRef, () => {
if (searchQuery.value) { if (searchQuery.value) {
return return
} }

4
packages/nc-gui/components/smartsheet/column/EditOrAdd.vue

@ -53,6 +53,8 @@ const { t } = useI18n()
const { isMetaReadOnly } = useRoles() const { isMetaReadOnly } = useRoles()
const { eventBus } = useSmartsheetStoreOrThrow()
const columnLabel = computed(() => props.columnLabel || t('objects.field')) const columnLabel = computed(() => props.columnLabel || t('objects.field'))
const { $e } = useNuxtApp() const { $e } = useNuxtApp()
@ -179,6 +181,8 @@ const onSelectType = (uidt: UITypes) => {
const reloadMetaAndData = async () => { const reloadMetaAndData = async () => {
await getMeta(meta.value?.id as string, true) await getMeta(meta.value?.id as string, true)
eventBus.emit(SmartsheetStoreEvents.FIELD_RELOAD)
if (!isKanban.value) { if (!isKanban.value) {
reloadDataTrigger?.trigger() reloadDataTrigger?.trigger()
} }

12
packages/nc-gui/composables/useExtensions.ts

@ -68,6 +68,10 @@ export const useExtensions = createSharedComposable(() => {
const availableExtensions = ref<ExtensionManifest[]>([]) const availableExtensions = ref<ExtensionManifest[]>([])
const availableExtensionIds = computed(() => {
return availableExtensions.value.map((e) => e.id)
})
// Object to store description content for each extension // Object to store description content for each extension
const descriptionContent = ref<Record<string, string>>({}) const descriptionContent = ref<Record<string, string>>({})
@ -85,11 +89,11 @@ export const useExtensions = createSharedComposable(() => {
}) })
const extensionList = computed<ExtensionType[]>(() => { const extensionList = computed<ExtensionType[]>(() => {
return (activeBaseExtensions.value ? activeBaseExtensions.value.extensions : []).sort( return (activeBaseExtensions.value ? activeBaseExtensions.value.extensions : [])
(a: ExtensionType, b: ExtensionType) => { .filter((e: ExtensionType) => availableExtensionIds.value.includes(e.extensionId))
.sort((a: ExtensionType, b: ExtensionType) => {
return (a?.order ?? Infinity) - (b?.order ?? Infinity) return (a?.order ?? Infinity) - (b?.order ?? Infinity)
}, })
)
}) })
const toggleExtensionPanel = () => { const toggleExtensionPanel = () => {

2
packages/nc-gui/composables/useSharedView.ts

@ -340,7 +340,7 @@ export function useSharedView() {
) )
} }
const fetchCount = async (param: { filtersArr: FilterType[], where?: string }) => { const fetchCount = async (param: { filtersArr: FilterType[]; where?: string }) => {
const data = await $api.public.dbViewRowCount( const data = await $api.public.dbViewRowCount(
sharedView.value.uuid!, sharedView.value.uuid!,
{ {

8
packages/nc-gui/extensions/json-exporter/index.vue

@ -101,4 +101,10 @@ onMounted(() => {
</ExtensionsExtensionWrapper> </ExtensionsExtensionWrapper>
</template> </template>
<style lang="scss"></style> <style lang="scss">
.nc-nc-json-exporter .extension-content {
&:not(.fullscreen) {
@apply p-3;
}
}
</style>

Loading…
Cancel
Save