Adding the data- prefix to the shared-item HTMLElements (#10888)

This commit is contained in:
Brandon Kobel 2017-04-05 08:03:46 -04:00 committed by GitHub
parent c09b69e432
commit 36f676cc2d
12 changed files with 21 additions and 21 deletions

View file

@ -78,7 +78,7 @@
toggle-expand="toggleExpandPanel"
create-child-ui-state="createChildUiState"
toggle-expand="toggleExpandPanel"
shared-items-count="{{panels.length}}"
data-shared-items-count="{{panels.length}}"
></dashboard-grid>
<dashboard-panel ng-if="hasExpandedPanel()"

View file

@ -47,7 +47,7 @@
search-source="savedObj.searchSource"
show-spy-panel="!isFullScreenMode"
ui-state="uiState"
shared-item
data-shared-item
data-title="{{savedObj.title}}"
data-description="{{savedObj.description}}"
render-counter
@ -60,7 +60,7 @@
search-source="savedObj.searchSource"
sorting="panel.sort"
columns="panel.columns"
shared-item
data-shared-item
data-title="{{savedObj.title}}"
data-description="{{savedObj.description}}"
render-counter

View file

@ -131,7 +131,7 @@
columns="state.columns"
infinite-scroll="true"
filter="filterQuery"
shared-item
data-shared-item
data-title="{{opts.savedSearch.lastSavedTitle}}"
data-description="{{opts.savedSearch.description}}"
render-counter

View file

@ -86,7 +86,7 @@
<div class="vis-editor-canvas" ng-if="!vis.type.fullEditor" ng-class="{ embedded: !chrome.getVisible() }">
<visualize
vis="vis"
shared-item
data-shared-item
data-title="{{savedVis.lastSavedTitle}}"
data-description="{{savedVis.description}}"
render-counter

View file

@ -23,18 +23,18 @@ describe('kbnGlobalTimepicker', function () {
const $el = compile();
expect($el.attr('data-test-subj')).to.be('globalTimepicker');
});
it('sets shared-timefilter to false when timefilter.enabled is false', function () {
it('sets data-shared-timefilter to false when timefilter.enabled is false', function () {
scope.timefilter = {
enabled: false
};
const $el = compile();
expect($el.attr('shared-timefilter')).to.eql('false');
expect($el.attr('data-shared-timefilter')).to.eql('false');
});
it('sets shared-timefilter to true when timefilter.enabled is true', function () {
it('sets data-shared-timefilter to true when timefilter.enabled is true', function () {
scope.timefilter = {
enabled: true
};
const $el = compile();
expect($el.attr('shared-timefilter')).to.eql('true');
expect($el.attr('data-shared-timefilter')).to.eql('true');
});
});

View file

@ -1,4 +1,4 @@
<div ng-show="timefilter.enabled" shared-timefilter="{{timefilter.enabled}}" class="kuiLocalMenu" data-test-subj="globalTimepicker">
<div ng-show="timefilter.enabled" data-shared-timefilter="{{timefilter.enabled}}" class="kuiLocalMenu" data-test-subj="globalTimepicker">
<div
class="kuiLocalMenuItem"
ng-click="toggleRefresh()"

View file

@ -104,16 +104,16 @@ bdd.it('retains dark theme in state', async function () {
expect(isDarkThemeOn).to.equal(true);
});
bdd.it('should have shared-items-count set to the number of visualizations', function checkSavedItemsCount() {
bdd.it('should have data-shared-items-count set to the number of visualizations', function checkSavedItemsCount() {
const visualizations = PageObjects.dashboard.getTestVisualizations();
return PageObjects.common.tryForTime(10000, () => PageObjects.dashboard.getSharedItemsCount())
.then(function (count) {
PageObjects.common.log('shared-items-count = ' + count);
PageObjects.common.log('data-shared-items-count = ' + count);
expect(count).to.eql(visualizations.length);
});
});
bdd.it('should have panels with expected shared-item title and description', function checkTitles() {
bdd.it('should have panels with expected data-shared-item title and description', function checkTitles() {
const visualizations = PageObjects.dashboard.getTestVisualizations();
return PageObjects.common.tryForTime(10000, function () {
return PageObjects.dashboard.getPanelSharedItemData()

View file

@ -226,8 +226,8 @@ bdd.describe('discover app', function describeIndexTests() {
});
bdd.describe('shared-item', function () {
bdd.it('should have correct shared-item title and description', async () => {
bdd.describe('data-shared-item', function () {
bdd.it('should have correct data-shared-item title and description', async () => {
const expected = {
title: 'A Saved Search',
description: 'A Saved Search Description'

View file

@ -13,9 +13,9 @@ bdd.describe('visualize app', function describeIndexTests() {
return PageObjects.common.navigateToApp('visualize');
});
bdd.describe('shared-item', function indexPatternCreation() {
bdd.describe('data-shared-item', function indexPatternCreation() {
bdd.it('should have the correct shared-item title and description', function () {
bdd.it('should have the correct data-shared-item title and description', function () {
const expected = {
title: 'Shared-Item Visualization AreaChart',
description: 'AreaChart'

View file

@ -346,7 +346,7 @@ export default class Common {
async getSharedItemTitleAndDescription() {
const element = await this.remote
.setFindTimeout(defaultFindTimeout)
.findByCssSelector('[shared-item]');
.findByCssSelector('[data-shared-item]');
return {
title: await element.getAttribute('data-title'),

View file

@ -411,7 +411,7 @@ export default class DashboardPage {
getSharedItemsCount() {
PageObjects.common.debug('in getSharedItemsCount');
const attributeName = 'shared-items-count';
const attributeName = 'data-shared-items-count';
return this.findTimeout
.findByCssSelector(`[${attributeName}]`)
.then(function (element) {
@ -429,7 +429,7 @@ export default class DashboardPage {
.findAllByCssSelector('li.gs-w')
.then(function (elements) {
return Promise.all(elements.map(async element => {
const sharedItem = await element.findByCssSelector('[shared-item]');
const sharedItem = await element.findByCssSelector('[data-shared-item]');
return {
title: await sharedItem.getAttribute('data-title'),
description: await sharedItem.getAttribute('data-description')

View file

@ -245,7 +245,7 @@ export default class HeaderPage {
async isSharedTimefilterEnabled() {
const element = await this.remote
.setFindTimeout(defaultFindTimeout)
.findByCssSelector(`[shared-timefilter=true]`);
.findByCssSelector(`[data-shared-timefilter=true]`);
return new Boolean(element);
}