Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
459 additions
and
4 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
src/app/features/gossip/gossip-menu-option-preview/gossip-menu-option-preview.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<div class="preview-container" [ngClass]="show ? 'show-preview' : 'hide-preview'"> | ||
<perfect-scrollbar class="transparent"> | ||
<div class="gossip-preview"> | ||
|
||
<p *ngFor="let row of options"> | ||
<img *ngIf="OPTION_IMG[row.OptionIcon]" [src]="'assets/img/gossip/' + OPTION_IMG[row.OptionIcon]"> {{ row.OptionText }} | ||
</p> | ||
|
||
</div> | ||
</perfect-scrollbar> | ||
</div> |
5 changes: 5 additions & 0 deletions
5
src/app/features/gossip/gossip-menu-option-preview/gossip-menu-option-preview.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.gossip-preview { | ||
color: #fff; | ||
padding: 10px; | ||
margin-top: calc(50vh - 70%); | ||
} |
16 changes: 16 additions & 0 deletions
16
src/app/features/gossip/gossip-menu-option-preview/gossip-menu-option-preview.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Component, Input } from '@angular/core'; | ||
|
||
import { GossipMenuOption } from '@keira-types/gossip-menu-option.type'; | ||
import { OPTION_IMG } from '@keira-constants/options/gossip-option-icon'; | ||
|
||
@Component({ | ||
selector: 'keira-gossip-menu-option-preview', | ||
templateUrl: './gossip-menu-option-preview.component.html', | ||
styleUrls: ['./gossip-menu-option-preview.component.scss'] | ||
}) | ||
export class GossipMenuOptionPreviewComponent { | ||
@Input() options: GossipMenuOption[]; | ||
@Input() show = true; | ||
|
||
public readonly OPTION_IMG = OPTION_IMG; | ||
} |
21 changes: 21 additions & 0 deletions
21
src/app/features/gossip/gossip-menu-option-preview/gossip-menu-option-preview.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { BrowserModule } from '@angular/platform-browser'; | ||
import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar'; | ||
|
||
import { QueryOutputModule } from '@keira-shared/modules/query-output/query-output.module'; | ||
import { GossipMenuOptionPreviewComponent } from './gossip-menu-option-preview.component'; | ||
|
||
@NgModule({ | ||
declarations: [ | ||
GossipMenuOptionPreviewComponent, | ||
], | ||
imports: [ | ||
BrowserModule, | ||
QueryOutputModule, | ||
PerfectScrollbarModule, | ||
], | ||
exports: [ | ||
GossipMenuOptionPreviewComponent, | ||
], | ||
}) | ||
export class GossipMenuOptionPreviewModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/app/shared/modules/search/npc-text-search.service.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
import { instance } from 'ts-mockito'; | ||
|
||
import { NpcTextSearchService } from './npc-text-search.service'; | ||
import { MysqlQueryService } from '../../services/mysql-query.service'; | ||
import { MockedMysqlQueryService } from '../../testing/mocks'; | ||
|
||
describe('NpcTextSearchService', () => { | ||
beforeEach(() => TestBed.configureTestingModule({ | ||
providers: [ | ||
{ provide: MysqlQueryService, useValue: instance(MockedMysqlQueryService) }, | ||
] | ||
})); | ||
|
||
it('should be created', () => { | ||
const service: NpcTextSearchService = TestBed.inject(NpcTextSearchService); | ||
expect(service).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { NPC_TEXT_SEARCH_FIELDS, NPC_TEXT_TABLE } from '@keira-shared/types/npc-text.type'; | ||
import { MysqlQueryService } from '../../services/mysql-query.service'; | ||
import { ItemTemplate } from '../../types/item-template.type'; | ||
import { SearchService } from './search.service'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class NpcTextSearchService extends SearchService<ItemTemplate> { | ||
|
||
/* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 | ||
constructor( | ||
public readonly queryService: MysqlQueryService, | ||
) { | ||
super(queryService, NPC_TEXT_TABLE, NPC_TEXT_SEARCH_FIELDS); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/app/shared/modules/selectors/npc-text-selector/npc-text-selector-btn.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { async, TestBed } from '@angular/core/testing'; | ||
|
||
import { NpcTextSelectorBtnComponent } from './npc-text-selector-btn.component'; | ||
import { NpcTextSelectorModule } from './npc-text-selector.module'; | ||
|
||
describe('NpcTextSelectorBtnComponent', () => { | ||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [ NpcTextSelectorModule ], | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
function setup() { | ||
const fixture = TestBed.createComponent(NpcTextSelectorBtnComponent); | ||
const component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
|
||
return { component, fixture }; | ||
} | ||
|
||
it('should create', () => { | ||
const { component } = setup(); | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
23 changes: 23 additions & 0 deletions
23
src/app/shared/modules/selectors/npc-text-selector/npc-text-selector-btn.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Component } from '@angular/core'; | ||
import { BsModalService } from 'ngx-bootstrap/modal'; | ||
|
||
import { NpcTextSelectorModalComponent } from './npc-text-selector-modal.component'; | ||
import { BaseSelectorBtnComponent } from '../base-selector/base-selector-btn.component'; | ||
|
||
@Component({ | ||
selector: 'keira-npc-text-selector-btn', | ||
templateUrl: '../base-selector/base-selector-btn.component.html', | ||
styleUrls: ['../base-selector/base-selector-btn.component.scss'] | ||
}) | ||
export class NpcTextSelectorBtnComponent extends BaseSelectorBtnComponent { | ||
|
||
/* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 | ||
constructor( | ||
modalService: BsModalService, | ||
) { | ||
super( | ||
NpcTextSelectorModalComponent, | ||
modalService, | ||
); | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
src/app/shared/modules/selectors/npc-text-selector/npc-text-selector-modal.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<div class="modal-body"> | ||
|
||
<p class="lead text-center mb-1">Npc Text selector</p> | ||
|
||
<form [formGroup]="searchService.queryForm"> | ||
<div class="row"> | ||
<ng-container [formGroup]="searchService.fields"> | ||
<div class="form-group col-2"> | ||
<input [formControlName]="'ID'" type="number" class="form-control form-control-sm" id="ID" placeholder="ID"> | ||
</div> | ||
<div class="form-group col-3"> | ||
<input [formControlName]="'text0_0'" class="form-control form-control-sm" id="text0_0" placeholder="text0_0"> | ||
</div> | ||
<div class="form-group col-3"> | ||
<input [formControlName]="'text0_1'" class="form-control form-control-sm" id="text0_1" placeholder="text0_1"> | ||
</div> | ||
</ng-container> | ||
<div class="form-group col-2"> | ||
<input [formControlName]="'limit'" class="form-control form-control-sm" id="limit" placeholder="Unlimited"> | ||
</div> | ||
<div class="col-2"> | ||
<keira-search-button [searchService]="searchService"></keira-search-button> | ||
</div> | ||
</div> | ||
<code [highlight]="searchService.query"></code> | ||
</form> | ||
|
||
<div *ngIf="searchService.rows"> | ||
|
||
<ngx-datatable | ||
class="bootstrap table table-striped text-center datatable-select highlight-select datatable-icon-list" | ||
[rows]="searchService.rows" | ||
[headerHeight]="DTCFG.headerHeight" | ||
[footerHeight]="DTCFG.footerHeight" | ||
[columnMode]="DTCFG.columnMode" | ||
[rowHeight]="DTCFG.rowHeightWithIcon" | ||
[limit]="DTCFG.limit" | ||
[selectionType]="DTCFG.selectionType" | ||
(select)='onSelect($event)' | ||
> | ||
<ngx-datatable-column name="ID" prop="ID" [minWidth]="50" [maxWidth]="50"></ngx-datatable-column> | ||
<ngx-datatable-column name="text0_0" prop="text0_0"></ngx-datatable-column> | ||
<ngx-datatable-column name="text0_1" prop="text0_1"></ngx-datatable-column> | ||
</ngx-datatable> | ||
|
||
</div> | ||
</div> | ||
|
||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-danger" id="modal-cancel-btn" (click)="onCancel()">Cancel</button> | ||
<button type="button" class="btn btn-success" id="modal-select-btn" (click)="onSave()">Select</button> | ||
</div> |
Empty file.
Oops, something went wrong.