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

5853 plot annotations prototype #6000

Merged
merged 87 commits into from Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from 84 commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
fdaaaaa
implement new search and tagging for notebooks
scottbell May 12, 2022
2db70bb
add example tags, remove inspector reference
scottbell May 12, 2022
95c8d15
include annotations in mct
scottbell May 12, 2022
fb4a5da
work with empty notebook entries
scottbell May 13, 2022
00db5a5
add inspector and plot annotations
scottbell May 13, 2022
a85bf54
fix conflicts
scottbell May 26, 2022
64e7b5a
merged
scottbell Sep 27, 2022
7adff3b
fix plot prototype with new annotations
scottbell Sep 28, 2022
3dbd08b
Merge remote-tracking branch 'origin/master' into mct4820-prototype
scottbell Sep 30, 2022
99bfc69
Merge remote-tracking branch 'origin/master' into mct4820-prototype
scottbell Oct 5, 2022
2cbf3a8
Merge remote-tracking branch 'origin/mct4820-prototype' into 5853-plo…
scottbell Oct 7, 2022
f567e52
clean up inspector for plots and other views
scottbell Oct 7, 2022
aa14cfe
bump webpack defaults for windows
scottbell Oct 11, 2022
e7bb0df
Merge remote-tracking branch 'origin/master' into 5853-plot-annotatio…
scottbell Nov 1, 2022
abad31a
annotations retrieved properly
scottbell Nov 2, 2022
dcf8ae6
Merge remote-tracking branch 'origin/master' into 5853-plot-annotatio…
scottbell Nov 7, 2022
018d981
wip
scottbell Nov 8, 2022
0e17826
Merge remote-tracking branch 'origin/master' into 5853-plot-annotatio…
scottbell Nov 9, 2022
dc95f7a
get rid of console debugging, allow for notebook entry selection
scottbell Nov 9, 2022
45a1508
notebook entry selection works
scottbell Nov 9, 2022
60735b9
add target specific details
scottbell Nov 9, 2022
854e4e4
most works for tagging
scottbell Nov 10, 2022
a3b8fa1
need to react to adds
scottbell Nov 10, 2022
23b89dc
Merge remote-tracking branch 'origin/master' into 5853-plot-annotatio…
scottbell Nov 17, 2022
f9c5d32
ignore tags on things we don't support
scottbell Nov 17, 2022
567f4f1
listen to new annotations
scottbell Nov 17, 2022
667adfd
check for null domain objects
scottbell Nov 21, 2022
6369465
notebook annotations work in inspector now
scottbell Nov 21, 2022
45dfb60
pass function for when tags change so notebook entry can timestamp
scottbell Nov 21, 2022
c690b5b
need to supress other selection event firing
scottbell Nov 21, 2022
9091747
no only getting one event
scottbell Nov 28, 2022
608712c
Merge remote-tracking branch 'origin/master' into 5853-plot-annotatio…
scottbell Dec 2, 2022
20be2a8
showing all tags for a given domain objects
scottbell Dec 2, 2022
ffa65f1
works in plots again
scottbell Dec 2, 2022
e523fe5
wip moving to multiple targets per annotations
scottbell Dec 3, 2022
94ebfee
hopefully now compatible with plots
scottbell Dec 5, 2022
df10af4
do not show annotations if nothing selected
scottbell Dec 5, 2022
1feb191
need to work on plots now
scottbell Dec 5, 2022
17d15ce
need to work on clicking
scottbell Dec 5, 2022
37029e8
try to draw rectangles
scottbell Dec 5, 2022
29a7761
allow selection of annotations
scottbell Dec 5, 2022
7aad7d6
selecting rectangles now work
scottbell Dec 5, 2022
4557d7f
Merge remote-tracking branch 'origin/master' into 5853-plot-annotatio…
scottbell Dec 6, 2022
2e7e36e
deal with multiple annotations
scottbell Dec 6, 2022
1430da8
displaying annotations properly now
scottbell Dec 6, 2022
a4ca5db
need to filter annotations
scottbell Dec 7, 2022
e687704
Merge remote-tracking branch 'origin/master' into 5853-plot-annotatio…
scottbell Dec 7, 2022
436f91b
close
scottbell Dec 7, 2022
8921dc8
now works across multiple series
scottbell Dec 7, 2022
f7c4846
make editing smarter
scottbell Dec 8, 2022
846c03e
only draw annotations if we haven't drawn them before
scottbell Dec 9, 2022
45d618a
only draw one unique bounding box
scottbell Dec 9, 2022
7a2a116
be more careful about deleting tags
scottbell Dec 9, 2022
ff1990d
Merge remote-tracking branch 'origin/master' into 5853-plot-annotatio…
scottbell Dec 12, 2022
d702333
performance improvements
scottbell Dec 12, 2022
10d6926
remove annotation text and perform plot zoom on search result
scottbell Dec 13, 2022
450029b
plot selection works
scottbell Dec 13, 2022
b2aa365
zoom out abit post selection
scottbell Dec 13, 2022
4720c4b
fix tests
scottbell Dec 13, 2022
c64dec9
Merge branch 'master' into 5853-plot-annotations-prototype
scottbell Dec 13, 2022
0279290
linting
scottbell Dec 13, 2022
0dfe563
adjust notebook tagging to accomodate inspector tags
scottbell Dec 14, 2022
8ae97b8
linting
scottbell Dec 14, 2022
ca741bd
short circuit annotations in plots if no tags are defined
scottbell Dec 14, 2022
36cda89
fix tests
scottbell Dec 14, 2022
3efb777
linting
scottbell Dec 14, 2022
14b353a
Merge branch 'master' into 5853-plot-annotations-prototype
scottbell Dec 16, 2022
8499882
just use the annotation create function
scottbell Dec 16, 2022
396aa13
update docs
scottbell Dec 19, 2022
73ce822
use undefined
scottbell Dec 19, 2022
ba892f3
get rid of console debug outputs
scottbell Dec 19, 2022
0fbaa6c
refactor to use identifier
scottbell Dec 19, 2022
9ea2375
resolve conflicts
scottbell Jan 5, 2023
e7b6ea4
Merge branch 'master' into 5853-plot-annotations-prototype
scottbell Jan 9, 2023
96c4702
resolve conflicts
scottbell Jan 18, 2023
16268a9
fix import with new webpack config
scottbell Jan 18, 2023
3fa3489
addressing pr comments
scottbell Jan 18, 2023
0cb483b
Merge branch 'master' into 5853-plot-annotations-prototype
scottbell Jan 19, 2023
1f4670b
fix tests
scottbell Jan 19, 2023
590e587
possible performance improvement
scottbell Jan 19, 2023
38a2bd3
move performance fix to MctChart
scottbell Jan 20, 2023
2d859c1
disable various annotation editing and selection in real time mode
scottbell Jan 20, 2023
3c66351
lint
scottbell Jan 20, 2023
2acea4f
Merge branch 'master' into 5853-plot-annotations-prototype
scottbell Jan 20, 2023
e4e7fad
only allow annotations if plot is paused or in fixed time. also do no…
scottbell Jan 20, 2023
9f9afc0
resolve conflicts
scottbell Jan 20, 2023
7c7e6a4
key off local events instead of remote
scottbell Jan 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions .webpack/webpack.common.js
Expand Up @@ -80,6 +80,7 @@ const config = {
projectRootDir,
"src/api/objects/object-utils.js"
),
"kdbush": path.join(projectRootDir, "node_modules/kdbush/kdbush.min.js"),
utils: path.join(projectRootDir, "src/utils")
}
},
Expand Down Expand Up @@ -167,8 +168,8 @@ const config = {
performance: {
// We should eventually consider chunking to decrease
// these values
maxEntrypointSize: 25000000,
maxAssetSize: 25000000
maxEntrypointSize: 27000000,
maxAssetSize: 27000000
}
};

