fix keyboard navigation in assinedTo and watchers lightbox
parent
0b4d265686
commit
b906cfe02a
|
@ -89,34 +89,34 @@ class LightboxKeyboardNavigationService extends taiga.Service
|
||||||
docEl.off(".keyboard-navigation")
|
docEl.off(".keyboard-navigation")
|
||||||
|
|
||||||
dispatch: ($el, code) ->
|
dispatch: ($el, code) ->
|
||||||
activeElement = $el.find(".active")
|
activeElement = $el.find(".selected")
|
||||||
|
|
||||||
# Key: enter
|
# Key: enter
|
||||||
if code == 13
|
if code == 13
|
||||||
if $el.find(".watcher-single").length == 1
|
if $el.find(".user-list-single").length == 1
|
||||||
$el.find('.watcher-single:first').trigger("click")
|
$el.find('.user-list-single:first').trigger("click")
|
||||||
else
|
else
|
||||||
activeElement.trigger("click")
|
activeElement.trigger("click")
|
||||||
|
|
||||||
# Key: down
|
# Key: down
|
||||||
else if code == 40
|
else if code == 40
|
||||||
if not activeElement.length
|
if not activeElement.length
|
||||||
$el.find('.watcher-single:first').addClass('active')
|
$el.find('.user-list-single:not(".is-active"):first').addClass('selected')
|
||||||
else
|
else
|
||||||
next = activeElement.next('.watcher-single')
|
next = activeElement.next('.user-list-single')
|
||||||
if next.length
|
if next.length
|
||||||
activeElement.removeClass('active')
|
activeElement.removeClass('selected')
|
||||||
next.addClass('active')
|
next.addClass('selected')
|
||||||
# Key: up
|
# Key: up
|
||||||
else if code == 38
|
else if code == 38
|
||||||
if not activeElement.length
|
if not activeElement.length
|
||||||
$el.find('.watcher-single:last').addClass('active')
|
$el.find('.user-list-single:last').addClass('selected')
|
||||||
else
|
else
|
||||||
prev = activeElement.prev('.watcher-single')
|
prev = activeElement.prev('.user-list-single:not(".is-active")')
|
||||||
|
|
||||||
if prev.length
|
if prev.length
|
||||||
activeElement.removeClass('active')
|
activeElement.removeClass('selected')
|
||||||
prev.addClass('active')
|
prev.addClass('selected')
|
||||||
|
|
||||||
init: ($el) ->
|
init: ($el) ->
|
||||||
@stop()
|
@stop()
|
||||||
|
|
|
@ -31,9 +31,12 @@
|
||||||
@extend %user-list;
|
@extend %user-list;
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
.user-list-single {
|
.user-list-single {
|
||||||
&:hover {
|
&:hover,
|
||||||
|
&.selected {
|
||||||
background: lighten($primary, 58%);
|
background: lighten($primary, 58%);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
&:hover {
|
||||||
transition: background .3s linear;
|
transition: background .3s linear;
|
||||||
transition-delay: .2s;
|
transition-delay: .2s;
|
||||||
}
|
}
|
||||||
|
@ -48,7 +51,7 @@
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 1rem;
|
right: 1rem;
|
||||||
top: 1.3rem;
|
top: 1.5rem;
|
||||||
transition: opacity .2s ease-in;
|
transition: opacity .2s ease-in;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -471,9 +471,12 @@
|
||||||
width: 600px;
|
width: 600px;
|
||||||
}
|
}
|
||||||
.user-list-single {
|
.user-list-single {
|
||||||
&:hover {
|
&:hover,
|
||||||
|
&.selected {
|
||||||
background: lighten($primary, 58%);
|
background: lighten($primary, 58%);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
&:hover {
|
||||||
transition: background .3s linear;
|
transition: background .3s linear;
|
||||||
transition-delay: .2s;
|
transition-delay: .2s;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,9 +32,9 @@ describe('Issue detail', async function(){
|
||||||
|
|
||||||
it('status edition', utils.detail.statusTesting);
|
it('status edition', utils.detail.statusTesting);
|
||||||
|
|
||||||
it('assigned to edition', utils.detail.assignedToTesting);
|
describe('assigned to edition', utils.detail.assignedToTesting);
|
||||||
|
|
||||||
it('watchers edition', utils.detail.watchersTesting);
|
describe('watchers edition', utils.detail.watchersTesting);
|
||||||
|
|
||||||
it('history', utils.detail.historyTesting);
|
it('history', utils.detail.historyTesting);
|
||||||
|
|
||||||
|
|
|
@ -34,9 +34,9 @@ describe('Task detail', function(){
|
||||||
|
|
||||||
it('status edition', utils.detail.statusTesting);
|
it('status edition', utils.detail.statusTesting);
|
||||||
|
|
||||||
it('assigned to edition', utils.detail.assignedToTesting);
|
describe('assigned to edition', utils.detail.assignedToTesting);
|
||||||
|
|
||||||
it('watchers edition', utils.detail.watchersTesting);
|
describe('watchers edition', utils.detail.watchersTesting);
|
||||||
|
|
||||||
it('iocaine edition', async function() {
|
it('iocaine edition', async function() {
|
||||||
// Toggle iocaine status
|
// Toggle iocaine status
|
||||||
|
|
|
@ -33,7 +33,7 @@ describe('User story detail', function(){
|
||||||
|
|
||||||
it('status edition', utils.detail.statusTesting);
|
it('status edition', utils.detail.statusTesting);
|
||||||
|
|
||||||
it('assigned to edition', utils.detail.assignedToTesting);
|
describe('assigned to edition', utils.detail.assignedToTesting);
|
||||||
|
|
||||||
it('team requirement edition', async function() {
|
it('team requirement edition', async function() {
|
||||||
let requirementHelper = usDetailHelper.teamRequirement();
|
let requirementHelper = usDetailHelper.teamRequirement();
|
||||||
|
@ -65,7 +65,7 @@ describe('User story detail', function(){
|
||||||
expect(isRequired).to.be.equal(newIsRequired);
|
expect(isRequired).to.be.equal(newIsRequired);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('watchers edition', utils.detail.watchersTesting);
|
describe('watchers edition', utils.detail.watchersTesting);
|
||||||
|
|
||||||
it('history', utils.detail.historyTesting);
|
it('history', utils.detail.historyTesting);
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,15 @@ helper.assignToLightbox = function() {
|
||||||
},
|
},
|
||||||
getName: function(item) {
|
getName: function(item) {
|
||||||
return el.$$('div[data-user-id] .user-list-name').get(item).getText();
|
return el.$$('div[data-user-id] .user-list-name').get(item).getText();
|
||||||
|
},
|
||||||
|
getNames: function() {
|
||||||
|
return el.$$('.user-list-name').getText();
|
||||||
|
},
|
||||||
|
filter: function(text) {
|
||||||
|
return el.$('input').sendKeys(text);
|
||||||
|
},
|
||||||
|
userList: function() {
|
||||||
|
return el.$$('.user-list-single');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,6 @@ helper.assignedTo = function() {
|
||||||
|
|
||||||
let obj = {
|
let obj = {
|
||||||
el: el,
|
el: el,
|
||||||
|
|
||||||
clear: async function() {
|
clear: async function() {
|
||||||
await browser.actions().mouseMove(el).perform();
|
await browser.actions().mouseMove(el).perform();
|
||||||
|
|
||||||
|
@ -124,15 +123,12 @@ helper.assignedTo = function() {
|
||||||
await browser.waitForAngular();
|
await browser.waitForAngular();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
assign: function() {
|
assign: function() {
|
||||||
el.$('.user-assigned').click();
|
el.$('.user-assigned').click();
|
||||||
},
|
},
|
||||||
|
|
||||||
getUserName: function() {
|
getUserName: function() {
|
||||||
return el.$('.user-assigned').getText();
|
return el.$('.user-assigned').getText();
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
|
@ -422,8 +418,16 @@ helper.watchersLightbox = function() {
|
||||||
},
|
},
|
||||||
getFirstName: function() {
|
getFirstName: function() {
|
||||||
return el.$$('.lightbox .ticket-watchers div[data-user-id]').first().getText();
|
return el.$$('.lightbox .ticket-watchers div[data-user-id]').first().getText();
|
||||||
}
|
},
|
||||||
|
getNames: function() {
|
||||||
|
return el.$$('.user-list-name').getText();
|
||||||
|
},
|
||||||
|
filter: function(text) {
|
||||||
|
return el.$('input').sendKeys(text);
|
||||||
|
},
|
||||||
|
userList: function() {
|
||||||
|
return el.$$('.user-list-single');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
|
|
|
@ -70,17 +70,84 @@ helper.statusTesting = async function() {
|
||||||
expect(newGenericStatus).to.be.not.equal(genericStatus);
|
expect(newGenericStatus).to.be.not.equal(genericStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
helper.assignedToTesting = async function() {
|
helper.assignedToTesting = function() {
|
||||||
let assignedTo = detailHelper.assignedTo();
|
before(function () {
|
||||||
let assignToLightbox = commonHelper.assignToLightbox();
|
let assignedTo = detailHelper.assignedTo();
|
||||||
let userName = detailHelper.assignedTo().getUserName();
|
return assignedTo.clear();
|
||||||
await assignedTo.clear();
|
})
|
||||||
assignedTo.assign();
|
|
||||||
await assignToLightbox.waitOpen();
|
it('assign', async function() {
|
||||||
assignToLightbox.selectFirst();
|
let assignedTo = detailHelper.assignedTo();
|
||||||
await assignToLightbox.waitClose();
|
let assignToLightbox = commonHelper.assignToLightbox();
|
||||||
let newUserName = assignedTo.getUserName();
|
let userName = detailHelper.assignedTo().getUserName();
|
||||||
expect(newUserName).to.be.not.equal(userName);
|
|
||||||
|
assignedTo.assign();
|
||||||
|
|
||||||
|
await assignToLightbox.waitOpen();
|
||||||
|
|
||||||
|
assignToLightbox.selectFirst();
|
||||||
|
|
||||||
|
await assignToLightbox.waitClose();
|
||||||
|
|
||||||
|
let newUserName = assignedTo.getUserName();
|
||||||
|
|
||||||
|
expect(newUserName).to.be.not.equal(userName);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('unassign', async function() {
|
||||||
|
let assignedTo = detailHelper.assignedTo();
|
||||||
|
let assignToLightbox = commonHelper.assignToLightbox();
|
||||||
|
|
||||||
|
await assignedTo.clear();
|
||||||
|
|
||||||
|
let newUserName = await assignedTo.getUserName();
|
||||||
|
|
||||||
|
expect(newUserName).to.be.equal('Not assigned');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('filter', async function () {
|
||||||
|
let assignedTo = detailHelper.assignedTo();
|
||||||
|
let assignToLightbox = commonHelper.assignToLightbox();
|
||||||
|
|
||||||
|
assignedTo.assign();
|
||||||
|
|
||||||
|
await assignToLightbox.waitOpen();
|
||||||
|
|
||||||
|
let names = await assignToLightbox.getNames();
|
||||||
|
|
||||||
|
await assignToLightbox.filter(names[0]);
|
||||||
|
|
||||||
|
let newNames = await assignToLightbox.getNames();
|
||||||
|
|
||||||
|
expect(newNames).to.have.length(1);
|
||||||
|
|
||||||
|
assignToLightbox.selectFirst();
|
||||||
|
|
||||||
|
await assignToLightbox.waitClose();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('keyboard navigatin', async function() {
|
||||||
|
let assignedTo = detailHelper.assignedTo();
|
||||||
|
let assignToLightbox = commonHelper.assignToLightbox();
|
||||||
|
|
||||||
|
assignedTo.assign();
|
||||||
|
|
||||||
|
await assignToLightbox.waitOpen();
|
||||||
|
|
||||||
|
browser
|
||||||
|
.actions()
|
||||||
|
.sendKeys(protractor.Key.ARROW_DOWN)
|
||||||
|
.sendKeys(protractor.Key.ARROW_DOWN)
|
||||||
|
.sendKeys(protractor.Key.ARROW_DOWN)
|
||||||
|
.sendKeys(protractor.Key.ARROW_UP)
|
||||||
|
.perform();
|
||||||
|
|
||||||
|
let selected = assignToLightbox.userList().get(2);
|
||||||
|
|
||||||
|
let isSelected = await commonUtil.hasClass(selected, 'selected');
|
||||||
|
|
||||||
|
expect(isSelected).to.be.true;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
helper.historyTesting = async function() {
|
helper.historyTesting = async function() {
|
||||||
|
@ -188,30 +255,83 @@ helper.deleteTesting = async function() {
|
||||||
await deleteHelper.delete();
|
await deleteHelper.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
helper.watchersTesting = async function() {
|
helper.watchersTesting = function() {
|
||||||
let watchersHelper = detailHelper.watchers();
|
before(function () {
|
||||||
await watchersHelper.removeAllWatchers();
|
let watchersHelper = detailHelper.watchers();
|
||||||
|
return watchersHelper.removeAllWatchers();
|
||||||
|
})
|
||||||
|
|
||||||
let watchersLightboxHelper = detailHelper.watchersLightbox();
|
it('add watcher', async function() {
|
||||||
let userNames = await watchersHelper.getWatchersUserNames();
|
let watchersHelper = detailHelper.watchers();
|
||||||
|
let watchersLightboxHelper = detailHelper.watchersLightbox();
|
||||||
|
let userNames = await watchersHelper.getWatchersUserNames();
|
||||||
|
|
||||||
//Add watcher
|
await watchersHelper.addWatcher();
|
||||||
await watchersHelper.addWatcher();
|
await watchersLightboxHelper.waitOpen();
|
||||||
await watchersLightboxHelper.waitOpen();
|
|
||||||
let newWatcherName = await watchersLightboxHelper.getFirstName();
|
|
||||||
await watchersLightboxHelper.selectFirst();
|
|
||||||
await watchersLightboxHelper.waitClose();
|
|
||||||
|
|
||||||
let newUserNames = await watchersHelper.getWatchersUserNames();
|
let newWatcherName = await watchersLightboxHelper.getFirstName();
|
||||||
|
|
||||||
await userNames.push(newWatcherName);
|
await watchersLightboxHelper.selectFirst();
|
||||||
|
await watchersLightboxHelper.waitClose();
|
||||||
|
|
||||||
expect(newUserNames.join(',')).to.be.equal(userNames.join(','));
|
let newUserNames = await watchersHelper.getWatchersUserNames();
|
||||||
|
|
||||||
//Clear watchers
|
await userNames.push(newWatcherName);
|
||||||
await watchersHelper.removeAllWatchers();
|
|
||||||
newUserNames = await watchersHelper.getWatchersUserNames();
|
expect(newUserNames.join(',')).to.be.equal(userNames.join(','));
|
||||||
expect(newUserNames.join()).to.be.equal('');
|
});
|
||||||
|
|
||||||
|
it('clear watcher', async function() {
|
||||||
|
let watchersHelper = detailHelper.watchers();
|
||||||
|
|
||||||
|
await watchersHelper.removeAllWatchers();
|
||||||
|
|
||||||
|
let newUserNames = await watchersHelper.getWatchersUserNames();
|
||||||
|
|
||||||
|
expect(newUserNames.join()).to.be.equal('');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('filter watcher', async function () {
|
||||||
|
let watchersHelper = detailHelper.watchers();
|
||||||
|
let watchersLightboxHelper = detailHelper.watchersLightbox();
|
||||||
|
let userNames = await watchersHelper.getWatchersUserNames();
|
||||||
|
|
||||||
|
await watchersHelper.addWatcher();
|
||||||
|
await watchersLightboxHelper.waitOpen();
|
||||||
|
|
||||||
|
let names = await watchersLightboxHelper.getNames();
|
||||||
|
|
||||||
|
await watchersLightboxHelper.filter(names[0]);
|
||||||
|
|
||||||
|
let newNames = await watchersLightboxHelper.getNames();
|
||||||
|
|
||||||
|
expect(newNames).to.have.length(1);
|
||||||
|
|
||||||
|
await watchersLightboxHelper.selectFirst();
|
||||||
|
await watchersLightboxHelper.waitClose();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('keyboard navigatin', async function() {
|
||||||
|
let watchersHelper = detailHelper.watchers();
|
||||||
|
let watchersLightboxHelper = detailHelper.watchersLightbox();
|
||||||
|
|
||||||
|
await watchersHelper.addWatcher();
|
||||||
|
await watchersLightboxHelper.waitOpen();
|
||||||
|
|
||||||
|
browser
|
||||||
|
.actions()
|
||||||
|
.sendKeys(protractor.Key.ARROW_DOWN)
|
||||||
|
.sendKeys(protractor.Key.ARROW_DOWN)
|
||||||
|
.sendKeys(protractor.Key.ARROW_DOWN)
|
||||||
|
.sendKeys(protractor.Key.ARROW_UP)
|
||||||
|
.perform();
|
||||||
|
|
||||||
|
let selected = watchersLightboxHelper.userList().get(1);
|
||||||
|
|
||||||
|
let isSelected = await commonUtil.hasClass(selected, 'selected');
|
||||||
|
|
||||||
|
expect(isSelected).to.be.true;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
helper.customFields = function(typeIndex) {
|
helper.customFields = function(typeIndex) {
|
||||||
|
|
Loading…
Reference in New Issue