mirror of
https://github.com/ansible/awx.git
synced 2026-03-29 14:55:09 -02:30
Merge pull request #771 from gconsidine/ui/fix/input-replace-revert
Ui/fix/input replace revert
This commit is contained in:
@@ -23,7 +23,7 @@ function EditCredentialsController (models, $state, $scope, strings, componentsS
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.$watch('$state.current.name', (value) => {
|
$scope.$watch('$state.current.name', (value) => {
|
||||||
if (/credentials.edit($|\.organization$)/.test(value)) {
|
if (/credentials.edit($|\.organization$|\.credentialType$)/.test(value)) {
|
||||||
vm.tab.details._active = true;
|
vm.tab.details._active = true;
|
||||||
vm.tab.permissions._active = false;
|
vm.tab.permissions._active = false;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -37,6 +37,12 @@ function AtInputSecretController (baseInputController) {
|
|||||||
vm.check();
|
vm.check();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
vm.toggleRevertReplace = () => {
|
||||||
|
scope.state._isBeingReplaced = !scope.state._isBeingReplaced;
|
||||||
|
|
||||||
|
vm.onRevertReplaceToggle();
|
||||||
|
};
|
||||||
|
|
||||||
vm.toggleShowHide = () => {
|
vm.toggleShowHide = () => {
|
||||||
if (scope.type === 'password') {
|
if (scope.type === 'password') {
|
||||||
scope.type = 'text';
|
scope.type = 'text';
|
||||||
|
|||||||
@@ -177,6 +177,30 @@ module.exports = {
|
|||||||
|
|
||||||
credentials.waitForElementNotPresent(`${row}:nth-of-type(2)`);
|
credentials.waitForElementNotPresent(`${row}:nth-of-type(2)`);
|
||||||
credentials.expect.element(row).text.contain(store.credential.name);
|
credentials.expect.element(row).text.contain(store.credential.name);
|
||||||
|
},
|
||||||
|
'change the password after saving': client => {
|
||||||
|
const credentials = client.page.credentials();
|
||||||
|
const { edit } = credentials.section;
|
||||||
|
const { machine } = edit.section.details.section;
|
||||||
|
|
||||||
|
machine.section.password.expect.element('@replace').visible;
|
||||||
|
machine.section.password.expect.element('@replace').enabled;
|
||||||
|
machine.section.password.expect.element('@revert').not.present;
|
||||||
|
|
||||||
|
machine.expect.element('@password').not.enabled;
|
||||||
|
|
||||||
|
machine.section.password.click('@replace');
|
||||||
|
machine.section.password.expect.element('@replace').not.present;
|
||||||
|
machine.section.password.expect.element('@revert').visible;
|
||||||
|
|
||||||
|
machine.expect.element('@password').enabled;
|
||||||
|
machine.setValue('@password', 'newpassword');
|
||||||
|
|
||||||
|
edit.section.details.click('@save');
|
||||||
|
|
||||||
|
credentials
|
||||||
|
.waitForElementVisible('div.spinny')
|
||||||
|
.waitForElementNotVisible('div.spinny');
|
||||||
|
|
||||||
client.end();
|
client.end();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user