mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-25 03:45:41 +00:00
refactor: cleanup and corrections
Signed-off-by: Pranav C <pranavxc@gmail.com>
This commit is contained in:
@@ -18,51 +18,12 @@ interface Emits {
|
||||
|
||||
const vModel = useVModel(props, 'modelValue', emits)
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const useForm = Form.useForm
|
||||
const validators = computed(() => {
|
||||
return {
|
||||
emails: [
|
||||
{
|
||||
validator: (rule: any, value: string, callback: (errMsg?: string) => void) => {
|
||||
if (!value || value.length === 0) {
|
||||
callback(t('msg.error.signUpRules.emailRequired'))
|
||||
return
|
||||
}
|
||||
const invalidEmails = (value || '').split(/\s*,\s*/).filter((e: string) => !validateEmail(e))
|
||||
if (invalidEmails.length > 0) {
|
||||
callback(
|
||||
`${
|
||||
invalidEmails.length > 1 ? t('msg.error.signUpRules.invalidEmails') : t('msg.error.signUpRules.invalidEmail')
|
||||
} ${invalidEmails.join(', ')} `,
|
||||
)
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
})
|
||||
|
||||
const invitationUsersData = ref({})
|
||||
|
||||
const { validateInfos } = useForm(invitationUsersData, validators)
|
||||
|
||||
onMounted(async () => {
|
||||
if (!users.value) {
|
||||
await loadUsers()
|
||||
}
|
||||
})
|
||||
|
||||
watch(
|
||||
() => validateInfos.emails.validateStatus,
|
||||
() => {
|
||||
invitationValid.value = validateInfos.emails.validateStatus === 'success' && invitationUsersData.emails?.length !== 0
|
||||
},
|
||||
)
|
||||
|
||||
const basesStore = useBases()
|
||||
const viewsStore = useViewsStore()
|
||||
|
||||
|
||||
@@ -1400,14 +1400,14 @@ eventBus.on(async (event, payload) => {
|
||||
})
|
||||
|
||||
watch(activeCell, (activeCell) => {
|
||||
const row = activeCell.row !== null ? cachedRows.value.get(activeCell.row)?.row : undefined;
|
||||
const col = (row && activeCell.col !== null) ? fields.value[activeCell.col] : undefined;
|
||||
const val = (row && col) ? row[col.title as string] : undefined;
|
||||
const row = activeCell.row !== null ? cachedRows.value.get(activeCell.row)?.row : undefined
|
||||
const col = row && activeCell.col !== null ? fields.value[activeCell.col] : undefined
|
||||
const val = row && col ? row[col.title as string] : undefined
|
||||
|
||||
const rowId = extractPkFromRow(row!, meta.value?.columns as ColumnType[])
|
||||
const viewId = view.value?.id;
|
||||
const viewId = view.value?.id
|
||||
|
||||
eventBus.emit(SmartsheetStoreEvents.CELL_SELECTED, { rowId, colId: col?.id, val, viewId });
|
||||
eventBus.emit(SmartsheetStoreEvents.CELL_SELECTED, { rowId, colId: col?.id, val, viewId })
|
||||
})
|
||||
|
||||
const reloadViewDataHookHandler = async () => {
|
||||
|
||||
@@ -1395,14 +1395,14 @@ eventBus.on(async (event, payload) => {
|
||||
})
|
||||
|
||||
watch(activeCell, (activeCell) => {
|
||||
const row = activeCell.row !== null ? dataRef.value[activeCell.row].row : undefined;
|
||||
const col = (row && activeCell.col !== null) ? fields.value[activeCell.col] : undefined;
|
||||
const val = (row && col) ? row[col.title as string] : undefined;
|
||||
const row = activeCell.row !== null ? dataRef.value[activeCell.row].row : undefined
|
||||
const col = row && activeCell.col !== null ? fields.value[activeCell.col] : undefined
|
||||
const val = row && col ? row[col.title as string] : undefined
|
||||
|
||||
const rowId = extractPkFromRow(row!, meta.value?.columns as ColumnType[])
|
||||
const viewId = view.value?.id;
|
||||
const viewId = view.value?.id
|
||||
|
||||
eventBus.emit(SmartsheetStoreEvents.CELL_SELECTED, { rowId, colId: col?.id, val, viewId });
|
||||
eventBus.emit(SmartsheetStoreEvents.CELL_SELECTED, { rowId, colId: col?.id, val, viewId })
|
||||
})
|
||||
|
||||
async function reloadViewDataHandler(params: void | { shouldShowLoading?: boolean | undefined; offset?: number | undefined }) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { ExtensionManifest, ExtensionType } from '#imports'
|
||||
const [useProvideExtensionHelper, useExtensionHelper] = useInjectionState(
|
||||
(extension: Ref<ExtensionType>, extensionManifest: ComputedRef<ExtensionManifest | undefined>, activeError: Ref<any>) => {
|
||||
const { $api } = useNuxtApp()
|
||||
const route = useRoute();
|
||||
const route = useRoute()
|
||||
|
||||
const basesStore = useBases()
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ const up = async (knex: Knex) => {
|
||||
};
|
||||
|
||||
const down = async (knex: Knex) => {
|
||||
await knex.schema.alterTable(MetaTable.SOURCES, (table) => {
|
||||
await knex.schema.alterTable(MetaTable.VIEWS, (table) => {
|
||||
table.dropColumn('created_by');
|
||||
table.dropColumn('owned_by');
|
||||
});
|
||||
|
||||
@@ -10,7 +10,7 @@ import { LoginPage } from '../../../pages/LoginPage';
|
||||
import { isEE } from '../../../setup/db';
|
||||
let api: Api<any>;
|
||||
|
||||
const xroleDb = [
|
||||
const roleDb = [
|
||||
{ email: `org_creator_@nocodb.com`, role: 'Organization Level Creator', url: '' },
|
||||
{ email: `org_viewer_@nocodb.com`, role: 'Organization Level Viewer', url: '' },
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user