* Remove ngx-bootstrap dependency

* Add material button toggle for decorations
pull/40/head
HardiReady 2018-07-03 20:58:21 +02:00
parent 0aefb9c6d9
commit 3a6e9b093a
7 changed files with 78 additions and 77 deletions

121
static/package-lock.json generated
View File

@ -4218,8 +4218,8 @@
"bundled": true, "bundled": true,
"optional": true, "optional": true,
"requires": { "requires": {
"delegates": "^1.0.0", "delegates": "1.0.0",
"readable-stream": "^2.0.6" "readable-stream": "2.3.6"
} }
}, },
"balanced-match": { "balanced-match": {
@ -4230,7 +4230,7 @@
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
} }
}, },
@ -4284,7 +4284,7 @@
"bundled": true, "bundled": true,
"optional": true, "optional": true,
"requires": { "requires": {
"minipass": "^2.2.1" "minipass": "2.2.4"
} }
}, },
"fs.realpath": { "fs.realpath": {
@ -4297,14 +4297,14 @@
"bundled": true, "bundled": true,
"optional": true, "optional": true,
"requires": { "requires": {
"aproba": "^1.0.3", "aproba": "1.2.0",
"console-control-strings": "^1.0.0", "console-control-strings": "1.1.0",
"has-unicode": "^2.0.0", "has-unicode": "2.0.1",
"object-assign": "^4.1.0", "object-assign": "4.1.1",
"signal-exit": "^3.0.0", "signal-exit": "3.0.2",
"string-width": "^1.0.1", "string-width": "1.0.2",
"strip-ansi": "^3.0.1", "strip-ansi": "3.0.1",
"wide-align": "^1.1.0" "wide-align": "1.1.2"
} }
}, },
"glob": { "glob": {
@ -4312,12 +4312,12 @@
"bundled": true, "bundled": true,
"optional": true, "optional": true,
"requires": { "requires": {
"fs.realpath": "^1.0.0", "fs.realpath": "1.0.0",
"inflight": "^1.0.4", "inflight": "1.0.6",
"inherits": "2", "inherits": "2.0.3",
"minimatch": "^3.0.4", "minimatch": "3.0.4",
"once": "^1.3.0", "once": "1.4.0",
"path-is-absolute": "^1.0.0" "path-is-absolute": "1.0.1"
} }
}, },
"has-unicode": { "has-unicode": {
@ -4330,7 +4330,7 @@
"bundled": true, "bundled": true,
"optional": true, "optional": true,
"requires": { "requires": {
"safer-buffer": "^2.1.0" "safer-buffer": "2.1.2"
} }
}, },
"ignore-walk": { "ignore-walk": {
@ -4338,7 +4338,7 @@
"bundled": true, "bundled": true,
"optional": true, "optional": true,
"requires": { "requires": {
"minimatch": "^3.0.4" "minimatch": "3.0.4"
} }
}, },
"inflight": { "inflight": {
@ -4346,8 +4346,8 @@
"bundled": true, "bundled": true,
"optional": true, "optional": true,
"requires": { "requires": {
"once": "^1.3.0", "once": "1.4.0",
"wrappy": "1" "wrappy": "1.0.2"
} }
}, },
"inherits": { "inherits": {
@ -4363,7 +4363,7 @@
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "1.0.1"
} }
}, },
"isarray": { "isarray": {
@ -4375,7 +4375,7 @@
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "1.1.11"
} }
}, },
"minimist": { "minimist": {
@ -4386,8 +4386,8 @@
"version": "2.2.4", "version": "2.2.4",
"bundled": true, "bundled": true,
"requires": { "requires": {
"safe-buffer": "^5.1.1", "safe-buffer": "5.1.1",
"yallist": "^3.0.0" "yallist": "3.0.2"
} }
}, },
"minizlib": { "minizlib": {
@ -4415,9 +4415,9 @@
"bundled": true, "bundled": true,
"optional": true, "optional": true,
"requires": { "requires": {
"debug": "^2.1.2", "debug": "2.6.9",
"iconv-lite": "^0.4.4", "iconv-lite": "0.4.21",
"sax": "^1.2.4" "sax": "1.2.4"
} }
}, },
"node-pre-gyp": { "node-pre-gyp": {
@ -4442,8 +4442,8 @@
"bundled": true, "bundled": true,
"optional": true, "optional": true,
"requires": { "requires": {
"abbrev": "1", "abbrev": "1.1.1",
"osenv": "^0.1.4" "osenv": "0.1.5"
} }
}, },
"npm-bundled": { "npm-bundled": {
@ -4456,8 +4456,8 @@
"bundled": true, "bundled": true,
"optional": true, "optional": true,
"requires": { "requires": {
"ignore-walk": "^3.0.1", "ignore-walk": "3.0.1",
"npm-bundled": "^1.0.1" "npm-bundled": "1.0.3"
} }
}, },
"npmlog": { "npmlog": {
@ -4465,10 +4465,10 @@
"bundled": true, "bundled": true,
"optional": true, "optional": true,
"requires": { "requires": {
"are-we-there-yet": "~1.1.2", "are-we-there-yet": "1.1.4",
"console-control-strings": "~1.1.0", "console-control-strings": "1.1.0",
"gauge": "~2.7.3", "gauge": "2.7.4",
"set-blocking": "~2.0.0" "set-blocking": "2.0.0"
} }
}, },
"number-is-nan": { "number-is-nan": {
@ -4484,7 +4484,7 @@
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1.0.2"
} }
}, },
"os-homedir": { "os-homedir": {
@ -4502,8 +4502,8 @@
"bundled": true, "bundled": true,
"optional": true, "optional": true,
"requires": { "requires": {
"os-homedir": "^1.0.0", "os-homedir": "1.0.2",
"os-tmpdir": "^1.0.0" "os-tmpdir": "1.0.2"
} }
}, },
"path-is-absolute": { "path-is-absolute": {
@ -4521,10 +4521,10 @@
"bundled": true, "bundled": true,
"optional": true, "optional": true,
"requires": { "requires": {
"deep-extend": "^0.5.1", "deep-extend": "0.5.1",
"ini": "~1.3.0", "ini": "1.3.5",
"minimist": "^1.2.0", "minimist": "1.2.0",
"strip-json-comments": "~2.0.1" "strip-json-comments": "2.0.1"
}, },
"dependencies": { "dependencies": {
"minimist": { "minimist": {
@ -4539,13 +4539,13 @@
"bundled": true, "bundled": true,
"optional": true, "optional": true,
"requires": { "requires": {
"core-util-is": "~1.0.0", "core-util-is": "1.0.2",
"inherits": "~2.0.3", "inherits": "2.0.3",
"isarray": "~1.0.0", "isarray": "1.0.0",
"process-nextick-args": "~2.0.0", "process-nextick-args": "2.0.0",
"safe-buffer": "~5.1.1", "safe-buffer": "5.1.1",
"string_decoder": "~1.1.1", "string_decoder": "1.1.1",
"util-deprecate": "~1.0.1" "util-deprecate": "1.0.2"
} }
}, },
"rimraf": { "rimraf": {
@ -4553,7 +4553,7 @@
"bundled": true, "bundled": true,
"optional": true, "optional": true,
"requires": { "requires": {
"glob": "^7.0.5" "glob": "7.1.2"
} }
}, },
"safe-buffer": { "safe-buffer": {
@ -4589,9 +4589,9 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "1.1.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "1.0.0",
"strip-ansi": "^3.0.0" "strip-ansi": "3.0.1"
} }
}, },
"string_decoder": { "string_decoder": {
@ -4599,14 +4599,14 @@
"bundled": true, "bundled": true,
"optional": true, "optional": true,
"requires": { "requires": {
"safe-buffer": "~5.1.0" "safe-buffer": "5.1.1"
} }
}, },
"strip-ansi": { "strip-ansi": {
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "bundled": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "2.1.1"
} }
}, },
"strip-json-comments": { "strip-json-comments": {
@ -4638,7 +4638,7 @@
"bundled": true, "bundled": true,
"optional": true, "optional": true,
"requires": { "requires": {
"string-width": "^1.0.2" "string-width": "1.0.2"
} }
}, },
"wrappy": { "wrappy": {
@ -7734,11 +7734,6 @@
"integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=",
"dev": true "dev": true
}, },
"ngx-bootstrap": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/ngx-bootstrap/-/ngx-bootstrap-3.0.1.tgz",
"integrity": "sha512-ni91yYtn8ldgf/pxrlwl9lkVcLURGzopSpJnEbbgG1v1EZWTobI8y7J3mx4Kxptkn0EeiQwnLel67G7XJSox4A=="
},
"ngx-clipboard": { "ngx-clipboard": {
"version": "11.1.1", "version": "11.1.1",
"resolved": "https://registry.npmjs.org/ngx-clipboard/-/ngx-clipboard-11.1.1.tgz", "resolved": "https://registry.npmjs.org/ngx-clipboard/-/ngx-clipboard-11.1.1.tgz",

View File

@ -36,7 +36,6 @@
"jquery": "^3.1.0", "jquery": "^3.1.0",
"jquery-ui": "^1.12.0", "jquery-ui": "^1.12.0",
"jquery-ui-bundle": "^1.11.4", "jquery-ui-bundle": "^1.11.4",
"ngx-bootstrap": "^3.0.1",
"ngx-clipboard": "^11.1.1", "ngx-clipboard": "^11.1.1",
"ngx-cookie-service": "^1.0.9", "ngx-cookie-service": "^1.0.9",
"ngx-infinite-scroll": "^0.5.2", "ngx-infinite-scroll": "^0.5.2",

View File

@ -1,10 +1,16 @@
<div class="select-list"> <div class="select-list">
<div class="input-group list-header pull-left"> <div class="input-group list-header pull-left">
<div class="btn-group" (click)="filterDecorations()"> <mat-button-toggle-group #group="matButtonToggleGroup">
<label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="BLUFOR" uncheckable>{{fraction.BLUFOR}}</label> <mat-button-toggle value="BLUFOR" (change)="filterDecorations(group)">
<label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="OPFOR" uncheckable>{{fraction.OPFOR}}</label> {{fraction.BLUFOR}}
<label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="GLOBAL" uncheckable>Global</label> </mat-button-toggle>
</div> <mat-button-toggle value="OPFOR" (change)="filterDecorations(group)">
{{fraction.OPFOR}}
</mat-button-toggle>
<mat-button-toggle value="GLOBAL" (change)="filterDecorations(group)">
Global
</mat-button-toggle>
</mat-button-toggle-group>
<a class="pull-right btn btn-success" (click)="openNewDecorationForm()">+</a> <a class="pull-right btn btn-success" (click)="openNewDecorationForm()">+</a>
</div> </div>

View File

@ -7,6 +7,8 @@ import {Observable} from 'rxjs/Observable';
import {Decoration} from '../../models/model-interfaces'; import {Decoration} from '../../models/model-interfaces';
import {DecorationService} from '../../services/army-management/decoration.service'; import {DecorationService} from '../../services/army-management/decoration.service';
import {Fraction} from '../../utils/fraction.enum'; import {Fraction} from '../../utils/fraction.enum';
import {MatButtonToggleGroup} from '@angular/material';
import {UIHelpers} from '../../utils/global.helpers';
@Component({ @Component({
selector: 'decoration-list', selector: 'decoration-list',
@ -21,7 +23,7 @@ export class DecorationListComponent implements OnInit {
searchTerm = new FormControl(); searchTerm = new FormControl();
public radioModel: string; radioModel: string = '';
readonly fraction = Fraction; readonly fraction = Fraction;
@ -73,7 +75,8 @@ export class DecorationListComponent implements OnInit {
} }
} }
filterDecorations() { filterDecorations(group?: MatButtonToggleGroup) {
this.radioModel = UIHelpers.toggleReleaseButton(this.radioModel, group);
this.decorations$ = this.decorationService.findDecorations(this.searchTerm.value, this.radioModel); this.decorations$ = this.decorationService.findDecorations(this.searchTerm.value, this.radioModel);
} }

View File

@ -4,11 +4,11 @@ import {CommonModule} from '@angular/common';
import {DecorationStore} from '../services/stores/decoration.store'; import {DecorationStore} from '../services/stores/decoration.store';
import {DecorationService} from '../services/army-management/decoration.service'; import {DecorationService} from '../services/army-management/decoration.service';
import {NgModule} from '@angular/core'; import {NgModule} from '@angular/core';
import {ButtonsModule} from 'ngx-bootstrap'; import {MatButtonToggleModule} from '@angular/material';
@NgModule({ @NgModule({
declarations: decorationsRoutingComponents, declarations: decorationsRoutingComponents,
imports: [CommonModule, SharedModule, ButtonsModule.forRoot(), decorationRoutesModule], imports: [CommonModule, SharedModule, MatButtonToggleModule, decorationRoutesModule],
providers: [DecorationStore, DecorationService] providers: [DecorationStore, DecorationService]
}) })
export class DecorationsModule { export class DecorationsModule {

View File

@ -2,13 +2,12 @@ import {NgModule} from '@angular/core';
import {SharedModule} from '../shared.module'; import {SharedModule} from '../shared.module';
import {CommonModule} from '@angular/common'; import {CommonModule} from '@angular/common';
import {RankService} from '../services/army-management/rank.service'; import {RankService} from '../services/army-management/rank.service';
import {ButtonsModule} from 'ngx-bootstrap';
import {pubRouterModule, pubRoutingComponents} from './public.routing'; import {pubRouterModule, pubRoutingComponents} from './public.routing';
import {DecorationService} from '../services/army-management/decoration.service'; import {DecorationService} from '../services/army-management/decoration.service';
@NgModule({ @NgModule({
declarations: pubRoutingComponents, declarations: pubRoutingComponents,
imports: [CommonModule, SharedModule, ButtonsModule.forRoot(), pubRouterModule], imports: [CommonModule, SharedModule, pubRouterModule],
providers: [DecorationService, RankService] providers: [DecorationService, RankService]
}) })
export class PublicModule { export class PublicModule {

View File

@ -4,12 +4,11 @@ import {SharedModule} from '../shared.module';
import {statsRouterModule, statsRoutingComponents} from './stats.routing'; import {statsRouterModule, statsRoutingComponents} from './stats.routing';
import {WarService} from '../services/logs/war.service'; import {WarService} from '../services/logs/war.service';
import {NgxChartsModule} from '@swimlane/ngx-charts'; import {NgxChartsModule} from '@swimlane/ngx-charts';
import {AccordionModule, ButtonsModule} from 'ngx-bootstrap';
import {CampaignService} from '../services/logs/campaign.service'; import {CampaignService} from '../services/logs/campaign.service';
import {NgxDatatableModule} from '@swimlane/ngx-datatable'; import {NgxDatatableModule} from '@swimlane/ngx-datatable';
import {PlayerService} from '../services/logs/player.service'; import {PlayerService} from '../services/logs/player.service';
import {LogsService} from '../services/logs/logs.service'; import {LogsService} from '../services/logs/logs.service';
import {MatButtonToggleModule, MatExpansionModule, MatFormFieldModule} from '@angular/material'; import {MatButtonToggleModule, MatExpansionModule} from '@angular/material';
@NgModule({ @NgModule({
declarations: statsRoutingComponents, declarations: statsRoutingComponents,