Expand Down
5 changes: 2 additions & 3 deletions e2e/tests/functional/moveAndLinkObjects.e2e.spec.js
Expand Up @@ -51,7 +51,6 @@ test.describe('Move & link item tests', () => {

// Attempt to move parent to its own grandparent
await page.locator(`text=Open MCT ${myItemsFolderName} >> span`).nth(3).click();
await page.locator('.c-disclosure-triangle >> nth=0').click();

await page.locator(`a:has-text("Parent Folder") >> nth=0`).click({
button: 'right'
Expand All @@ -72,6 +71,7 @@ test.describe('Move & link item tests', () => {
await page.locator('[aria-label="Cancel"]').click();

// Move Child Folder from Parent Folder to My Items
await page.locator(`text=Open MCT ${myItemsFolderName} >> span`).nth(3).click();
await page.locator('.c-disclosure-triangle >> nth=0').click();
await page.locator('.c-disclosure-triangle >> nth=1').click();

Expand Down Expand Up @@ -166,8 +166,6 @@ test.describe('Move & link item tests', () => {

// Attempt to link parent to its own grandparent
await page.locator(`text=Open MCT ${myItemsFolderName} >> span`).nth(3).click();
await page.locator('.c-disclosure-triangle >> nth=0').click();

await page.locator(`a:has-text("Parent Folder") >> nth=0`).click({
button: 'right'
});
Expand All @@ -187,6 +185,7 @@ test.describe('Move & link item tests', () => {
await page.locator('[aria-label="Cancel"]').click();

// Link Child Folder from Parent Folder to My Items
await page.locator(`text=Open MCT ${myItemsFolderName} >> span`).nth(3).click();
await page.locator('.c-disclosure-triangle >> nth=0').click();
await page.locator('.c-disclosure-triangle >> nth=1').click();

Expand Down
19 changes: 11 additions & 8 deletions e2e/tests/functional/plugins/notebook/tags.e2e.spec.js
Expand Up @@ -57,12 +57,14 @@ async function createNotebookAndEntry(page, iterations = 1) {
*/
async function createNotebookEntryAndTags(page, iterations = 1) {
const notebook = await createNotebookAndEntry(page, iterations);
await page.locator('text=Annotations').click();

for (let iteration = 0; iteration < iterations; iteration++) {
// Hover and click "Add Tag" button
// Hover is needed here to "slow down" the actions while running in headless mode
await page.hover(`button:has-text("Add Tag") >> nth = ${iteration}`);
await page.locator(`button:has-text("Add Tag") >> nth = ${iteration}`).click();
await page.locator(`[aria-label="Notebook Entry"] >> nth = ${iteration}`).click();
await page.hover(`button:has-text("Add Tag")`);
await page.locator(`button:has-text("Add Tag")`).click();

// Click inside the tag search input
await page.locator('[placeholder="Type to select tag"]').click();
Expand All @@ -71,8 +73,8 @@ async function createNotebookEntryAndTags(page, iterations = 1) {

// Hover and click "Add Tag" button
// Hover is needed here to "slow down" the actions while running in headless mode
await page.hover(`button:has-text("Add Tag") >> nth = ${iteration}`);
await page.locator(`button:has-text("Add Tag") >> nth = ${iteration}`).click();
await page.hover(`button:has-text("Add Tag")`);
await page.locator(`button:has-text("Add Tag")`).click();
// Click inside the tag search input
await page.locator('[placeholder="Type to select tag"]').click();
// Select the "Science" tag
Expand All @@ -84,8 +86,10 @@ async function createNotebookEntryAndTags(page, iterations = 1) {

test.describe('Tagging in Notebooks @addInit', () => {
test('Can load tags', async ({ page }) => {

await createNotebookAndEntry(page);

await page.locator('text=Annotations').click();

await page.locator('button:has-text("Add Tag")').click();

await page.locator('[placeholder="Type to select tag"]').click();
Expand Down Expand Up @@ -126,13 +130,12 @@ test.describe('Tagging in Notebooks @addInit', () => {

test('Can delete tags', async ({ page }) => {
await createNotebookEntryAndTags(page);
await page.locator('[aria-label="Notebook Entries"]').click();
// Delete Driving
await page.hover('[aria-label="Tag"]:has-text("Driving")');
await page.locator('[aria-label="Tag"]:has-text("Driving") ~ .c-completed-tag-deletion').click();

await expect(page.locator('[aria-label="Notebook Entry"]')).toContainText("Science");
await expect(page.locator('[aria-label="Notebook Entry"]')).not.toContainText("Driving");
await expect(page.locator('[aria-label="Tags Inspector"]')).toContainText("Science");
await expect(page.locator('[aria-label="Tags Inspector"]')).not.toContainText("Driving");

await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('sc');
await expect(page.locator('[aria-label="Search Result"]')).not.toContainText("Driving");
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -41,6 +41,7 @@
"karma-sourcemap-loader": "0.3.8",
"karma-spec-reporter": "0.0.36",
"karma-webpack": "5.0.0",
"kdbush": "^3.0.0",
"location-bar": "3.0.1",
"lodash": "4.17.21",
"mini-css-extract-plugin": "2.7.2",
Expand Down
9 changes: 9 additions & 0 deletions src/MCT.js
Expand Up @@ -256,6 +256,15 @@ define([
});
});

/**
* MCT's annotation API that enables
* human-created comments and categorization linked to data products
* @type {module:openmct.AnnotationAPI}
* @memberof module:openmct.MCT#
* @name annotation
*/
this.annotation = new api.AnnotationAPI(this);

// Plugins that are installed by default
this.install(this.plugins.Plot());
this.install(this.plugins.TelemetryTable.default());
Expand Down