-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(task): add baseMixin support in TaskTypes #10495
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
base: develop
Are you sure you want to change the base?
feat(task): add baseMixin support in TaskTypes #10495
Conversation
|
Connected to Huly®: UBERF-15459 |
- Add baseMixin field to TaskType interface (plugins/task/src/index.ts) - Add @prop decorator for baseMixin in model (models/task/src/index.ts) - Modify mixin creation logic to use baseMixin when provided (plugins/task/src/utils.ts) - Add validateMixinHierarchy function for inheritance validation - Create MixinSelector.svelte component for UI selection - Add i18n strings for BaseMixin, BaseMixinDescription, NoBaseMixin This allows TaskTypes to inherit attributes from existing mixins while maintaining backwards compatibility. Signed-off-by: Luis Rosas <[email protected]>
d5b35ae to
54ce6fb
Compare
Signed-off-by: Luis Rosas <[email protected]>
Signed-off-by: Luis Rosas <[email protected]>
Signed-off-by: Luis Rosas <[email protected]>
…tance Signed-off-by: Luis Rosas <[email protected]>
Signed-off-by: Luis Rosas <[email protected]>
Signed-off-by: Luis Rosas <[email protected]>
| allowedAsChildOf!: Ref<TaskType>[] // In case of specified, task type is for sub-tasks | ||
|
|
||
| @Prop(TypeRef(core.class.Mixin), getEmbeddedLabel('Base Mixin')) | ||
| baseMixin?: Ref<Mixin<Task>> // Existing mixin to inherit attributes from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please fix validation errors here?
You can verify it locally by running rushx _phase:validate in the directory /models/task/.
| "CloneExisting": "Clone existing", | ||
| "CloneTaskTypes": "Clone", | ||
| "SelectTaskTypesToClone": "Select task types to clone", | ||
| "NoTaskTypesAvailable": "No task types available to clone", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add translations for other languages as well?
Or I can add them later if it will be easier for you.
| // Create new targetClass (mixin) that extends the source's targetClass | ||
| const sourceClass = client.getHierarchy().getClass(source.ofClass) | ||
| const newTargetClass = await client.createDoc(core.class.Class, core.space.Model, { | ||
| extends: source.targetClass, // Inherit from source's mixin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you checked what happens if you delete a source type after creating a target type?
|
Hi @luisrosasx |
This allows TaskTypes to inherit attributes from existing mixins while maintaining backwards compatibility.