Commit e6b6c7ac authored by Annabel Gray's avatar Annabel Gray

Merge branch 'toggle-password-cluster' into 'master'

Toggle Show / Hide Button for Kubernetes Password

Closes #49193

See merge request gitlab-org/gitlab-ce!20659
parents 20938681 510ea543
...@@ -162,8 +162,10 @@ export default class Clusters { ...@@ -162,8 +162,10 @@ export default class Clusters {
if (type === 'password') { if (type === 'password') {
this.tokenField.setAttribute('type', 'text'); this.tokenField.setAttribute('type', 'text');
this.showTokenButton.textContent = s__('ClusterIntegration|Hide');
} else { } else {
this.tokenField.setAttribute('type', 'password'); this.tokenField.setAttribute('type', 'password');
this.showTokenButton.textContent = s__('ClusterIntegration|Show');
} }
} }
......
---
title: Toggle Show / Hide Button for Kubernetes Password
merge_request: 20659
author: gfyoung
type: fixed
...@@ -1286,6 +1286,9 @@ msgstr "" ...@@ -1286,6 +1286,9 @@ msgstr ""
msgid "ClusterIntegration|Helm Tiller" msgid "ClusterIntegration|Helm Tiller"
msgstr "" msgstr ""
msgid "ClusterIntegration|Hide"
msgstr ""
msgid "ClusterIntegration|Ingress" msgid "ClusterIntegration|Ingress"
msgstr "" msgstr ""
......
...@@ -45,17 +45,33 @@ describe('Clusters', () => { ...@@ -45,17 +45,33 @@ describe('Clusters', () => {
}); });
describe('showToken', () => { describe('showToken', () => {
it('should update tye field type', () => { it('should update token field type', () => {
cluster.showTokenButton.click(); cluster.showTokenButton.click();
expect( expect(
cluster.tokenField.getAttribute('type'), cluster.tokenField.getAttribute('type'),
).toEqual('text'); ).toEqual('text');
cluster.showTokenButton.click(); cluster.showTokenButton.click();
expect( expect(
cluster.tokenField.getAttribute('type'), cluster.tokenField.getAttribute('type'),
).toEqual('password'); ).toEqual('password');
}); });
it('should update show token button text', () => {
cluster.showTokenButton.click();
expect(
cluster.showTokenButton.textContent,
).toEqual('Hide');
cluster.showTokenButton.click();
expect(
cluster.showTokenButton.textContent,
).toEqual('Show');
});
}); });
describe('checkForNewInstalls', () => { describe('checkForNewInstalls', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment