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

Save draft #1340

Merged
merged 59 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
d974f43
fix: Add optional access to navigator.vendor deprecated property
ptbrowne Feb 12, 2024
0294863
docs: Add table of contents
ptbrowne Feb 12, 2024
af8a102
refactor: Extract keys early
ptbrowne Feb 13, 2024
56929a9
refactor: Use query cache & invalidation to facilitate mutation
ptbrowne Feb 13, 2024
aea33b7
feat: Add useMutate helper
ptbrowne Feb 13, 2024
38dbb98
refactor: Remove config through useMutate
ptbrowne Feb 13, 2024
42d977a
feat: Add draft published state
ptbrowne Feb 13, 2024
f81c149
feat: Ability to turn config into draft/publish it from chart list
ptbrowne Feb 13, 2024
c995497
refactor: Extract saveState from component
ptbrowne Feb 13, 2024
3844279
fix: Config for existing chart is correctly fetched
ptbrowne Feb 13, 2024
23dae00
refactor: Rename for clarity
ptbrowne Feb 13, 2024
1d5792c
feat: Use menu instead of tooltip
ptbrowne Feb 13, 2024
64b6359
fix fetch data
ptbrowne Feb 15, 2024
9663353
refactor: Rename method
ptbrowne Feb 15, 2024
4303529
refactor: Decompose effect in both parts
ptbrowne Feb 15, 2024
9d77f58
feat: Show warning if viewing chart still in draft
ptbrowne Feb 15, 2024
ba80167
feat: Add save draft button
ptbrowne Feb 15, 2024
867311c
fix: Add required chartId prop
ptbrowne Feb 15, 2024
af92a08
feat: Add translations for chart features
ptbrowne Feb 15, 2024
22ad15a
refactor: Add docs and explicit the version
ptbrowne Feb 15, 2024
e6f5479
fix: Inverted message
ptbrowne Feb 15, 2024
98d73f7
feat: Add published state as non optional
ptbrowne Feb 15, 2024
dded7a7
fix: button in button
ptbrowne Feb 16, 2024
79786d3
feat: Make create and update config simpler, they take a config and w…
ptbrowne Feb 16, 2024
f32fb11
Show SaveAsDraft button inside layout options
ptbrowne Feb 16, 2024
e51afff
feat: Hide save as draft button if not logged in
ptbrowne Feb 16, 2024
5134a9c
refactor: Rename SaveDraft button
ptbrowne Feb 16, 2024
5000dde
feat: Ability to dismiss snack
ptbrowne Feb 16, 2024
fd452c9
fix: Can save in draft a new chart
ptbrowne Feb 16, 2024
ec1baed
refactor: Reduce case
ptbrowne Feb 16, 2024
a9c297c
refactor: Remove unnnecessary type
ptbrowne Feb 16, 2024
1aa90d2
fix: Remove target blank
ptbrowne Feb 16, 2024
fc0d75b
feat: Show arrow for menu
ptbrowne Feb 16, 2024
6c2842e
fix: Remove config call does not check incoming data from userId, che…
ptbrowne Feb 16, 2024
424bbf2
fix: Gap
ptbrowne Feb 16, 2024
431703f
feat: Show edit button on chart page if it's a draft
ptbrowne Feb 16, 2024
07aded3
refactor: Extract Confirmation Dialog from actions
ptbrowne Feb 16, 2024
ac7621a
feat: Refactor actions to be able to show the primary one as button
ptbrowne Feb 16, 2024
31897ca
fix: Typo
ptbrowne Feb 16, 2024
2097c22
refactor: Split component and make title of visualisation table dynamic
ptbrowne Feb 16, 2024
a0fd5e0
feat: Show drafts and published configs separately
ptbrowne Feb 16, 2024
394ea79
feat: Show actions differently for drafts & published
ptbrowne Feb 16, 2024
2981ece
feat: Show only small check, less things to translate
ptbrowne Feb 16, 2024
8dfdbf2
feat: Make button a bit more lively
ptbrowne Feb 16, 2024
b54f3fd
feat: Add translations
ptbrowne Feb 16, 2024
18a823f
fix: Menu item takes the whole width
ptbrowne Feb 16, 2024
8f5e588
fix: Correct import
ptbrowne Feb 16, 2024
e11e4b9
fix: Missing published state
ptbrowne Feb 16, 2024
d1ebad4
fix: Unused
ptbrowne Feb 16, 2024
6b5846c
refactor: Extract row actions and confirmation dialog from profile-ta…
ptbrowne Feb 19, 2024
e9710a7
feat: Add xsmall variant to button sizes
ptbrowne Feb 19, 2024
4b541df
feat: Show delete in red
ptbrowne Feb 19, 2024
822381f
fix: Make all tables look the same
ptbrowne Feb 19, 2024
dd8bca6
refactor: Extract rename dialog
ptbrowne Feb 20, 2024
ce7c21b
feat: Wrap th cells into table row and extract styling to table
ptbrowne Feb 20, 2024
47a83d6
fix: Delete should correctly work
ptbrowne Feb 20, 2024
75ad1c9
fix: Correctly call confirmation if required
ptbrowne Feb 20, 2024
76b02cf
fix: Typo
ptbrowne Feb 20, 2024
076b30b
fix: Width exceeded 100%
ptbrowne Feb 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/configurator/components/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const useStyles = makeStyles<Theme>((theme) => ({
LMRPanelHeaderLayout: {
width: "100%",
display: "grid",
gridTemplateColumns: `${DRAWER_WIDTH}px minmax(22rem, 1fr) ${DRAWER_WIDTH}px`,
gridTemplateColumns: `${DRAWER_WIDTH}px minmax(22rem, 1fr) auto`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the idea here was to have a symmetrical layout, not sure if we need to have this change – if you think so, then you should also update LMRPanelHeaderLayout class to mimic this 😄 Btw, as it's not used anywhere, maybe we can just remove this layout option :)

Copy link
Collaborator Author

@ptbrowne ptbrowne Feb 20, 2024

Choose a reason for hiding this comment

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

The problem here was that the publish options + save draft would be wider than the panel. I think we have to see later how to improve. Myabe we can check this together tomorrow.

gridTemplateAreas: `
"left middle right"
`,
Expand Down
23 changes: 20 additions & 3 deletions app/locales/de/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ msgstr "Veröffentlichen"
msgid "button.save-draft"
msgstr "Entwurf speichern"

#: app/components/chart-selection-tabs.tsx
msgid "button.save-draft.error"
msgstr "Entwurf konnte nicht gespeichert werden"

#: app/components/chart-selection-tabs.tsx
msgid "button.save-draft.saved"
msgstr "Entwurf gespeichert"

#: app/components/publish-actions.tsx
msgid "button.share"
msgstr "Teilen"
Expand Down Expand Up @@ -1230,7 +1238,16 @@ msgstr "Denken Sie daran, dass das Entfernen dieser Visualisierung sich auf alle
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-tables.tsx
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
msgid "login.profile.my-drafts"
msgstr "Meine Entwürfe"

#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
msgid "login.profile.my-visualizations"
msgstr "Meine Visualisierungen"

Expand All @@ -1243,8 +1260,8 @@ msgid "login.profile.my-visualizations.chart-name"
msgstr "Name"

#: app/login/components/profile-tables.tsx
msgid "login.profile.my-visualizations.chart-published-date"
msgstr "Veröffentlicht"
#~ msgid "login.profile.my-visualizations.chart-published-date"
#~ msgstr "Veröffentlicht"

#: app/login/components/profile-tables.tsx
msgid "login.profile.my-visualizations.chart-type"
Expand Down
23 changes: 20 additions & 3 deletions app/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ msgstr "Publish"
msgid "button.save-draft"
msgstr "Save draft"

#: app/components/chart-selection-tabs.tsx
msgid "button.save-draft.error"
msgstr "Could not save draft"

#: app/components/chart-selection-tabs.tsx
msgid "button.save-draft.saved"
msgstr "Draft saved"

#: app/components/publish-actions.tsx
msgid "button.share"
msgstr "Share"
Expand Down Expand Up @@ -1230,7 +1238,16 @@ msgstr "Keep in mind that removing this visualization will affect all the places
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-tables.tsx
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
msgid "login.profile.my-drafts"
msgstr "My drafts"

#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
msgid "login.profile.my-visualizations"
msgstr "My visualizations"

Expand All @@ -1243,8 +1260,8 @@ msgid "login.profile.my-visualizations.chart-name"
msgstr "Name"

#: app/login/components/profile-tables.tsx
msgid "login.profile.my-visualizations.chart-published-date"
msgstr "Published"
#~ msgid "login.profile.my-visualizations.chart-published-date"
#~ msgstr "Published"

#: app/login/components/profile-tables.tsx
msgid "login.profile.my-visualizations.chart-type"
Expand Down
23 changes: 20 additions & 3 deletions app/locales/fr/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ msgstr "Publier"
msgid "button.save-draft"
msgstr "Sauver le brouillon"

#: app/components/chart-selection-tabs.tsx
msgid "button.save-draft.error"
msgstr "Impossible d'enregistrer le brouillon"

#: app/components/chart-selection-tabs.tsx
msgid "button.save-draft.saved"
msgstr "Brouillon enregistré"

#: app/components/publish-actions.tsx
msgid "button.share"
msgstr "Partager"
Expand Down Expand Up @@ -1230,7 +1238,16 @@ msgstr "Gardez à l'esprit que la suppression de cette visualisation affectera t
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-tables.tsx
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
msgid "login.profile.my-drafts"
msgstr "Mes brouillons"

#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
msgid "login.profile.my-visualizations"
msgstr "Mes visualisations"

Expand All @@ -1243,8 +1260,8 @@ msgid "login.profile.my-visualizations.chart-name"
msgstr "Nom"

#: app/login/components/profile-tables.tsx
msgid "login.profile.my-visualizations.chart-published-date"
msgstr "Publié"
#~ msgid "login.profile.my-visualizations.chart-published-date"
#~ msgstr "Publié"

#: app/login/components/profile-tables.tsx
msgid "login.profile.my-visualizations.chart-type"
Expand Down
23 changes: 20 additions & 3 deletions app/locales/it/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ msgstr "Pubblicare"
msgid "button.save-draft"
msgstr "Salva la bozza"

#: app/components/chart-selection-tabs.tsx
msgid "button.save-draft.error"
msgstr "Impossibile salvare la bozza"

#: app/components/chart-selection-tabs.tsx
msgid "button.save-draft.saved"
msgstr "Bozza salvata"

#: app/components/publish-actions.tsx
msgid "button.share"
msgstr "Condividi"
Expand Down Expand Up @@ -1230,7 +1238,16 @@ msgstr "Tenete presente che la rimozione di questa visualizzazione avrà effetto
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-tables.tsx
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
msgid "login.profile.my-drafts"
msgstr "Le mie bozze"

#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
#: app/login/components/profile-content-tabs.tsx
msgid "login.profile.my-visualizations"
msgstr "Le mie visualizzazioni"

Expand All @@ -1243,8 +1260,8 @@ msgid "login.profile.my-visualizations.chart-name"
msgstr "Nome"

#: app/login/components/profile-tables.tsx
msgid "login.profile.my-visualizations.chart-published-date"
msgstr "Pubblicato"
#~ msgid "login.profile.my-visualizations.chart-published-date"
#~ msgstr "Pubblicato"

#: app/login/components/profile-tables.tsx
msgid "login.profile.my-visualizations.chart-type"
Expand Down
2 changes: 1 addition & 1 deletion app/pages/v/[chartId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ const VisualizationPage = (props: Serialized<PageProps>) => {
color="inherit"
size="small"
>
Edit
<Trans id="login.chart.edit">Edit</Trans>
</Button>
) : null}
</Alert>
Expand Down