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

Plots correctly use configuration set on the parent if they can't their own #7770

Merged
merged 13 commits into from
Jul 16, 2024

Conversation

shefalijoshi
Copy link
Contributor

@shefalijoshi shefalijoshi commented Jul 5, 2024

Closes #7771

Describe your changes:

For telemetry that cannot have it's own configuration, ensure that it is correct initialized by the parent.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Is this a notable change that will require a special callout in the release notes? For example, will this break compatibility with existing APIs or projects that consume these plugins?

Author Checklist

  • Changes address original issue?
  • Tests included and/or updated with changes?
  • Has this been smoke tested?
  • Have you associated this PR with a type: label? Note: this is not necessarily the same as the original issue.
  • Have you associated a milestone with this PR? Note: leave blank if unsure.
  • Testing instructions included in associated issue OR is this a dependency/testcase change?

Reviewer Checklist

  • Changes appear to address issue?
  • Reviewer has tested changes by following the provided instructions?
  • Changes appear not to be breaking changes?
  • Appropriate automated tests included?
  • Code style and in-line documentation are appropriate?

@shefalijoshi shefalijoshi requested a review from akhenry July 5, 2024 19:10
Copy link

codecov bot commented Jul 5, 2024

Codecov Report

Attention: Patch coverage is 60.37736% with 21 lines in your changes missing coverage. Please review.

Project coverage is 56.70%. Comparing base (6983148) to head (ce1443f).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7770      +/-   ##
==========================================
- Coverage   56.95%   56.70%   -0.26%     
==========================================
  Files         673      673              
  Lines       27177    27225      +48     
  Branches     2636     2663      +27     
==========================================
- Hits        15479    15437      -42     
- Misses      11367    11447      +80     
- Partials      331      341      +10     
Flag Coverage Δ
e2e-full 23.57% <ø> (-18.23%) ⬇️
e2e-stable 60.69% <ø> (+0.05%) ⬆️
unit 49.30% <60.37%> (+0.04%) ⬆️
Files Coverage Δ
src/plugins/charts/bar/inspector/SeriesOptions.vue 73.33% <ø> (ø)
src/plugins/plot/inspector/forms/YAxisForm.vue 50.00% <ø> (ø)
src/plugins/plot/stackedPlot/StackedPlotItem.vue 36.23% <ø> (+8.69%) ⬆️
src/ui/inspector/InspectorTabs.vue 100.00% <ø> (ø)
src/plugins/plot/inspector/PlotOptionsEdit.vue 57.57% <33.33%> (-1.80%) ⬇️
src/plugins/plot/inspector/PlotOptionsItem.vue 75.00% <25.00%> (-7.15%) ⬇️
src/plugins/plot/inspector/forms/SeriesForm.vue 38.23% <62.50%> (+2.29%) ⬆️
src/plugins/plot/inspector/PlotOptionsBrowse.vue 83.00% <65.78%> (-10.55%) ⬇️

... and 8 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6983148...ce1443f. Read the comment docs.

Copy link
Collaborator

@unlikelyzero unlikelyzero left a comment

Choose a reason for hiding this comment

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

I have most of my fixes on this branch

e2e/tests/functional/plugins/plot/plotActions.js Outdated Show resolved Hide resolved
.getByRole('list', { name: 'Plot Series Properties' })
.locator('[title="Alarm Markers"]>div')
.nth(1)
).toContainText('Disabled');
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should find a better way of locating this element without using the locator method, nth, or title locators.

Ideally, this assertion should look like this:

