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/link-audit frontend #1949

Merged
merged 30 commits into from
Sep 12, 2022
Merged

feat/link-audit frontend #1949

merged 30 commits into from
Sep 12, 2022

Conversation

jimvae
Copy link
Contributor

@jimvae jimvae commented Sep 2, 2022

Problem

As a user, I want to know what has changed on my link and by whom. This includes Link Status, Link Owner, Long URL and File Upload changes.

Relevant Links:
Notion story - User story and acceptance criteria
Backend - Backend tasks for this feature

Solution

  • Add a modified Timeline component using @material-ui/lab
  • Add new user redux states for link-audit (isFetchingLinkHistory, linkHistory and linkHistoryCount) for fetching link-audit information
  • Add new drawer state (toggleLinkHistory) to facilitate toggling between link history and link details in the link drawer
  • Add pagination to handle 10 entries per page
  • Fix all ui / mobile responsive issues (see notion story for the initial bugs)

Screenshots

View Link History Button that goes from link details to link history
Screen Shot 2022-09-02 at 11 21 35 AM

Link History Timeline to showcase different changes
image

Pagination
Screen Shot 2022-09-02 at 11 23 29 AM

End to End Tests

  • create new link -> validate a 'create' item in the link history
  • disable link -> validate a new update entry on Link Status
  • edit original long url -> validate a new update entry on Original Link
  • transfer ownership -> validate a new update entry on Link Owner

Deploy Notes

New dependencies:

  • "@material-ui/lab": "^4.0.0-alpha.61", : added this to use the Timeline component

When this dependency is updated in the future, there is a possibility that they shift some of the components to material-ui/core. This might lead to import errors which are easily fixable by changing the import source (easily caught during compilation)

Copy link
Collaborator

@halfwhole halfwhole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally lgtm, just mostly some nits!

would like to ask for your opinions on state management for link history - personally it seems a bit overkill to put the state for link history in the global redux store under UserState when it could be local to the LinkHistory component, but then there's also already an established pattern in the codebase of putting lots of things under the redux store. would it be better to follow this redux approach or try using a more local state here?

edit: also I just remembered something you mentioned before, where loading a new link history would temporarily display the previous stale link history before the new ones are fetched - local state should be able to help with that too by 'purging' link history state when unmounting the component

edit 2: also just saw feli's comments on figma regarding alignment - would the timeline alignment be something doable too?

package.json Outdated Show resolved Hide resolved
src/client/user/actions/types.ts Outdated Show resolved Hide resolved
src/client/user/actions/index.ts Outdated Show resolved Hide resolved
src/client/user/reducers/types.ts Outdated Show resolved Hide resolved
src/client/user/components/Drawer/ControlPanel/index.tsx Outdated Show resolved Hide resolved
test/end-to-end/util/helpers.ts Outdated Show resolved Hide resolved
test/end-to-end/LinkAudit.test.ts Outdated Show resolved Hide resolved
@jimvae
Copy link
Contributor Author

jimvae commented Sep 6, 2022

@halfwhole Thank you for the review! Amended most of them but would discuss with you in the office tmr about the changes related to the redux store

@halfwhole
Copy link
Collaborator

following a convo with @jimvae, we're good with using redux and following the current style for now - we can refactor the frontend to use other state management techniques another time!

Copy link
Collaborator

@halfwhole halfwhole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Copy link
Contributor

@gweiying gweiying left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@gweiying gweiying requested a review from thanhdatle September 12, 2022 06:02
@jimvae jimvae merged commit 3578fb5 into develop Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants