-
Notifications
You must be signed in to change notification settings - Fork 43
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
🐛 Update archetype model, form and detail drawer to current hub spec #1438
Conversation
Summary of changes: - Update `models.ts` to the current state of `TagRef` and `Archetype` in terms of field names and data types. - Update `ArchetypeForm` to use `criteria` instead of `criteriaTags` as per the api model changes. - The tags column on the archetype table is currently displaying ALL tags returned with no source differentiation. - MSW stub data updated to use api model changes. - Drop a `console.log` from `Autocomplete` Todo: - Check `Archetype.tags` contents so virtual / assessment tags are not editable in the `ArchetypeForm`. This should be similar behavior as the Application edit form. Only the "manual" tags should be editable. - Check archetype detail drawer so the "manual" tags and the tags from other sources are displayed properly. The application detail drawer shows manual, assessment and analysis tags. - The assessment wizard is also broken for application and archetype assessments. Signed-off-by: Scott J Dickerson <[email protected]>
Since all tags for an archetype are provided in the same field `tags`, filter them into "archetype tags" (i.e. an empty source) and "assessment tags" (i.e. have a non-empty source) to display them separately. Note: The "archetype tags" are the tags manually attached to the archetype in the new/edit form. Signed-off-by: Scott J Dickerson <[email protected]>
With hub changes to combine the archetype and non-archetype tags into a single field, change the form processing such that the non-archetype fields are ignored but still sent on an update. This change mirrors the behavior of manual / non-manual tags on applications and the application form. Stakeholder and stakeholder groups handling is updated to use the `*ToRef()` helper function style introduced in the application form change konveyor#1408. Signed-off-by: Scott J Dickerson <[email protected]>
2b4aeed
to
26b5123
Compare
|
||
const assessmentTags = | ||
archetype?.tags | ||
?.filter((t) => t?.source ?? "" !== "") |
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.
Are we looking to filter by assessment source here?
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.
Like the filters in the tags tab of the application drawer? ... No. That is not in the enhancement doc.
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.
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.
Ok. It just wasn't clear to me exactly what the empty source was meaning in this context.
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.
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.
Yeah... once I can run an assessment on an archetype I'll be able to verify that's what it would look like.
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.
The logic is...
- if the tag source is undefined or empty, it is an archetype tag
- if the tag source is not empty, it is an assessment tag
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1438 +/- ##
=======================================
Coverage 41.07% 41.08%
=======================================
Files 139 139
Lines 4404 4403 -1
Branches 1010 1010
=======================================
Hits 1809 1809
+ Misses 2583 2582 -1
Partials 12 12
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
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.
LGTM - Can follow up with assessmentTag issue in a later PR.
Follow up: konveyor#1438 Api changed and if a tag's source is empty, the field is not sent. Change the tag filtering test to consider `source === undefined` and `source === ""` as manual tags. Signed-off-by: Scott J Dickerson <[email protected]>
Follow up: #1438 Api changed and if a tag's source is empty, the field is not sent. Change the tag filtering test to consider `source === undefined` and `source === ""` as manual tags. Signed-off-by: Scott J Dickerson <[email protected]> Co-authored-by: Ian Bolton <[email protected]>
Summary
Resolves: #1436
With hub updates to tag handling and api field name changes related to archetypes, adjustments needed to be made to the UI.
Archetype model
Update
models.ts
to the current state ofTagRef
andArchetype
in terms of field names and data types.MSW stub data updated to use api model changes.
Archetype Table
Archetype Add/EditForm
Update
ArchetypeForm
to usecriteria
instead ofcriteriaTags
as per the api model changes.With hub changes to combine the archetype and non-archetype tags into a single field, the form processing now ignored non-archetype fields but still sends them on an update.
Note: This change mirrors the behavior of manual / non-manual tags on applications and the application form.
Stakeholder and stakeholder groups handling is updated to use the
*ToRef()
helper function style introduced in the application form change 🐛 Applications form: Fix contributors and tags field handling #1408.Archetype Detail Drawer
Since all tags for an archetype are provided in the same field
tags
, filter them into "archetype tags" (i.e. an empty source) and "assessment tags" (i.e. have a non-empty source) to display them separately.Note: The "archetype tags" are the tags manually attached to the archetype in the new/edit form.