Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REFACTOR] Split in two distinct forms Settings Object Model page #10653

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

prastoin
Copy link
Contributor

@prastoin prastoin commented Mar 4, 2025

Introduction

Closes twentyhq/core-team-issues#355

Refactored into two agnostic forms the Object Model settings page for instance /settings/objects/notes#settings.

SettingsDataModelObjectAboutForm

Added a new abstraction SettingsUpdateDataModelObjectAboutForm to wrap SettingsDataModelObjectAboutForm in an update context

image
Schema:

const requiredFormFields = objectMetadataItemSchema.pick({
  description: true,
  icon: true,
  labelPlural: true,
  labelSingular: true,
});
const optionalFormFields = objectMetadataItemSchema
  .pick({
    nameSingular: true,
    namePlural: true,
    isLabelSyncedWithName: true,
  })
  .partial();
export const settingsDataModelObjectAboutFormSchema =
  requiredFormFields.merge(optionalFormFields);

SettingsDataModelObjectSettingsFormCard

Update on change
image
Schema:

export const settingsDataModelObjectIdentifiersFormSchema =
  objectMetadataItemSchema.pick({
    labelIdentifierFieldMetadataId: true,
    imageIdentifierFieldMetadataId: true,
  });

@prastoin prastoin changed the title Prastoin split object settings model forms [REFACTOR] Split in two distinct forms Settings Object Model page Mar 4, 2025
@prastoin
Copy link
Contributor Author

prastoin commented Mar 4, 2025

Just discovered that we can corrup a workspace by sending an empty pluralNameIdentifier in advanced mode, investigating on this before continuing here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Refactor] Split settings form in two agnostic rhf forms
1 participant