diff --git a/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte b/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte index 7f54dbf582..9f7ced013d 100644 --- a/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte +++ b/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte @@ -71,9 +71,11 @@ options.push({ icon: "VisibilityOff", value: PERMISSION_OPTIONS.HIDDEN, - tooltip: requiredTooltip || "Hidden", disabled: isDisplayColumn || isRequired, - tooltip: isDisplayColumn && "Display column cannot be hidden", + tooltip: + (isDisplayColumn && "Display column cannot be hidden") || + requiredTooltip || + "Hidden", }) return { ...c, options } diff --git a/packages/server/src/api/routes/utils/validators.ts b/packages/server/src/api/routes/utils/validators.ts index e2cc463f38..a63b29fe5a 100644 --- a/packages/server/src/api/routes/utils/validators.ts +++ b/packages/server/src/api/routes/utils/validators.ts @@ -2,10 +2,11 @@ import { auth, permissions } from "@budibase/backend-core" import { DataSourceOperation } from "../../../constants" import { Table, WebhookActionType } from "@budibase/types" import Joi, { CustomValidator } from "joi" -import { ValidSnippetNameRegex } from "@budibase/shared-core" -import { isRequired } from "../../../utilities/schema" +import { ValidSnippetNameRegex, helpers } from "@budibase/shared-core" import sdk from "../../../sdk" +const { isRequired } = helpers.schema + const OPTIONAL_STRING = Joi.string().optional().allow(null).allow("") const OPTIONAL_NUMBER = Joi.number().optional().allow(null) const OPTIONAL_BOOLEAN = Joi.boolean().optional().allow(null)