-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix(#7524): Open in New Tab action from a sub-object in a layout #7542
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7542 +/- ##
==========================================
+ Coverage 53.96% 55.38% +1.41%
==========================================
Files 672 672
Lines 27003 26996 -7
Branches 2624 2626 +2
==========================================
+ Hits 14572 14951 +379
+ Misses 11712 11326 -386
Partials 719 719
... and 67 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
@@ -19,7 +19,7 @@ | |||
this source code distribution or the Licensing information page available | |||
at runtime from the About dialog for additional information. | |||
--> | |||
<!DOCTYPE html> | |||
<!doctype html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep
src/tools/urlSpec.js
Outdated
@@ -65,15 +65,5 @@ describe('the url tool', function () { | |||
const constructedURL = objectPathToUrl(openmct, mockObjectPath); | |||
expect(constructedURL).toContain('#/browse/mock-parent-folder/mock-folder'); | |||
}); | |||
it('can take params to set a custom url', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have precise coverage for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code this tested was removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JK. it's back now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far. Let's take the time to understand what this means (from freecodecamp)
Know When to Use aria-describedby
Sometimes, we need to give more information to an element. For example, we might want to tell the user that the button they will press will open a new tab.This information is important because the user needs to know where they are when navigating websites.
For these types of scenarios, we can use aria-describedby to give additional information.
Example:
⛔ BAD
<button aria-label="Close" aria-label="Opens in a new tab">
Show related
</button>
✅ GOOD
<button aria-label="Close" aria-describedby="description">
Show related
</button>
<div id="description">Opens in a new tab</div>
In the first example above, what engineers expect the screen reader to announce is: “button, Show related, opens in a new tab”.
But the screen reader does not do that. Instead, it says,“button, opens in a new tab”. The screen reader does not read the content inside, because aria-label always overrides the text content of the HTML5 element it has been applied to.
The second code snipped shows the correct way to use aria-describedby. The screen reader will read, “button, Show related, opens in a new tab”.
That information tells the user that the button is to show related content and if they press that button, it will navigate them to another tab.
Takeaway: Use aria-describedby to add additional information to elements.
await expect(page.locator('.itc-popout')).toBeInViewport(); | ||
|
||
await setTimeBounds(page, startDate, endDate); | ||
await setTimeBounds(page, start, end); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setTimeBoundsOfITC ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems like it was designed to work for any time conductor? idk, I think all of these methods need an overhaul. not in this PR though.
@@ -174,6 +174,6 @@ test.describe('AppActions', () => { | |||
type: 'Folder' | |||
}); | |||
await openObjectTreeContextMenu(page, folder.url); | |||
await expect(page.getByLabel('Menu')).toBeVisible(); | |||
await expect(page.getByLabel(`${folder.name} Context Menu`)).toBeVisible(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
woah
e2e/tests/functional/plugins/displayLayout/displayLayout.e2e.spec.js
Outdated
Show resolved
Hide resolved
await newPage.waitForLoadState('domcontentloaded'); | ||
|
||
// Verify that the global time conductor bounds in the new page match the updated global bounds | ||
expect( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok this makes sense
:class="action.cssClass" | ||
:title="action.description" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we may want to keep titles, just not use them for tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally this is true, but in this case the title was basically pointless. The same contents are displayed on the right and read aloud by the screen reader. The title in this particular case served no purpose
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just two comments
Have a few more changes after talking to @davetsay . Moving back to draft for now |
- dataVisualization logic has moved from MMGIS plugin to the open source. As such, we can just use the time conductor bounds
This reverts commit 87aef35.
Looking good so far, @ozyx . @unlikelyzero must be losing his mind over this one. |
@@ -260,7 +260,7 @@ export default { | |||
event.preventDefault(); | |||
this.preview(this.objectPath); | |||
} else { | |||
const resultUrl = identifierToString(this.openmct, this.objectPath); | |||
const resultUrl = objectPathToUrl(this.openmct, this.objectPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right! we had a default export in addition to named exports in that file... scary
@@ -121,7 +121,8 @@ export default { | |||
}; | |||
const newTabAction = this.openmct.actions.getAction('newTab'); | |||
// No view context needed, so pass undefined. | |||
// The urlParams arg will override the global time bounds with the dataviz plot bounds. | |||
// The urlParams arg will override the global time bounds with the data visualization |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one question / potential change. and I'm going to smoke test this before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work.
Closes #7524
Closes #6982
Describe your changes:
.visibility-hidden
global utility CSS class for providing accessible descriptions for screen-readers without affecting the viewAll Submissions:
Author Checklist
type:
label? Note: this is not necessarily the same as the original issue.Reviewer Checklist