diff --git a/.github/workflows/release-docker.yml b/.github/workflows/release-docker.yml index fe4e692238..3ad56e29f9 100644 --- a/.github/workflows/release-docker.yml +++ b/.github/workflows/release-docker.yml @@ -60,10 +60,10 @@ jobs: DOCKER_REPOSITORY=${DOCKER_REPOSITORY}-timely fi fi - echo "::set-output name=DOCKER_REPOSITORY::${DOCKER_REPOSITORY}" - echo "::set-output name=DOCKER_BUILD_TAG::${DOCKER_BUILD_TAG}" - echo ${DOCKER_REPOSITORY} - echo ${DOCKER_BUILD_TAG} + echo "DOCKER_REPOSITORY=${DOCKER_REPOSITORY}" >> $GITHUB_OUTPUT + echo "DOCKER_BUILD_TAG=${DOCKER_BUILD_TAG}" >> $GITHUB_OUTPUT + echo DOCKER_REPOSITORY: ${DOCKER_REPOSITORY} + echo DOCKER_BUILD_TAG: ${DOCKER_BUILD_TAG} - name: Checkout uses: actions/checkout@v3 diff --git a/.github/workflows/release-draft.yml b/.github/workflows/release-draft.yml index 0d8f5eaae3..1fe4fb3d09 100644 --- a/.github/workflows/release-draft.yml +++ b/.github/workflows/release-draft.yml @@ -53,7 +53,7 @@ jobs: if [[ ${{ github.event.inputs.tagHeadSHA || inputs.tagHeadSHA }} == "Y" ]]; then TARGET_SHA=$(git rev-list -n 1 HEAD | tail -1) fi - echo "::set-output name=TARGET_SHA::${TARGET_SHA}" + echo "TARGET_SHA=${TARGET_SHA}" >> $GITHUB_OUTPUT echo "Setting TARGET_SHA: ${TARGET_SHA}" - name: Create tag uses: actions/github-script@v3 @@ -66,7 +66,7 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, ref: "refs/tags/${{ github.event.inputs.tag || inputs.tag }}", - sha: "${{steps.get-sha.outputs.TARGET_SHA}}" + sha: "${{ steps.get-sha.outputs.TARGET_SHA }}" }) - uses: actions/setup-node@v3 with: diff --git a/.github/workflows/release-executables.yml b/.github/workflows/release-executables.yml index 1defd80b19..f5b3bf90bb 100644 --- a/.github/workflows/release-executables.yml +++ b/.github/workflows/release-executables.yml @@ -194,7 +194,7 @@ jobs: cp ./mac-dist/Noco-macos-x64 ./mac-dist/nocodb tar -czf ./mac-dist/nocodb.tar.gz ./mac-dist/nocodb rm ./mac-dist/nocodb - echo "::set-output name=CHECKSUM::$(shasum -a 256 ./mac-dist/nocodb.tar.gz | awk '{print $1}')" + echo "CHECKSUM=$(shasum -a 256 ./mac-dist/nocodb.tar.gz | awk '{print $1}')" >> $GITHUB_OUTPUT id: compress diff --git a/.github/workflows/release-nightly-dev.yml b/.github/workflows/release-nightly-dev.yml index 79b651cf8d..55a711c3f2 100644 --- a/.github/workflows/release-nightly-dev.yml +++ b/.github/workflows/release-nightly-dev.yml @@ -26,9 +26,9 @@ jobs: if [[ ${{ github.event_name }} == 'workflow_dispatch' ]]; then IS_DAILY='N' fi - echo "::set-output name=NIGHTLY_BUILD_TAG::${TAG_NAME}" - echo "::set-output name=IS_DAILY::${IS_DAILY}" - echo "::set-output name=CURRENT_VERSION::${CURRENT_VERSION}" + echo "NIGHTLY_BUILD_TAG=${TAG_NAME}" >> $GITHUB_OUTPUT + echo "IS_DAILY=${IS_DAILY}" >> $GITHUB_OUTPUT + echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_OUTPUT - name: verify-tag run: | echo ${{ steps.tag-step.outputs.NIGHTLY_BUILD_TAG }} diff --git a/.github/workflows/release-nocodb.yml b/.github/workflows/release-nocodb.yml index 767841f613..3ef265b424 100644 --- a/.github/workflows/release-nocodb.yml +++ b/.github/workflows/release-nocodb.yml @@ -45,13 +45,12 @@ jobs: TARGET_TAG=$(echo ${PREV_TAG} | awk -F. -v OFS=. '{$NF += 1 ; print}') fi - echo target version: ${TARGET_TAG} - echo previous version: ${PREV_TAG} - echo "::set-output name=target_tag::${TARGET_TAG}" - echo "::set-output name=prev_tag::${PREV_TAG}" + echo "TARGET_TAG=${TARGET_TAG}" >> $GITHUB_OUTPUT + echo "PREV_TAG=${PREV_TAG}" >> $GITHUB_OUTPUT - name: Verify run : | - echo ${{ steps.process-input.outputs.target_tag }} + echo TARGET_TAG: ${{ steps.process-input.outputs.target_tag }} + echo PREV_TAG: ${{ steps.process-input.outputs.prev_tag }} # Merge develop to master pr-to-master: diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index f0e77db917..e3103f346b 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -35,8 +35,8 @@ jobs: CURRENT_VERSION=$(basename $(curl -fs -o/dev/null -w %{redirect_url} https://github.com/nocodb/nocodb/releases/latest)) # Construct tag name TAG_NAME=pr-${PR_NUMBER}-${CURRENT_DATE}-${CURRENT_TIME} - echo "::set-output name=TARGET_TAG::${TAG_NAME}" - echo "::set-output name=CURRENT_VERSION::${CURRENT_VERSION}" + echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_OUTPUT + echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_OUTPUT - name: verify-tag run: | echo ${{ steps.tag-step.outputs.TARGET_TAG }} diff --git a/packages/nc-gui/.eslintrc.js b/packages/nc-gui/.eslintrc.js index 8780df770e..084e429adc 100644 --- a/packages/nc-gui/.eslintrc.js +++ b/packages/nc-gui/.eslintrc.js @@ -3,6 +3,7 @@ const baseRules = { 'no-console': 0, 'antfu/if-newline': 0, 'no-unused-vars': 0, + '@typescript-eslint/no-this-alias': 0, '@typescript-eslint/no-unused-vars': [ 'error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' }, diff --git a/packages/nc-gui/components/cell/Checkbox.vue b/packages/nc-gui/components/cell/Checkbox.vue index 28c4618429..04c5d73521 100644 --- a/packages/nc-gui/components/cell/Checkbox.vue +++ b/packages/nc-gui/components/cell/Checkbox.vue @@ -38,7 +38,7 @@ const checkboxMeta = $computed(() => { }) function onClick() { - if (!readOnly) { + if (!readOnly?.value) { vModel = !vModel } } diff --git a/packages/nc-gui/components/cell/DatePicker.vue b/packages/nc-gui/components/cell/DatePicker.vue index 644dab08c0..9fae66cc85 100644 --- a/packages/nc-gui/components/cell/DatePicker.vue +++ b/packages/nc-gui/components/cell/DatePicker.vue @@ -12,11 +12,11 @@ const emit = defineEmits(['update:modelValue']) const columnMeta = inject(ColumnInj, null)! -const readOnly = inject(ReadonlyInj, false) +const readOnly = inject(ReadonlyInj, ref(false)) let isDateInvalid = $ref(false) -const dateFormat = columnMeta?.value?.meta?.date_format ?? 'YYYY-MM-DD' +const dateFormat = $computed(() => columnMeta?.value?.meta?.date_format ?? 'YYYY-MM-DD') const localState = $computed({ get() { diff --git a/packages/nc-gui/components/cell/DateTimePicker.vue b/packages/nc-gui/components/cell/DateTimePicker.vue index fb192cfc8c..d444494c8c 100644 --- a/packages/nc-gui/components/cell/DateTimePicker.vue +++ b/packages/nc-gui/components/cell/DateTimePicker.vue @@ -12,7 +12,7 @@ const emit = defineEmits(['update:modelValue']) const { isMysql } = useProject() -const readOnly = inject(ReadonlyInj, false) +const readOnly = inject(ReadonlyInj, ref(false)) let isDateInvalid = $ref(false) diff --git a/packages/nc-gui/components/cell/Text.vue b/packages/nc-gui/components/cell/Text.vue index 832ddb7ff4..53e7aa02b1 100644 --- a/packages/nc-gui/components/cell/Text.vue +++ b/packages/nc-gui/components/cell/Text.vue @@ -1,6 +1,6 @@ - + diff --git a/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue b/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue index fd0878f974..3fd4cf1ee8 100644 --- a/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue +++ b/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue @@ -43,7 +43,7 @@ const shared = ref({ id: '', meta: {}, password: undefined }) const transitionDuration = computed({ get: () => shared.value.meta.transitionDuration || 250, set: (duration) => { - shared.value.meta = { ...shared.value.meta, transitionDuration: duration } + shared.value.meta = { ...shared.value.meta, transitionDuration: duration > 5000 ? 5000 : duration } }, }) diff --git a/packages/nc-gui/components/smartsheet/toolbar/ViewActions.vue b/packages/nc-gui/components/smartsheet/toolbar/ViewActions.vue index c926a5c3d7..daa2c857f3 100644 --- a/packages/nc-gui/components/smartsheet/toolbar/ViewActions.vue +++ b/packages/nc-gui/components/smartsheet/toolbar/ViewActions.vue @@ -228,7 +228,7 @@ const { isSqlView } = useSmartsheetStoreOrThrow() - + diff --git a/packages/nc-gui/components/tabs/Smartsheet.vue b/packages/nc-gui/components/tabs/Smartsheet.vue index db6aad701d..392fa50c43 100644 --- a/packages/nc-gui/components/tabs/Smartsheet.vue +++ b/packages/nc-gui/components/tabs/Smartsheet.vue @@ -7,6 +7,7 @@ import { IsLockedInj, MetaInj, OpenNewRecordFormHookInj, + ReadonlyInj, ReloadViewDataHookInj, ReloadViewMetaHookInj, TabMetaInj, @@ -18,6 +19,7 @@ import { useMetas, useProvideKanbanViewStore, useProvideSmartsheetStore, + useUIPermission, } from '#imports' import type { TabItem } from '~/lib' @@ -25,6 +27,8 @@ const props = defineProps<{ activeTab: TabItem }>() +const { isUIAllowed } = useUIPermission() + const { metas } = useMetas() const activeTab = toRef(props, 'activeTab') @@ -55,6 +59,10 @@ provide(OpenNewRecordFormHookInj, openNewRecordFormHook) provide(FieldsInj, fields) provide(IsFormInj, isForm) provide(TabMetaInj, activeTab) +provide( + ReadonlyInj, + computed(() => !isUIAllowed('xcDatatableEditable')), +) - +
@@ -833,7 +866,7 @@ function isSelectDisabled(uidt: string, disableSelect = false) { Add Other Column - +
diff --git a/packages/nc-gui/components/virtual-cell/BelongsTo.vue b/packages/nc-gui/components/virtual-cell/BelongsTo.vue index e7f14fd3d4..8a2eaed14f 100644 --- a/packages/nc-gui/components/virtual-cell/BelongsTo.vue +++ b/packages/nc-gui/components/virtual-cell/BelongsTo.vue @@ -31,7 +31,7 @@ const row = inject(RowInj)! const active = inject(ActiveCellInj)! -const readOnly = inject(ReadonlyInj, false) +const readOnly = inject(ReadonlyInj, ref(false)) const isForm = inject(IsFormInj, ref(false)) diff --git a/packages/nc-gui/components/virtual-cell/Formula.vue b/packages/nc-gui/components/virtual-cell/Formula.vue index e6192c2ec3..f91a8a8cab 100644 --- a/packages/nc-gui/components/virtual-cell/Formula.vue +++ b/packages/nc-gui/components/virtual-cell/Formula.vue @@ -6,7 +6,7 @@ import { CellValueInj, ColumnInj, computed, handleTZ, inject, ref, replaceUrlsWi // todo: column type doesn't have required property `error` - throws in typecheck const column = inject(ColumnInj) as Ref -const value = inject(CellValueInj) +const cellValue = inject(CellValueInj) const { isPg } = useProject() @@ -20,7 +20,7 @@ const showEditFormulaWarningMessage = () => { }, 3000) } -const result = computed(() => (isPg.value ? handleTZ(value) : value)) +const result = computed(() => (isPg.value ? handleTZ(cellValue?.value) : cellValue?.value)) const urls = computed(() => replaceUrlsWithLink(result.value)) diff --git a/packages/nc-gui/components/virtual-cell/HasMany.vue b/packages/nc-gui/components/virtual-cell/HasMany.vue index c4f063ea03..82d7cbbb06 100644 --- a/packages/nc-gui/components/virtual-cell/HasMany.vue +++ b/packages/nc-gui/components/virtual-cell/HasMany.vue @@ -27,7 +27,7 @@ const reloadRowTrigger = inject(ReloadRowDataHookInj, createEventHook()) const isForm = inject(IsFormInj) -const readOnly = inject(ReadonlyInj, false) +const readOnly = inject(ReadonlyInj, ref(false)) const isLocked = inject(IsLockedInj) diff --git a/packages/nc-gui/components/virtual-cell/Lookup.vue b/packages/nc-gui/components/virtual-cell/Lookup.vue index 5f2530d9f2..789ff99187 100644 --- a/packages/nc-gui/components/virtual-cell/Lookup.vue +++ b/packages/nc-gui/components/virtual-cell/Lookup.vue @@ -17,7 +17,7 @@ import { const { metas, getMeta } = useMetas() -provide(ReadonlyInj, true) +provide(ReadonlyInj, ref(true)) const column = inject(ColumnInj)! as Ref diff --git a/packages/nc-gui/components/virtual-cell/ManyToMany.vue b/packages/nc-gui/components/virtual-cell/ManyToMany.vue index 30fdbe9f7f..3464471789 100644 --- a/packages/nc-gui/components/virtual-cell/ManyToMany.vue +++ b/packages/nc-gui/components/virtual-cell/ManyToMany.vue @@ -28,7 +28,7 @@ const reloadRowTrigger = inject(ReloadRowDataHookInj, createEventHook()) const isForm = inject(IsFormInj) -const readOnly = inject(ReadonlyInj, false) +const readOnly = inject(ReadonlyInj, ref(false)) const isLocked = inject(IsLockedInj) diff --git a/packages/nc-gui/components/virtual-cell/components/ItemChip.vue b/packages/nc-gui/components/virtual-cell/components/ItemChip.vue index fe11b08950..6665dd9187 100644 --- a/packages/nc-gui/components/virtual-cell/components/ItemChip.vue +++ b/packages/nc-gui/components/virtual-cell/components/ItemChip.vue @@ -1,5 +1,15 @@