[Restricted Notebook] Creating new Restricted Notebook type (#5173)

* added/removed status for locked, will not work with current one status per domain object setup
* setting restricted right away based on nb type
* added confirmation dialog for locking a page

* Styling for restricted Notebook
- Markup, CSS and content changes for lock button and locked message.
- Removed "Note book Type" property from NotebookType.js.
* have a version of entry template that has no listeners for locked items
* cleaning up page and section components
* making sure basic notebook stuff is installed at least once
* updating data transfer values for locked page entries, fixing page and section selection from edits
* adding locked flag to search result entries
* fixing uneditable section/page names
* cleaning up updateName function for page/section names
* removing install of restricted notebook
* updating confirmation dialog
* updating tests for new export structur
- New symbols glyph and SVG for the Shift Log. IMPORTANT: OVERRIDE ANY MERGE CONFLICTS WITH THIS COMMIT!

* made create button items dynamic each time the button is clicked, this will pick up any new types added after the create menu is created

* removing dynamic create menu list

* found a way to add the plugin before openmct.start is called
* making create items dynamic to include types added after openmct is started
* more e2e tests for restricted notebook

* updates from PR reviews, also fixed error in mct-tree thrown by not checking for an element

* plain notebook tests

* More testcase definition

* actually removing notebook object to test

* removing dupes

* checking if agent exists before relying on it... it was breaking tests with errors

* updating for new browser agent code

* fixing linting errors

Co-authored-by: Charles Hacskaylo <charlesh88@gmail.com>
Co-authored-by: unlikelyzero <jchill2@gmail.com>
Co-authored-by: John Hill <john.c.hill@nasa.gov>
Co-authored-by: Andrew Henry <akhenry@gmail.com>
Co-authored-by: Shefali Joshi <simplyrender@gmail.com>
This commit is contained in:
Jamie V
2022-06-04 09:06:07 -07:00
committed by GitHub
parent 584d11a2ef
commit 9fbb695379
30 changed files with 1175 additions and 335 deletions

View File

@@ -23,6 +23,7 @@
<template>
<div
class="c-notebook__entry c-ne has-local-controls has-tag-applier"
:class="{ 'locked': isLocked }"
@dragover="changeCursor"
@drop.capture="cancelEditMode"
@drop.prevent="dropOnEntry"
@@ -53,12 +54,12 @@
/>
</div>
</template>
<template v-else>
<template v-else-if="!isLocked">
<div
:id="entry.id"
class="c-ne__text c-ne__input"
tabindex="0"
contenteditable
contenteditable="true"
@focus="editingEntry()"
@blur="updateEntryValue($event)"
@keydown.enter.exact.prevent
@@ -67,6 +68,18 @@
>
</div>
</template>
<template v-else>
<div
:id="entry.id"
class="c-ne__text"
contenteditable="false"
tabindex="0"
v-text="entry.text"
>
</div>
</template>
<TagEditor
:domain-object="domainObject"
:annotation-query="annotationQuery"
@@ -74,11 +87,13 @@
:annotation-search-type="openmct.objects.SEARCH_TYPES.NOTEBOOK_ANNOTATIONS"
:target-specific-details="{entryId: entry.id}"
/>
<div class="c-snapshots c-ne__embeds">
<NotebookEmbed
v-for="embed in entry.embeds"
:key="embed.id"
:embed="embed"
:is-locked="isLocked"
@removeEmbed="removeEmbed"
@updateEmbed="updateEmbed"
/>
@@ -86,7 +101,7 @@
</div>
</div>
<div
v-if="!readOnly"
v-if="!readOnly && !isLocked"
class="c-ne__local-controls--hidden"
>
<button
@@ -172,6 +187,12 @@ export default {
default() {
return true;
}
},
isLocked: {
type: Boolean,
default() {
return false;
}
}
},
computed: {
@@ -229,15 +250,21 @@ export default {
this.openmct.editor.cancel();
}
},
changeCursor() {
changeCursor(event) {
event.preventDefault();
event.dataTransfer.dropEffect = "copy";
if (!this.isLocked) {
event.dataTransfer.dropEffect = 'copy';
} else {
event.dataTransfer.dropEffect = 'none';
event.dataTransfer.effectAllowed = 'none';
}
},
deleteEntry() {
this.$emit('deleteEntry', this.entry.id);
},
async dropOnEntry($event) {
event.stopImmediatePropagation();
$event.stopImmediatePropagation();
const snapshotId = $event.dataTransfer.getData('openmct/snapshot/id');
if (snapshotId.length) {