Skip to content

Commit ffb1e53

Browse files
committed
Updated the column selector settings menu so the checkboxes are enabled, and function as expected.
1 parent ceb9337 commit ffb1e53

8 files changed

+21
-32
lines changed

client/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
"clean": "rimraf dist/",
1313
"test": "karma start test/karma.conf.js",
1414
"test-single-run": "karma start test/karma.conf.js --singleRun --no-auto-watch",
15-
"start": "webpack-dev-server --mode=development --port 4000 --history-api-fallback --colors",
16-
"sync": "webpack --env.disableMinimize=true --mode=production --output-path=../webapp/target/pwm-1.8.0-SNAPSHOT/public/resources/webjars/pwm-client --watch --progress --colors"
15+
"start": "webpack-dev-server --mode=development --port 4000 --history-api-fallback --colors"
1716
},
1817
"author": "",
1918
"license": "ISC",

client/src/modules/helpdesk/helpdesk-search-table.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ <h2 id="page-content-title" ng-if="!$ctrl.advancedSearch" translate="Title_Helpd
8282
<ias-menu name="menu1" ias-align="end end" class="ias-styles-root">
8383
<div class="ias-input-container">
8484
<div class="checkbox-button" ng-repeat="(key, value) in $ctrl.columnConfiguration">
85-
<input type="checkbox" ng-checked="value.visible" aria-label="Toggle column visibility" disabled/>
86-
<ias-button ng-click="$ctrl.toggleColumnVisible($event, key)">{{value.label}}</ias-button>
85+
<input type="checkbox" ng-model="value.visible" aria-label="Toggle column visibility" />
86+
<ias-button class="toggle-column-btn" ng-click="value.visible = !value.visible; $event.stopImmediatePropagation();">{{value.label}}</ias-button>
8787
</div>
8888
</div>
8989
</ias-menu>

client/src/modules/helpdesk/helpdesk-search-table.component.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,6 @@ export default class HelpDeskSearchTableComponent extends HelpDeskSearchBaseComp
106106
this.toggleView('search.cards');
107107
}
108108

109-
toggleColumnVisible(event, columnId): void {
110-
const visibleColumns = Object.keys(this.columnConfiguration).filter((columnId) => {
111-
return this.columnConfiguration[columnId].visible;
112-
});
113-
114-
if (!(visibleColumns.length === 1 && this.columnConfiguration[columnId].visible)) {
115-
this.columnConfiguration[columnId].visible = !this.columnConfiguration[columnId].visible;
116-
}
117-
118-
event.stopImmediatePropagation();
119-
}
120-
121109
private onSearchResult(searchResult: SearchResult): void {
122110
this.searchResult = searchResult;
123111
}

client/src/modules/helpdesk/helpdesk-search.component.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,11 @@
110110
}
111111
}
112112
}
113+
114+
.ias-input-container > .checkbox-button > .ias-button.toggle-column-btn {
115+
&:focus, &:hover {
116+
background-color: transparent;
117+
box-shadow: none;
118+
}
119+
}
113120
}

client/src/modules/peoplesearch/peoplesearch-table.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ <h2 id="page-content-title" translate="Title_PeopleSearch">People Search</h2>
8686
<ias-menu name="menu1" ias-align="end end" class="ias-styles-root">
8787
<div class="ias-input-container">
8888
<div class="checkbox-button" ng-repeat="(key, value) in $ctrl.columnConfiguration">
89-
<input type="checkbox" ng-checked="value.visible" aria-label="Toggle column visibility" disabled/>
90-
<ias-button ng-click="$ctrl.toggleColumnVisible($event, key)">{{value.label}}</ias-button>
89+
<input type="checkbox" ng-model="value.visible" aria-label="Toggle column visibility" />
90+
<ias-button class="toggle-column-btn" ng-click="value.visible = !value.visible; $event.stopImmediatePropagation();">{{value.label}}</ias-button>
9191
</div>
9292
</div>
9393
</ias-menu>

client/src/modules/peoplesearch/peoplesearch-table.component.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,11 @@
4343
}
4444
}
4545
}
46+
47+
.ias-input-container > .checkbox-button > .ias-button.toggle-column-btn {
48+
&:focus, &:hover {
49+
background-color: transparent;
50+
box-shadow: none;
51+
}
52+
}
4653
}

client/src/modules/peoplesearch/peoplesearch-table.component.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,18 +116,6 @@ export default class PeopleSearchTableComponent extends PeopleSearchBaseComponen
116116
}
117117
}
118118

119-
toggleColumnVisible(event, columnId): void {
120-
const visibleColumns = Object.keys(this.columnConfiguration).filter((columnId) => {
121-
return this.columnConfiguration[columnId].visible;
122-
});
123-
124-
if (!(visibleColumns.length === 1 && this.columnConfiguration[columnId].visible)) {
125-
this.columnConfiguration[columnId].visible = !this.columnConfiguration[columnId].visible;
126-
}
127-
128-
event.stopImmediatePropagation();
129-
}
130-
131119
private onSearchResult(searchResult: SearchResult): void {
132120
this.searchResult = searchResult;
133121
}

client/webpack.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ module.exports = function (env, argv) {
119119
// Development-specific configuration
120120
return webpackMerge(commonConfig, {
121121
entry: {
122-
'peoplesearch.ng': './src/modules/peoplesearch/main.dev',
123-
'helpdesk.ng': './src/modules/helpdesk/main.dev'
122+
'peoplesearch.ng': './src/modules/peoplesearch/main',
123+
'helpdesk.ng': './src/modules/helpdesk/main'
124124
},
125125
plugins: [
126126
new HtmlWebpackPlugin({

0 commit comments

Comments
 (0)