-
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
Creating Application doesn't work when a contributor is specified #1404
Labels
kind/bug
Categorizes issue or PR as related to a bug.
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
Comments
sjd78
added
kind/bug
Categorizes issue or PR as related to a bug.
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
labels
Sep 27, 2023
sjd78
added
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
and removed
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
labels
Sep 27, 2023
This was referenced Sep 27, 2023
sjd78
added a commit
to sjd78/tackle2-ui
that referenced
this issue
Sep 28, 2023
Followup konveyor#1404 to update the way tags are updated to an existing application. Tags that are from an analysis need to be included with the update payload or they will be removed. This is different behavior from archetype or assessment tags. No updates to an application can remove archetype or assessment tags. Summary of changes and refactoring: - As form values, keep the tags using just the tag name as a string - Moved all data access/mutation code to hook `useApplicationFormData()` to logically divide concerns (data access v. UI handling) - Tags dropdown will only display/edit the application's "Manual tags" - `onSubmit()`'s payload building simplified using partially curried helper functions - Migrate to use `ItemsSelect` for handling the Tags Update `useUpdateApplicationMutation()` to provide the mutation's payload to the `onSuccess()` function. This allows the `onSuccess()` function to toast a message with the application's name. Add utility functions to `model-utils.tsx`: - convert objects that look like `Ref` object into exactly a `Ref` object: - toRef() - toRefs() - Match a set of items that look like `Ref` objects against a (set of) values and the matching matches as exactly `Ref` objects: items into exactly `Ref` objects: - matchItemsToRef() - matchItemsToRefs() Signed-off-by: Scott J Dickerson <[email protected]>
sjd78
added a commit
that referenced
this issue
Sep 28, 2023
### Contributors field The `contributors` field on the `Application` payload needs to be a pure `Ref` object or it will be rejected by the REST API call. Adopt the same set of data transforms used in the archetype-form to handle getting the correct set of data. Related changes (came up when working on #1331 that ended up revealing #1404): - REST `createApplication()` function updated to have the proper return type (response data is not unwrapped) - Query `useCreateApplicationMutation()` updated to properly pass the newly created `Application` to the `onSuccess()` handler - `onCreateApplicationSuccess()` in the application form updated to use the correct `onSuccess()` response data Resolves: #1404 ### Tags field Followup #1403 to update the way tags are updated to an existing application. Tags that are from an analysis need to be included with the update payload or they will be removed. This is different behavior from archetype or assessment sourced tags. No updates to an application can remove archetype or assessment tags. Summary of changes and refactoring: - As form values, keep the tags using just the tag name as a string - Moved all data access/mutation code to hook `useApplicationFormData()` to logically divide concerns (data access v. UI handling) - Tags dropdown will only display/edit the application's "Manual tags" - `onSubmit()`'s payload building simplified using partially curried helper functions - Migrate to use `ItemsSelect` for handling the Tags Update `useUpdateApplicationMutation()` to provide the mutation's payload to the `onSuccess()` function. This allows the `onSuccess()` function to toast a message with the application's name. Add utility functions to `model-utils.tsx`: - convert objects that look like `Ref` object into exactly a `Ref` object: - toRef() - toRefs() - Match a set of items that look like `Ref` objects against a (set of) values and return the matching items as exactly `Ref` objects: - matchItemsToRef() - matchItemsToRefs() --------- Signed-off-by: Scott J Dickerson <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
kind/bug
Categorizes issue or PR as related to a bug.
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
Is there an existing issue for this?
Konveyor version
main
Priority
Critical
Current Behavior
Filling out the new applcation form and adding at least one contributor will cause the application not to be created.
The error toast message looks like this:
Expected Behavior
Create should work!
How Reproducible
Always (Default)
Steps To Reproduce
Environment
- OS:
Anything else?
This message is typical of passing a full object in the create payload instead of a Ref (just id and name) to the object.
The text was updated successfully, but these errors were encountered: