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

Document Archive #921

Merged
merged 21 commits into from
Apr 6, 2019
Merged

Document Archive #921

merged 21 commits into from
Apr 6, 2019

Conversation

tommoor
Copy link
Member

@tommoor tommoor commented Mar 18, 2019

  • Introduces "archive" functionality
  • Archive is available in the main sidebar
  • Archived documents can be restored or deleted
  • Archived documents cannot be edited or shared

TODO

  • Add more specs
  • Update API documentation
  • Ensure deleted drafts do not show to the rest of the team
  • Toast message confirmations
  • Redirect after archive
  • Handle case where restoring a document while parent document remains archived/deleted
  • Improve handling of nested documents
  • Final testing

@tommoor tommoor marked this pull request as ready for review April 6, 2019 20:40
isDraft,
} = document;
const neverUpdated = publishedAt === updatedAt;
let content;

if (deletedAt) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Made this logic easier to reason about

command: yarn lint
Copy link
Member Author

Choose a reason for hiding this comment

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

Just separating CI flow and lint into separate steps for clarity

@@ -72,16 +71,6 @@ class Layout extends React.Component<Props> {
this.redirectTo = homeUrl();
}

@keydown('e')
goToEdit(ev) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Moved to DocumentScene

@@ -94,6 +100,17 @@ class MainSidebar extends React.Component<Props> {
<Section>
<Collections onCreateCollection={this.handleCreateCollection} />
</Section>
<Section>
Copy link
Member Author

Choose a reason for hiding this comment

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

New menu item

this.redirectTo = duped.url;
this.props.ui.showToast('Document duplicated');
Copy link
Member Author

Choose a reason for hiding this comment

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

New toast messages after actions for clarity and consistency

@@ -121,7 +120,7 @@
"mobx-react": "^5.4.2",
"natural-sort": "^1.0.0",
"nodemailer": "^4.4.0",
"outline-icons": "^1.7.0",
"outline-icons": "^1.8.0-0",
Copy link
Member Author

Choose a reason for hiding this comment

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

New "Archive" icon

@@ -0,0 +1,11 @@
module.exports = {
Copy link
Member Author

Choose a reason for hiding this comment

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

New database column


// documentStructure can only be updated by one request at the time
const unlock = await asyncLock('testLock');
Copy link
Member Author

Choose a reason for hiding this comment

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

🔥 looks like this should have been using the same collection lock – updated.

if (match) {
if (!options.deleteDocument && !returnValue) returnValue = match;
Copy link
Member Author

Choose a reason for hiding this comment

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

Separated the code for managing the documentStructure and deleting / archiving individual docs


await this.destroy({ transaction, ...options });

events.add({ name: 'documents.delete', model: this });
Copy link
Member Author

Choose a reason for hiding this comment

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

New events for future audit log

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.

1 participant