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

Handle drafts and published - fix various issues #64

Merged
merged 9 commits into from Jul 13, 2023

Conversation

thebiggianthead
Copy link
Contributor

@thebiggianthead thebiggianthead commented Jul 10, 2023

Initially I created this branch to fix an issue where sort orders of published docs weren't updated if a draft doc existed. I ended up doing a few more fixes as I noticed things that weren't quite right, so this PR also covers a fair few things:

  • updated plugin-kit and other deps
  • when a draft and published document exists, only the draft document was patched with the new sort order, even though the plugin doesn't distinguish between draft and published documents. This meant it wasn't possible to reorder a published document in any situation a draft existed. Now, draft and published versions will be patched.
  • Changed routing to use native Studio functionality. This means navigation between docs now happens without a page reload. Active documents are now given highlighted in the doc pane to give better context to users.
  • Updated to use sanity-plugin-utils for the listener and for feedback components. This also solves as issue where a documents moving from draft to publish meant the title no longer displayed in the list pane.

@socket-security
Copy link

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Issue Package Version Note Source
Protestware/Troll package styled-components 5.3.11
  • Note: This package prints a protestware console message regarding Ukraine for users with Russian language locale
Protestware/Troll package styled-components 6.0.2
  • Note: This package prints a protestware console message regarding Ukraine for users with Russian language locale

Next steps

What is protestware and troll packages?

This package is a joke, parody, or includes undocumented or hidden behavior unrelated to its primary function.

Consider that consuming this package my come along with functionality unrelated to its primary purpose.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@* or ignore all packages with @SocketSecurity ignore-all

  • @SocketSecurity ignore styled-components@5.3.11
  • @SocketSecurity ignore styled-components@6.0.2

@thebiggianthead thebiggianthead marked this pull request as ready for review July 10, 2023 18:35
Copy link
Contributor

@snorrees snorrees left a comment

Choose a reason for hiding this comment

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

Awesome housekeeping! LGTM (as long as you remove the dryrun flag todo)

with:
cache: npm
node-version: lts/*
- run: npm ci
# Branches that will release new versions are defined in .releaserc.json
- run: npx semantic-release
# @TODO remove --dry-run after verifying everything is good to go
- run: npx semantic-release --dry-run
Copy link
Contributor

Choose a reason for hiding this comment

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

Dryrun needs to removed from here (todo)

@SimeonGriggs
Copy link
Collaborator

This is great @thebiggianthead!

  • I'd drop the size of the Text around DragHandleIcon to 2
  • The native router has broken the ability to hold shift and click a second item to select two elements and all in-between, not sure if you can prevent that event from happening?

@thebiggianthead
Copy link
Contributor Author

@SimeonGriggs Sorted. I've also added a counter on the drag when multiple items are being moved – I found it a little unclear given not all items are visibly moving so felt this might help...

@SimeonGriggs
Copy link
Collaborator

Nice touch, LGTM!

@SimeonGriggs SimeonGriggs merged commit 59c7b62 into main Jul 13, 2023
7 of 8 checks passed
@SimeonGriggs SimeonGriggs deleted the feat/handle-drafts-and-published branch July 13, 2023 11:21
snorrees pushed a commit that referenced this pull request Jul 13, 2023
* chore: update plugin-kit and other deps

* feat: return patches for published and draft docs

* feat: fix routing, add selected document; closes #60, closes #59

* chore: remove duped prettier and eslint configs

* feat: migrate to use plugin-utils for listener and feedback. formats code. Closes #63, closes #37

* fix: readd v2 branch

* fix: only patch published version if it exists

* fix: reenable multi-drag. add drag counter icon

* chore: remove dry run flag
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.

None yet

3 participants