-
-
Notifications
You must be signed in to change notification settings - Fork 229
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(admin): Admin for narrative views #4208
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
1aa2319
to
5bb89ab
Compare
Quick links (staging server):
Login:
SVG tester:Number of differences (default views): 0 ✅ Edited: 2024-11-22 17:22:01 UTC |
ef1d8d3
to
07ce35f
Compare
92e8c78
to
5ee1a90
Compare
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.
Copilot reviewed 5 out of 13 changed files in this pull request and generated no suggestions.
Files not reviewed (8)
- adminSiteClient/ChartEditor.ts: Evaluated as low risk
- adminSiteClient/ChartViewEditor.ts: Evaluated as low risk
- packages/@ourworldindata/types/src/dbTypes/ChartViews.ts: Evaluated as low risk
- adminShared/AdminTypes.ts: Evaluated as low risk
- db/migration/1733004083678-RenameChartViewsSlug.ts: Evaluated as low risk
- adminSiteClient/AdminSidebar.tsx: Evaluated as low risk
- adminSiteClient/AdminApp.tsx: Evaluated as low risk
- adminSiteClient/EditorReferencesTab.tsx: Evaluated as low risk
Comments skipped due to low confidence (2)
adminSiteClient/SaveButtons.tsx:224
- [nitpick] The button text 'Go to parent chart' could be more descriptive. Consider renaming it to 'Edit parent chart' for clarity.
Go to parent chart
adminSiteClient/SaveButtons.tsx:127
- [nitpick] The button text 'Save as narrative view' could be more descriptive. Consider renaming it to 'Create narrative view' for consistency with other button texts.
Save as narrative view
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.
Very nice work, Marcel! I left a few minor comments but this is coming along nicely :). A way to delete narrative views that are not referenced would be good to add.
|
||
const suggestedName = grapher.title ? slugify(grapher.title) : undefined | ||
|
||
const name = prompt( |
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.
Just a thought: we could allow changing the name as long as there are no active references. We don't have to do this now but if typos happen then this might be nice.
return ( | ||
<div> | ||
<Section name="Config"> | ||
<textarea |
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.
I get a squiggly line here that this needs a label. It's debug functionality but maybe worth it for a cleaner editor experience :)
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.
Must be some kind of editor (accessibility?) plugin that you have and I don't?
Anyhow, I tried quickly adding one and then the layout broke, and I couldn't be arsed 😀
width: 200, | ||
render: (chartConfigId) => ( | ||
<img | ||
src={`${BAKED_GRAPHER_URL}/by-uuid/${chartConfigId}.svg`} |
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.
This will work on prod but not on staging servers, right? Could we make this work now that we have CF preview deploys?
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.
No, this will also work on staging sites, as long as that config is available.
See http://staging-site-marcel/grapher/by-uuid/0191b6c7-364e-7cf2-be6e-8cee8e073203.svg, for example!
This PR introduces most of the basic admin functionality needed for narrative views, but not quite all of it just yet. But I think this is ready for a review for at this point, anyhow.
Part of #4128.
Features:
chart_views#slug
column to#name
/admin/chartViews
(based on antd table)Open questions:
Screenshots