BigW Consortium Gitlab

Fix show page toggle

parent 50d9cc6d
...@@ -145,8 +145,8 @@ export default class Clusters { ...@@ -145,8 +145,8 @@ export default class Clusters {
} }
toggle() { toggle() {
this.toggleButton.classList.toggle('checked'); this.toggleButton.classList.toggle('is-checked');
this.toggleInput.setAttribute('value', this.toggleButton.classList.contains('checked').toString()); this.toggleInput.setAttribute('value', this.toggleButton.classList.contains('is-checked').toString());
} }
hideAll() { hideAll() {
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
= field.hidden_field :enabled, { class: 'js-toggle-input'} = field.hidden_field :enabled, { class: 'js-toggle-input'}
%button{ type: 'button', %button{ type: 'button',
class: "js-toggle-cluster project-feature-toggle #{'checked' unless !@cluster.enabled?} #{'disabled' unless can?(current_user, :update_cluster, @cluster)}", class: "js-toggle-cluster project-feature-toggle #{'is-checked' unless !@cluster.enabled?} #{'is-disabled' unless can?(current_user, :update_cluster, @cluster)}",
'aria-label': s_('ClusterIntegration|Toggle Cluster'), 'aria-label': s_('ClusterIntegration|Toggle Cluster'),
disabled: !can?(current_user, :update_cluster, @cluster), disabled: !can?(current_user, :update_cluster, @cluster),
data: { 'enabled-text': 'Enabled', 'disabled-text': 'Disabled' } } data: { 'enabled-text': 'Enabled', 'disabled-text': 'Disabled' } }
......
...@@ -28,7 +28,7 @@ describe('Clusters', () => { ...@@ -28,7 +28,7 @@ describe('Clusters', () => {
expect( expect(
cluster.toggleButton.classList, cluster.toggleButton.classList,
).not.toContain('checked'); ).not.toContain('is-checked');
expect( expect(
cluster.toggleInput.getAttribute('value'), cluster.toggleInput.getAttribute('value'),
......
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