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

Favorites ux refresh #1278

Merged
merged 46 commits into from
Feb 22, 2021
Merged

Favorites ux refresh #1278

merged 46 commits into from
Feb 22, 2021

Conversation

OskarDamkjaer
Copy link
Contributor

@OskarDamkjaer OskarDamkjaer commented Feb 9, 2021

This PR aims to improve the usefulness of favorites by adding a context menu to each favorite and adding bulk operations.

Changelist (in the order they appear in the "Files changed" tab):

  • Remove dependency on dateformat
  • Update e2e tests to test new functionality
  • Remove unneeded wrapper tags and classnames
  • Simplify project files errors component (visible when you try to create a project file with a name that already exists)
  • Use regex pattern in to find what filenames are okay rather than code
  • Add selection state of favorites and bulk delete/export
  • Add context menu on favorite for that allows for deleting/renaming/editing/duplicating/running

CleanShot 2021-02-09 at 12 42 21

Preview available at http://favorites_ux_refresh.surge.sh

if (!codeFontLigatures) {
wrapperClassNames.push('disable-font-ligatures')
}
const wrapperClassNames = codeFontLigatures ? '' : 'disable-font-ligatures'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixes a type error and maybe issue with disabled font ligatures

@@ -290,7 +290,6 @@ export function EditorFrame({
variables: {
projectId,
fileUpload: new File([editorValue], name),
destination: `./${name}`,
overwrite: true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not needed since we only save to root

${contents.join('\n')}`
: `// ${newName}
? `//${newName}
${NonNamecontents.join('\n')}`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Solves bug that added whitespace on rename

@@ -26,6 +26,22 @@ import { Folder } from 'shared/modules/favorites/foldersDuck'

export const CYPHER_FILE_EXTENSION = '.cypher'

export function exportFavoritesAsBigCypherFile(favorites: Favorite[]): void {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This feature has been requested, and the implementation works. But there's no UI element to call this function yet

e2e_tests/integration/saved-scripts.spec.ts Outdated Show resolved Hide resolved
@@ -26,6 +26,22 @@ import { Folder } from 'shared/modules/favorites/foldersDuck'

export const CYPHER_FILE_EXTENSION = '.cypher'

export function exportFavoritesAsBigCypherFile(favorites: Favorite[]): void {
const fileContent = favorites
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe a matter of taste, but I think a map and join is easier to read than a reduce and template literal

const fileContent = favorites
  .map((favorite) => favorite.content)
  .join("\n\n")
  .trim();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah it's clearer, thanks!

Copy link
Contributor

@HerrEmil HerrEmil left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<g>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think tab indentation is inconsistent with the other SVGs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm they seem to re-appear on save when I remove them. I'll look into it in another PR

@OskarDamkjaer OskarDamkjaer merged commit d5a47c8 into neo4j:master Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants