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

TSK-1682: Introduced Schema module #5240

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

TSK-1682: Introduced Schema module #5240

wants to merge 5 commits into from

Conversation

anotherpit
Copy link
Contributor

@anotherpit anotherpit commented Apr 8, 2024

For upcoming implementation of Recruit Script feature we need a way to:

  • let one group of users compose and configure forms of typed fields
  • let other groups of users fill those forms with their data

Think of something like Google Forms or Typeform. And also think of JSON schema as a comprehensive and standard language to describe forms.

So here I introduce Schema module which provides a set of context-agnostic building blocks to let any other Huly module incorporate forms built by one users and filled by others. The first module to utilize Schema will be Recruit, but this will happen in the next PR.

Huly®: UBERF-6413

Signed-off-by: Petr Vyazovetskiy <develop.pit@gmail.com>
@aplatoff
Copy link
Member

aplatoff commented Apr 8, 2024

Just curious: why do not use platform's model for that? Is there any limitations and it can not cover some cases?

import { mergeIds } from '@hcengineering/platform'

export { schemaId } from '@hcengineering/schema'
export default mergeIds(schemaId, schema, {})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, schema plugin is effectively empty. Should we drop it and convert schema-resources into package, maybe? But keep in mind we still need model-schema plugin to register mixin

import type { JSONSchema7 } from 'json-schema'

/** @public */
export interface Schema extends Obj, JSONSchema7 {}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aplatoff Let's move here, so we could resolve the thread later.

Just curious: why do not use platform's model for that? Is there any limitations and it can not cover some cases?

What exactly do you mean? The module does use platform's native data structures like Obj, Doc and Mixin. No limitations there, they do perfectly fit our needs 👍🏽

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean that since both the platform and JSON Schema are focused on modeling data structures, why do we need two different mechanisms for modeling?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any comments on this? :) @anotherpit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed on call. The suggested idea is to not reinvent the wheel and utilize Classes and Attributes and to have a flow similar to that of the Class Settings screen

image

Signed-off-by: Petr Vyazovetskiy <develop.pit@gmail.com>
Signed-off-by: Petr Vyazovetskiy <develop.pit@gmail.com>
Signed-off-by: Petr Vyazovetskiy <develop.pit@gmail.com>
Signed-off-by: Petr Vyazovetskiy <develop.pit@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants