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

130 allow users to share charts #131

Merged
merged 1 commit into from
Aug 19, 2022
Merged

Conversation

Elkrival
Copy link
Collaborator

@Elkrival Elkrival commented Aug 15, 2022

Allow users to share charts

FE

  • Added a component that renders a list of users and displays users that the chart as been shared with
  • Remove and update users from the sharedWith list
  • New api route that updates the sharedWith list
  • Connected redux to charts component
  • Refresh charts list from a successful update

BE

  • Updated query to handle owned and sharedWith charts
  • Added new route to update sharedWith list

Video of functionality

Screen Shot 2022-08-15 at 5 16 24 PM

Screen Shot 2022-08-15 at 5 16 42 PM

Screen Shot 2022-08-15 at 5 38 12 PM

@Elkrival Elkrival linked an issue Aug 15, 2022 that may be closed by this pull request
Comment on lines 62 to 63
const { data } = await getCharts()
setChartList(data)
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we need to get charts after we share a chart?

Copy link
Collaborator Author

@Elkrival Elkrival Aug 17, 2022

Choose a reason for hiding this comment

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

We render the sharedWith list when we open the shareChart dialog component, calling the getCharts api we have the latest available data to display.

<Button
onClick={closeDialog}
style={{
color: '#5790bd',
Copy link
Collaborator

Choose a reason for hiding this comment

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

can these color strings be stored as constants somewhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This commit:

* Replicates the configuration share feature for charts, allowing users
  to share charts with other users.
* Adds a new attribute, sharedWith, to charts which contains an array of
  usernames of other users that the chart is shared with.
@Elkrival Elkrival force-pushed the 130-allow-users-to-share-charts branch from d26c11b to d814fdd Compare August 17, 2022 19:30
@Elkrival Elkrival merged commit 2e9f9dd into pnl-devel Aug 19, 2022
@Elkrival Elkrival deleted the 130-allow-users-to-share-charts branch September 19, 2022 01:36
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.

Allow users to share charts
2 participants