The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
fix: hide add-select-option prompt for users without data model permission (#23410)
Thomas Trompette38e9d231bcd9
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiSelectFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiSelectFieldInput.tsxindex c9aefa38fa0..2ebd83940ad 100644--- a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiSelectFieldInput.tsx+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiSelectFieldInput.tsx@@ -41,13 +41,6 @@ export const MultiSelectFieldInput = () => {onSubmit?.({ newValue: draftValue });};- const handleAddSelectOption = (optionName: string) => {- if (!canAddSelectOption) {- return;- }- addSelectOption(optionName);- };-return (<MultiSelectInputselectableListComponentInstanceId={@@ -58,7 +51,7 @@ export const MultiSelectFieldInput = () => {onCancel={handleCancel}onOptionSelected={handleOptionSelected}values={draftValue}- onAddSelectOption={handleAddSelectOption}+ onAddSelectOption={canAddSelectOption ? addSelectOption : undefined}/>);};diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/SelectFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/SelectFieldInput.tsxindex 8d512599d1f..1571a8a104e 100644--- a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/SelectFieldInput.tsx+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/SelectFieldInput.tsx@@ -55,13 +55,6 @@ export const SelectFieldInput = () => {onCancel?.();};- const handleAddSelectOption = (optionName: string) => {- if (!canAddSelectOption) {- return;- }- addSelectOption(optionName);- };-const handleSubmit = (option: SelectOption) => {onSubmit?.({ newValue: option.value });@@ -110,7 +103,7 @@ export const SelectFieldInput = () => {: undefined}clearLabel={fieldDefinition.label}- onAddSelectOption={handleAddSelectOption}+ onAddSelectOption={canAddSelectOption ? addSelectOption : undefined}/>);};