Skip to content

Commit

Permalink
Linting and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
bjester committed Aug 5, 2022
1 parent e7b7215 commit b858c6d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,14 @@
id: this.nodeId,
target: this.nodeId,
position: RELATIVE_TREE_POSITIONS.RIGHT,
}).then((node) => {
ContentNode.waitForCopying([node.id])
.then(() => {
this.showSnackbar({
text: this.$tr('copiedSnackbar'),
actionText: this.$tr('undo'),
actionCallback: () => changeTracker.revert(),
}).then(() => changeTracker.cleanUp());
});
}).then(node => {
ContentNode.waitForCopying([node.id]).then(() => {
this.showSnackbar({
text: this.$tr('copiedSnackbar'),
actionText: this.$tr('undo'),
actionCallback: () => changeTracker.revert(),
}).then(() => changeTracker.cleanUp());
});
});
}),
trackAction(eventLabel) {
Expand All @@ -217,11 +216,8 @@
makeACopy: 'Make a copy',
copyToClipboard: 'Copy to clipboard',
remove: 'Remove',
undo: 'Undo',
cancel: 'Cancel',
creatingCopies: 'Copying...',
creatingClipboardCopies: 'Copying to clipboard...',
copiedSnackbar: 'Copy operation complete',
copiedToClipboardSnackbar: 'Copied to clipboard',
removedItems: 'Sent to trash',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@
},
},
methods: {
...mapActions(['showSnackbar', 'clearSnackbar']),
...mapActions(['showSnackbar']),
...mapActions(['setViewMode', 'addViewModeOverride', 'removeViewModeOverride']),
...mapActions('contentNode', [
'createContentNode',
Expand Down Expand Up @@ -638,7 +638,7 @@
position: RELATIVE_TREE_POSITIONS.RIGHT,
})
)
).then((nodes) => {
).then(nodes => {
this.clearSelections();
ContentNode.waitForCopying(nodes.map(n => n.id)).then(() => {
this.showSnackbar({
Expand Down Expand Up @@ -695,7 +695,6 @@
selectionCount:
'{topicCount, plural,\n =1 {# folder}\n other {# folders}}, {resourceCount, plural,\n =1 {# resource}\n other {# resources}}',
undo: 'Undo',
cancel: 'Cancel',
creatingCopies: 'Copying...',
copiedItems: 'Copy operation complete',
copiedItemsToClipboard: 'Copied to clipboard',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,14 @@
copyToClipboard: withChangeTracker(function(changeTracker) {
return this.copy({ node_id: this.copyNode.node_id, channel_id: this.copyNode.channel_id })
.then(() => {
this.$store.dispatch('showSnackbar', {
text: this.$tr('copiedToClipboard'),
// TODO: implement revert functionality for clipboard
// actionText: this.$tr('undo'),
// actionCallback: () => changeTracker.revert(),
}).then(() => changeTracker.cleanUp());
this.$store
.dispatch('showSnackbar', {
text: this.$tr('copiedToClipboard'),
// TODO: implement revert functionality for clipboard
// actionText: this.$tr('undo'),
// actionCallback: () => changeTracker.revert(),
})
.then(() => changeTracker.cleanUp());
})
.catch(error => {
this.$store.dispatch('showSnackbarSimple', this.$tr('copyFailed'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,3 @@ export function deployCurrentChannel(context) {
export function publishChannel(context, version_notes) {
return Channel.publish(context.state.currentChannelId, version_notes);
}

Original file line number Diff line number Diff line change
Expand Up @@ -1424,8 +1424,12 @@ export const ContentNode = new TreeResource({
*/
waitForCopying(ids) {
const observable = Dexie.liveQuery(() => {
return this.table.where('id').anyOf(ids).filter(node => !node[COPYING_FLAG]).toArray();
})
return this.table
.where('id')
.anyOf(ids)
.filter(node => !node[COPYING_FLAG])
.toArray();
});

return new Promise((resolve, reject) => {
const subscription = observable.subscribe({
Expand All @@ -1438,10 +1442,10 @@ export const ContentNode = new TreeResource({
error() {
subscription.unsubscribe();
reject();
}
},
});
});
}
},
});

export const ChannelSet = new Resource({
Expand Down

0 comments on commit b858c6d

Please sign in to comment.