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

feat: Add "Export" and "Duplicate" buttons in notes options menu. #688

Merged
merged 25 commits into from
Oct 19, 2021
Merged

feat: Add "Export" and "Duplicate" buttons in notes options menu. #688

merged 25 commits into from
Oct 19, 2021

Conversation

amanharwara
Copy link
Member

This PR:

  • Adds an "Export" button which saves selected notes
  • Adds a "Duplicate" button which duplicates selected notes
  • Moves EditorIdentifier enum to the common enums.ts file so it can be used to determine note format.

switch (editor.package_info.identifier) {
case EditorIdentifier.BoldEditor:
case EditorIdentifier.PlusEditor:
format = '.html';
Copy link
Member

Choose a reason for hiding this comment

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

I've just merged this PR so let's use the package_info file_type instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've made the change 👍 The tsc run on the PR will fail I guess till the snjs version is bumped.

Copy link
Member

@moughxyz moughxyz Oct 17, 2021

Choose a reason for hiding this comment

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

You can bump this to 1.7.0 when this run finishes: https://github.com/standardnotes/snjs/runs/3919286442

Copy link
Member Author

Choose a reason for hiding this comment

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

Run's still failing it seems.

Copy link
Member

Choose a reason for hiding this comment

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

I know what the issue is, needs a change in SNJS.

Copy link
Member

Choose a reason for hiding this comment

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

Btw you can run yarn build locally to make sure it compiles before pushing so that you don't have to wait for CI.

Copy link
Member

Choose a reason for hiding this comment

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

Merged to master: standardnotes/snjs@7a3e911

Copy link
Member Author

Choose a reason for hiding this comment

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

Hey @mobitar, the tsc run still seems to fail. Shows quite a few errors.

app/assets/javascripts/components/NotesOptions.tsx(129,46): error TS2339: Property 'file_type' does not exist on type 'ComponentPackageInfo'.
app/assets/javascripts/preferences/panes/Extensions.tsx(32,21): error TS2345: Argument of type 'import("/home/runner/work/web/web/node_modules/@standardnotes/snjs/node_modules/@standardnotes/features/dist/Domain/Feature/Feature").FeatureDescription[] | undefined' is not assignable to parameter of type 'import("/home/runner/work/web/web/node_modules/@standardnotes/features/dist/Domain/Feature/Feature").FeatureDescription[] | undefined'.

For the second one, import { FeatureDescription } from '@standardnotes/snjs/node_modules/@standardnotes/features' instead of import { FeatureDescription } from '@standardnotes/features' seems to stop that error.

Copy link
Member Author

Choose a reason for hiding this comment

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

In the yarn.lock file, there is both 1.6.2 of @standardnotes/features and 1.7.1:

"@standardnotes/[email protected]":
  version "1.6.2"
  resolved "https://registry.yarnpkg.com/@standardnotes/features/-/features-1.6.2.tgz#98c5998426d9f93e06c2846c5bc7b6aef8d31063"
  integrity sha512-s/rqRyG7mrrgxJOzckPSYlB68wsRpM9jlFwDE+7zQO5/xKh+37ueWfy3RoqOgkKLey6lMpnTurofIJCvqLM3dQ==
  dependencies:
    "@standardnotes/common" "^1.1.0"

"@standardnotes/[email protected]":
  version "1.7.1"
  resolved "https://registry.yarnpkg.com/@standardnotes/features/-/features-1.7.1.tgz#64285a1900114d685ae4c0c9781fd4da1498aba0"
  integrity sha512-ri96lAbYfKnmLz33MZLeMh4e+u5EMxCXotdEzUvUFXhgTfBwbeOI5chTPt8fEkv4CvUjCJa7Wk1btP/ALH0+OQ==
  dependencies:
    "@standardnotes/common" "^1.1.0"

Maybe this is causing the errors?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think standardnotes/snjs#459 will fix this.

@amanharwara amanharwara merged commit 3a4e250 into standardnotes:develop Oct 19, 2021
@amanharwara amanharwara deleted the feat/notes-options-actions branch October 19, 2021 15:43
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.

2 participants