Skip to content
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

feat: slur crowdsource feature #364

Merged
merged 58 commits into from
Oct 13, 2023

Conversation

aatmanvaidya
Copy link
Collaborator

@aatmanvaidya aatmanvaidya commented Sep 11, 2023

Describe the PR
This PR creates a new feature where Slurs can be crowdsourced by Uli users. This PR resolves #316 and #289.

A crowdsourced slur will have the following metadata

  1. label - slur word
  2. label meaning - meaning of the slur word
  3. categories - which category does this slur word fall under (gender, caster religion etc)
  4. appropriated - whether the slur word is used in its direct context or not
  5. appropriation_context - if used in the correct context, explain it.

A user can Add, Edit, Update and Delete a Slur Word they created.

Steps to test the PR

  1. Pull this PR
  2. Make sure the npm dependencies are installed, if not do so using npm install
  3. Add http://localhost:3000 ws://localhost to the manifest file and make sure you have a development.env file setup.
  4. start the backend and frontend as per your OS by following the steps in the wiki. Make sure you backend is up and running.
  5. open the database GUI at localhost:8080 and see if the tables can be seen. If not do the migrations using npx sequelize db:migrate . You should be able to see the two new tables "SLUR" and "CATEGORY".
  6. Everything should now be setup, load the dist folder in your desired browser and test the PR.

Expected behaviour
A user can do the CRUD operations for a slur

Screenshots
Screenshot (503)
Screenshot (502)

Things to Check closely in a Code Review

  1. all the API requests in the api-server/index.js file. I am no longer sending a 501 error in the GET request when there are no slurs found. I saw that when there were no slurs in the table, the GET request was sending an empty array.
  2. Check the CRUD API requests when called in frontend, I want to just make sure I am not giving away any user information that could be a potential security bug in the future.
  3. The multi-option categories is being handled separately; this is causing a Warning: A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. I need some help in fixing this warning.
  4. what to do about the new permissions in manifest.json files.

Potential Things to be added and Worked on

  1. Better UI, this will come in shape as final requirements come in
  2. Add transactions to PUT and DELETE requests.
  3. Add a loading bar when CRUD is happening on a Slur.
  4. Modify the delete and edit button to emoji symbol
  5. When there are no Slurs for a user, the Add button should be centered at the page below the text.
  6. test axios requests using Jest
  7. Add notifications when slur is created, edited and deleted.
  8. Add like a warning in the UI if the metadata isn't filled up
  9. Add a go back symbol in the go back text in Add Slur form, also make the link a Button. Also add pop-ups, if the data is not saved.
  10. sit with denny to fix the true false radio button issuem - THE FORM STATE IS NOT BEING UPDAETD CORRECTELY
  11. Ask denny about multiple select dropdown from sematic UI - https://react.semantic-ui.com/modules/dropdown/
    https://www.reddit.com/r/reactjs/comments/vtgbai/comparison_of_ui_libraries_for_react/

    Ask about Tailwind UI - its pretty light - https://tailwind-elements.com/docs/standard/forms/select/
  12. Why isn't Grommet Multiple Select work?
  13. Add a red star to required questions.
  14. how do de-select a radio button option - especially for this - If, Appropriated, Is it by Community or Others?
  15. git commit -m "message" --no-verify
  16. button cannot have red background color, why?
  17. Add Slur button coming for each slur card because of getSlurs.map() look into this
  18. Fix overflow slur issue in card js - fixed it by truncating text
  19. ASK denny - the jest testing in npm is being written as npm run test-jest, do I move it to npm run test
  20. Should I truncate all the text or should I use wrap={true}
  21. ask denny - how to change anchor color in theme
  22. Convert all text to hindi and tamil
  23. ask denny - better color selection for everything
  24. make the CARD using the grommet component.
  25. make sure slurs appear in descinding order in the slur index page
  26. in enable slur replace, when we cancel the refresh, the notification of saved still pops up, why so?

@ghost
Copy link

ghost commented Sep 11, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@dennyabrain
Copy link
Contributor

Thanks @aatmanvaidya
So expect this PR to be open for a long time. Lets use this to demo the feature to the team but I'll merge it once we have the actual requirements for the various fields finalized.
Merging this incorrect feature might make it hard to release fixes.

@gitguardian
Copy link

gitguardian bot commented Oct 3, 2023

⚠️ GitGuardian has uncovered 4 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id Secret Commit Filename
- Username Password 819728a browser-extension/docker-compose.yml View secret
- Username Password bfbb14b browser-extension/docker-compose.yml View secret
- Username Password 5170b76 browser-extension/docker-compose.yml View secret
- Username Password 177ab3c browser-extension/docker-compose.yml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

aatmanvaidya and others added 3 commits October 7, 2023 16:06
@dennyabrain
Copy link
Contributor

dennyabrain commented Oct 11, 2023

Proposed Pending Improvements :

  • level_of_severity naming
  • validate function for category example
  • have one Form component for edit and create slur metadata
  • Curate web pages with slurs so that it can be used to demo the "crowdsource feature"

@dennyabrain dennyabrain marked this pull request as ready for review October 13, 2023 04:59
@dennyabrain dennyabrain merged commit d4ee30d into tattle-made:main Oct 13, 2023
3 checks passed
@aatmanvaidya aatmanvaidya deleted the slur-crowdsource branch October 13, 2023 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
2 participants