Conversation
…om:CrowdDotDev/crowd.dev into bugfix/organizations-overwritten-on-upsert
joanagmaia
reviewed
Jun 2, 2023
Contributor
joanagmaia
left a comment
There was a problem hiding this comment.
I think there are 2 places still missing to update:
- In
dashboard-organization-itemline 31 - In
member-form-detailsin line 133. This is where in member's form we are adding organizations to the member and if they don't exist, we create a new organization
Another thing that is currently failing and needs update is in organization-form-page. You've updated the forms to read from displayName. But as you mentioned when creating an organization you still need to create it with name.
So in method onSubmit on that file, you should add the property name if you are in the create form. Probably on line 357, below ...formModel.value, you can add name: formModel.value.displayName if isEditPage.value === false and add displayName: formModel.value.displayName if isEditPage.value === true
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes proposed ✍️
displayName- We now use this field to do name updates on an organization via user. This is for ensuring edited organization names to be considered as the same organization. Since we're checking the existence of an organization by name, when user edits thenamefield, incoming data was creating new organizations - to prevent this now we're usingdisplayNameWhat
🤖 Generated by Copilot at 1d71d95
This pull request adds a new feature that allows organizations to have a display name that is different from their name. The display name is used in the frontend to show the organization's label. The pull request modifies the
organizationmodel, table, repository, service, and test files in the backend, as well as theorganizationmodel, component, and page files in the frontend. It also includes migration scripts to add and drop thedisplayNamecolumn in the database.
🤖 Generated by Copilot at 1d71d95
Why
How
🤖 Generated by Copilot at 1d71d95
displayNamecolumn toorganizationstable andorganizationmodel to allow organizations to have a label different from their name (link,link,link)displayNamethe same value asnameby default inorganizationRepository.createandorganizationService.createOrUpdatemethods (link,link)organizationRepository.updatemethod to includedisplayNamein the data object (link)displayNameto theselectclause of SQL queries inorganizationRepository.findAndCountAll,organizationRepository.findAllAutocomplete, andorganizationRepository.findByIdmethods (link,link,link)textContainsoperator fordisplayNamein thewhereclause of SQL query inorganizationRepository.filtermethod (link)displayNameinstead ofnameto match the query and populate the label inorganizationRepository.findAllAutocompletemethod (link,link)displayNameproperty to organization objects in test cases formemberRepository,memberService, andorganizationRepository(link,link,link,link,link,link,link,link,link)organizationsproperty from member objects in test cases formemberRepositoryandmemberService(link,link,link)getOrganizationIdsmethod tomemberRepositoryto query the database for organization ids of a given member (link)memberRepository.findByIdmethod to return aplainMemberobject that includes theorganizationsproperty as an array of organization ids (link)organization.nameexpressions toorganization.displayNamein frontend components that show the organization label, such asmember-organizations,organization-form-details,organization-name,organization-view-header, andorganization-form-page(link,link,link,link,link,link,link,link,link)namefield todisplayNamefield inorganization-model.jsin the frontend (link)Checklist ✅
Feature,Improvement, orBug.