Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix(nc-gui): review changes

Ramesh Mane373126280baf
diff --git a/packages/nc-gui/components/auth/onboarding/Layout/index.vue b/packages/nc-gui/components/auth/onboarding/Layout/index.vue
index 09f96ac8f1..e40dc42682 100644
--- a/packages/nc-gui/components/auth/onboarding/Layout/index.vue
+++ b/packages/nc-gui/components/auth/onboarding/Layout/index.vue
@@ -45,25 +45,22 @@ let timer: any
* To avoid accidental skip of onboarding flow while pressing back button continuously,
* disable skip button for 2 second
*/
-watch(
- () => stepIndex.value,
- (newIndex, oldIndex, cleanup) => {
- if (newIndex !== 0 || oldIndex === undefined) {
- isDisabledSkipButton.value = false
- return
- }
+watch(stepIndex, (newIndex, oldIndex, cleanup) => {
+ if (newIndex !== 0 || oldIndex === undefined) {
+ isDisabledSkipButton.value = false
+ return
+ }
- isDisabledSkipButton.value = true
+ isDisabledSkipButton.value = true
- timer = setTimeout(() => {
- isDisabledSkipButton.value = false
- }, 2000)
+ timer = setTimeout(() => {
+ isDisabledSkipButton.value = false
+ }, 2000)
- cleanup(() => {
- clearTimeout(timer)
- })
- },
-)
+ cleanup(() => {
+ clearTimeout(timer)
+ })
+})
</script>
<template>
@@ -161,5 +158,3 @@ watch(
</div>
</div>
</template>
-
-<style lang="scss" scoped></style>
diff --git a/packages/nc-gui/components/auth/onboarding/Question/Option/Icon.vue b/packages/nc-gui/components/auth/onboarding/Question/Option/Icon.vue
index bdb9cf0d20..86acc0680e 100644
--- a/packages/nc-gui/components/auth/onboarding/Question/Option/Icon.vue
+++ b/packages/nc-gui/components/auth/onboarding/Question/Option/Icon.vue
@@ -6,9 +6,9 @@ interface Props {
iconSize?: OnboardingQuestionType['iconSize']
}
-const props = withDefaults(defineProps<Props>(), {})
+const props = defineProps<Props>()
-const { iconItem, optionIndex, totalOptions, iconSize } = toRefs(props)
+const { iconItem } = toRefs(props)
const showIconMapIcon = computed(() => {
return (!iconItem.value.iconType || iconItem.value.iconType === 'iconMap') && iconItem.value.icon
@@ -80,5 +80,3 @@ const iconColors = computed(() => {
<div v-else></div>
</div>
</template>
-
-<style lang="scss" scoped></style>
diff --git a/packages/nc-gui/components/auth/onboarding/Question/Option/IconGroup.vue b/packages/nc-gui/components/auth/onboarding/Question/Option/IconGroup.vue
index 4a7d3a6c75..65aa467ce6 100644
--- a/packages/nc-gui/components/auth/onboarding/Question/Option/IconGroup.vue
+++ b/packages/nc-gui/components/auth/onboarding/Question/Option/IconGroup.vue
@@ -6,9 +6,7 @@ interface Props {
iconSize?: OnboardingQuestionType['iconSize']
}
-const props = withDefaults(defineProps<Props>(), {})
-
-const { option, iconSize } = toRefs(props)
+defineProps<Props>()
</script>
<template>
diff --git a/packages/nc-gui/components/auth/onboarding/Question/Option/index.vue b/packages/nc-gui/components/auth/onboarding/Question/Option/index.vue
index 064b2e82da..4567df748f 100644
--- a/packages/nc-gui/components/auth/onboarding/Question/Option/index.vue
+++ b/packages/nc-gui/components/auth/onboarding/Question/Option/index.vue
@@ -6,9 +6,7 @@ interface Props {
iconSize?: OnboardingQuestionType['iconSize']
}
-const props = withDefaults(defineProps<Props>(), {})
-
-const { option } = toRefs(props)
+defineProps<Props>()
</script>
<template>
diff --git a/packages/nc-gui/components/auth/onboarding/Question/index.vue b/packages/nc-gui/components/auth/onboarding/Question/index.vue
index b5aa837f59..58d85165c8 100644
--- a/packages/nc-gui/components/auth/onboarding/Question/index.vue
+++ b/packages/nc-gui/components/auth/onboarding/Question/index.vue
@@ -4,9 +4,9 @@ interface Props {
questionIndex: number
}
-const props = withDefaults(defineProps<Props>(), {})
+const props = defineProps<Props>()
-const { question, questionIndex } = toRefs(props)
+const { question } = toRefs(props)
const { formState, onSelectOption, stepper } = useOnboardingFlow()
diff --git a/packages/nc-gui/components/auth/onboarding/index.vue b/packages/nc-gui/components/auth/onboarding/index.vue
index ee8f6c4930..d5d0d9b50c 100644
--- a/packages/nc-gui/components/auth/onboarding/index.vue
+++ b/packages/nc-gui/components/auth/onboarding/index.vue
@@ -7,34 +7,17 @@ const autoScrollQuestionRefs = ref<HTMLDivElement>()
const onSelectRef: VNodeRef = (el) => {
if (el) {
- autoScrollQuestionRefs.value = (el as any)?.$el as HTMLDivElement
+ autoScrollQuestionRefs.value = (el as any).$el as HTMLDivElement
}
}
const transitionName = ref<'slide-left' | 'slide-right' | null>(null)
-watch(
- () => stepper.index.value,
- (newIndex, oldIndex) => {
- if (oldIndex === undefined) return
+watch(stepper.index, (newIndex, oldIndex) => {
+ if (oldIndex === undefined) return
- transitionName.value = newIndex > (oldIndex ?? 0) ? 'slide-left' : 'slide-right'
- },
-)
-
-let timer: any
-watch(
- () => visibleQuestion.value.id,
- (_newValue, _oldValue, cleanup) => {
- timer = setTimeout(() => {
- // autoScrollQuestionRefs.value?.scrollIntoView({ behavior: 'smooth', block: 'start' })
- }, 300)
-
- cleanup(() => {
- clearTimeout(timer)
- })
- },
-)
+ transitionName.value = newIndex > (oldIndex ?? 0) ? 'slide-left' : 'slide-right'
+})
onMounted(() => {
onInitOnboardingFlow()
diff --git a/packages/nc-gui/pages/signup/[[token]].vue b/packages/nc-gui/pages/signup/[[token]].vue
index 07491832ef..c3e96e0a05 100644
--- a/packages/nc-gui/pages/signup/[[token]].vue
+++ b/packages/nc-gui/pages/signup/[[token]].vue
@@ -86,10 +86,10 @@ async function signUp() {
let continueAfterOnboardingFlow = ''
if (base?.id) {
- continueAfterOnboardingFlow = 'nc' + `/${base.id}`
+ continueAfterOnboardingFlow = `nc/${base.id}`
if (table?.id) {
- continueAfterOnboardingFlow = `${continueAfterOnboardingFlow}/${table.id}`
+ continueAfterOnboardingFlow += `/${table.id}`
}
}