await expect(await page.getByRole('listitem', { name: object.name }).getByLabel('Alarm Marker's).toContainText('Disabled')

@@ -27,6 +27,14 @@ async function turnOffAutoscale(page) {
await page.getByRole('checkbox', { name: 'Auto scale' }).uncheck();
}

async function turnOffAlarmMarkers(page) {
Copy link
Collaborator

@unlikelyzero unlikelyzero Jul 9, 2024

Choose a reason for hiding this comment

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

we should remove this.

Tests should be more readable with

await page.getByLabel('Alarm Markers').uncheck();

@@ -39,19 +39,23 @@ test.describe('Stacked Plot', () => {
await page.goto('./', { waitUntil: 'domcontentloaded' });

stackedPlot = await createDomainObjectWithDefaults(page, {
type: 'Stacked Plot'
type: 'Stacked Plot',
name: 'Stacked Plot'
Copy link
Collaborator

Choose a reason for hiding this comment

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

added names to be explicit in the selection of objects

await page.getByRole('tab', { name: 'Config' }).click();

// Click on canvas for the 1st plot
await page.getByLabel(`Stacked Plot Item ${swgA.name}`).click();
Copy link
Collaborator

Choose a reason for hiding this comment

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

updated this to use the getByLabel method, directly

await page.getByLabel('Expand Sine Wave Generator').click();

// turn off alarm markers. Technically there should be a getBy locator to ensure we're selecting the correct alarm marker
await page.getByLabel('Alarm Markers').uncheck();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Technically this should be a chained getBy locator to ensure we're selecting the correct alarm marker

@@ -21,7 +21,7 @@
-->
<template>
<div v-if="loaded" class="js-plot-options-browse">
<ul v-if="!isStackedPlotObject" class="c-tree" aria-label="Plot Series Properties">
Copy link
Collaborator

Choose a reason for hiding this comment

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

aria labels implies interactivity. This is not an interactive component

>
<h2 class="--first" title="Legend options">Legend</h2>
<legend-form class="grid-properties" :legend="config.legend" />
<legend-form role="treeitem" tabindex="0" class="grid-properties" :legend="config.legend" />
Copy link
Collaborator

Choose a reason for hiding this comment

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

allow users to tab to this component

<span
class="c-disclosure-triangle is-enabled flex-elem"
:class="expandedCssClass"
role="button"
:aria-label="ariaLabelValue"
tabindex="0"
Copy link
Collaborator

Choose a reason for hiding this comment

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

same as above

@@ -28,8 +28,10 @@
role="tab"
class="c-inspector__tab c-tab"
:class="{ 'is-current': isSelected(tab) }"
tabindex="0"
Copy link
Collaborator

Choose a reason for hiding this comment

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

this allows us to tab to the plot series expand/collapse component

Copy link
Collaborator

@unlikelyzero unlikelyzero left a comment

Choose a reason for hiding this comment

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

I've updated this the best I could. This is likely to cause some lateral test failure based on the locator changes. Should be easy to address.

@unlikelyzero unlikelyzero requested a review from ozyx July 9, 2024 03:34
page
.getByTitle('Display markers visually denoting points in alarm.')
.getByRole('cell', { name: 'Disabled' })
).toBeVisible();
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a chained locator which leverages Titles

@@ -84,10 +88,15 @@
</li>
<li class="grid-row">
<div class="grid-cell label" title="Display markers visually denoting points in alarm.">
Alarm Markers
<label for="alarm-markers-checkbox">Alarm Markers</label>
Copy link
Collaborator

Choose a reason for hiding this comment

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

@ozyx here's an attempt at using labels and ids

Copy link
Contributor

Choose a reason for hiding this comment

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

what happens in the case of an overlay plot with multiple series to configure?

@akhenry
Copy link
Contributor

akhenry commented Jul 10, 2024

@shefalijoshi Looks good to me, thank you. Glad it was a relatively small code change.

Copy link
Contributor

@akhenry akhenry left a comment

Choose a reason for hiding this comment

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

Just need to sort out the tests and this can be merged.

@@ -21,7 +21,7 @@
-->
<template>
<ul>
<li class="c-tree__item menus-to-left" :class="aliasCss">
<li class="c-tree__item menus-to-left" :class="aliasCss" role="treeitem">
Copy link
Contributor

Choose a reason for hiding this comment

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

this probably will break some tests (for good reason), i think the only other thing that has treeitem role is the main tree. but this seems like the right role for this to have

@@ -21,7 +21,7 @@
-->
<template>
<div v-if="loaded" class="js-plot-options-browse">
<ul v-if="!isStackedPlotObject" class="c-tree" aria-label="Plot Series Properties">
<ul v-if="!isStackedPlotObject" class="c-tree" role="tree">
Copy link
Contributor

Choose a reason for hiding this comment

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

nice

@@ -122,8 +122,11 @@ export default {
'grid-lines',
'plot-y-tick-width'
],
mounted() {
beforeMount() {
// We must do this before mounted to use any series configuration options set at the stacked plot level
Copy link
Contributor

@ozyx ozyx Jul 10, 2024

Choose a reason for hiding this comment

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

y tho? is it because something happens to the configStore when the parent mounts?

@ozyx ozyx added this to the Target:4.0.0 milestone Jul 16, 2024
@ozyx ozyx added the pr:e2e:couchdb npm run test:e2e:couchdb label Jul 16, 2024
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Jul 16, 2024
@ozyx ozyx requested a review from akhenry July 16, 2024 17:15
@unlikelyzero unlikelyzero dismissed akhenry’s stale review July 16, 2024 17:50

tests are fixed

@unlikelyzero unlikelyzero merged commit db808b4 into master Jul 16, 2024
28 of 30 checks passed
@unlikelyzero unlikelyzero deleted the fix-stackedplots-config branch July 16, 2024 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Properties of stacked plot series that aren't mutable don't get applied
4 participants