-
Notifications
You must be signed in to change notification settings - Fork 22
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
Cv2 4498 edit article #1985
Cv2 4498 edit article #1985
Conversation
Added a new RatingSelector item Added created_by date Added items needed for editing to cards Removed reliance on project_media
edit status and publish values for fact checks set description as summary for fact checks claim is now claim_description verification_statuses now sent to create form
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.
Hi @sarahkeh I starting looking at this and have some things to address. I will continue to take a look, but didn't want to hold you up looking into somethings:
- The created and edited areas are not showing the user information of who created or saved, I just see the dates:
![Screenshot 2024-06-25 at 2 24 03 PM](https://private-user-images.githubusercontent.com/418001/342873065-6f368f36-69bf-4826-910b-6102701408ac.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEzNTAzOTgsIm5iZiI6MTcyMTM1MDA5OCwicGF0aCI6Ii80MTgwMDEvMzQyODczMDY1LTZmMzY4ZjM2LTY5YmYtNDgyNi05MTBiLTYxMDI3MDE0MDhhYy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcxOVQwMDQ4MThaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mMTFlMjA1MThjMzFhM2M3NjU1ZGMyNDQ0MjgwMGI3MDhlMTc1NjhkZTNhNDg1OTgzZGE2YTNhMWU5OGI1ZDlkJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.CBf1lvYQcCZXT1Di5eYKz3f-cNghvtLDHO-ndxoDFIw)
- As discussed on a call at some point, we are going to skip trash for now, so that should be removed from the footer
- There is no validation happening on required fields right now. The components should all have an ability to get the error state when appropriate
- Just like you did with the "new" button interaction, we need to close and open each article when clicked from the list, currently the slideouts will "stack", so we should match the behavior
I will keep looking, but as said, wanted to get somethings in front of you. Let me know if you have any questions or if I can clarify anything!
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.
Hi, @sarahkeh :)
I noticed that when clicking on the "Unpublished Report" button from the forms, it redirects to the wrong URL:
Could you please update the handleGoToReport function to redirect to the correct URL from the list page as well?
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.
Please mount the forms from the Articles component rather than from inside each card
Removed trash for now, hid the footer for editing Publish status only shows when there is an associated project media and the link is updated to go from the Articles list Removal of Created By, name is added for Last Saved: Pulled everything from ArticlesCard except onClick event to Articles file The save after editing a field now uses existing FactCheck/Claim/Explainer object + new field value, rather than just the state value, to fix a most recently updated field not saving sometimes Removed unused fields added to ArticleCard
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.
Hi, Sarah :)
i am getting this error when clicking on an article on list view:
ArticleForm.js:40 Uncaught TypeError: Cannot read properties of null (reading 'map') at ArticleForm (ArticleForm.js:40:1)
I believe It is happening because my team doesn't have tags, it can be fixed by adding a safe navigation on this part of the code:
team.teamTags?.map
https://github.com/meedan/check-web/blob/cv2-4498-edit-article/src/app/components/article/ArticleForm.js#L40
And I'm not sure how to test the edit forms. I tried editing an article and closing the form, but the changes are not being saved.
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.
Couple things I wanted to check on @sarahkeh and let the others handle technical review:
- There are a lot of relay warnings that get generated when the edit slideout opens, i just wanted to flag these to make sure they are not important:
such as:Warning: RelaySelector: Expected object to contain data for fragment
ArticleForm_team, got
...` - Editing the Status of the Fact-Check doesn't seem to work, it never updates. Is this a bug or a know thing?
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.
@sarahkeh something to address other than my previous questions, we should remain consistent with the slideouts and click interactions. So a couple things I noticed, and you can see them in the attached video:
- Currently when editing, I can only open 1 slideout and any other clicks do nothing. We should have it behave like the create button does, where it replaces the previous.
- Conversely, If you open an article to edit, then click the create button, it stacks instead of replacing:
Screen.Recording.2024-07-09.at.4.47.38.PM.mov
@brianfleming I think what's happening with the Status is that it went from a value tied to a media item to a value called Rating that is tied to a Fact Check. What the form does is update and save the Fact Check Rating, but I think the list displays the media item's Status, not the Rating. I thought @caiosba said these values were synced but maybe that work is pending? |
Yes, the form should set and read the |
@brianfleming I've just pushed the change for the top point but the second is much more complicated. I can prevent the create form opening over the edit and vice versa (by checking for the class name) but I can't close a Create form from inside the Articles List as that's a value that exists within the Create New Article component. |
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, I will let the engineers approve or ask for changes. the reality is that this is getting very long lived and we need to get moving. With the creation of the rating ticket to be addressed which is currently the most confusing part for users, lets get this into the epic branch so we can easily evaluate the completness of this feature set
to let engineers do tech review and approve or ask for changes
Agree with @brianfleming and aligned with @amoedoamorim that he will do the tech review soon. |
Changes that have been added:
|
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:
Description
Adds edit to the create form
Info added to top of form, Saves on blur, added cds component for Rating dropdown to display fact check rating, updated ArticleCard to take in as props additional information that the edit form will need. This might need to be added to as these components are properly hooked up
References: CV2-4498
Type of change
How has this been tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can verify the changes. Please describe whether or not you implemented automated tests.
Things to pay attention to during code review
Added a rough onClick even to open up the editing form, this should be properly connected as now it also opens the form when the user tries adding a tag.
Checklist
propTypes
are declared and they use React Hooks and, if data-fetching is required, they use Relay Modern with fragment containers