Skip to content

Commit

Permalink
Merge 5cf74fb into 02d783b
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescoBorzi committed Jun 16, 2020
2 parents 02d783b + 5cf74fb commit c2d27b6
Show file tree
Hide file tree
Showing 40 changed files with 855 additions and 41 deletions.
2 changes: 2 additions & 0 deletions src/app/app.module.ts
Expand Up @@ -17,6 +17,7 @@ import { GossipModule } from './features/gossip/gossip.module';
import { ConditionsModule } from './features/conditions/conditions.module';
import { SmartScriptsModule } from './features/smart-scripts/smart-scripts.module';
import { SqlEditorModule } from './features/sql-editor/sql-editor.module';
import { OtherLootsModule } from './features/other-loots/other-loots.module';

@NgModule({
declarations: [ AppComponent ],
Expand All @@ -34,6 +35,7 @@ import { SqlEditorModule } from './features/sql-editor/sql-editor.module';
QuestModule,
GameobjectModule,
ItemModule,
OtherLootsModule,
GossipModule,
ConditionsModule,
SmartScriptsModule,
Expand Down
17 changes: 17 additions & 0 deletions src/app/config/app-routing.module.ts
Expand Up @@ -64,6 +64,9 @@ import { SaiFullEditorComponent } from '../features/smart-scripts/sai-full-edito
import { SaiGameobjectComponent } from '../features/gameobject/sai-gameobject/sai-gameobject.component';
import { ConditionsComponent } from '../features/conditions/edit-conditions/conditions.component';
import { SqlEditorComponent } from '../features/sql-editor/sql-editor.component';
import { SelectReferenceLootComponent } from '../features/other-loots/reference-loot/select-reference-loot.component';
import { ReferenceLootTemplateComponent } from '../features/other-loots/reference-loot/reference-loot-template.component';
import { ReferenceLootHandlerService } from '../features/other-loots/reference-loot/reference-loot-handler.service';

const routes: Routes = [
{
Expand Down Expand Up @@ -275,6 +278,20 @@ const routes: Routes = [
},
]
},
{
path: 'other-loots',
children: [
{
path: 'select-reference',
component: SelectReferenceLootComponent,
},
{
path: 'reference',
component: ReferenceLootTemplateComponent,
canActivate: [ReferenceLootHandlerService],
},
]
},
{
path: 'gossip',
children: [
Expand Down
Expand Up @@ -7,8 +7,7 @@ import { LootTemplateIdComponent } from '@keira-abstract/components/editors/loot

@Component({
selector: 'keira-creature-loot-template',
templateUrl: '../../../shared/abstract/components/editors/loot-template/loot-template.component.html',
styleUrls: ['../../../shared/abstract/components/editors/loot-template/loot-template.component.scss']
templateUrl: '../../../shared/abstract/components/editors/loot-template/loot-template-id.component.html',
})
export class CreatureLootTemplateComponent extends LootTemplateIdComponent<CreatureLootTemplate> {

Expand Down
Expand Up @@ -7,8 +7,7 @@ import { LootTemplateIdComponent } from '@keira-abstract/components/editors/loot

@Component({
selector: 'keira-pickpocketing-loot-template',
templateUrl: '../../../shared/abstract/components/editors/loot-template/loot-template.component.html',
styleUrls: ['../../../shared/abstract/components/editors/loot-template/loot-template.component.scss']
templateUrl: '../../../shared/abstract/components/editors/loot-template/loot-template-id.component.html',
})
export class PickpocketingLootTemplateComponent extends LootTemplateIdComponent<PickpocketingLootTemplate> {

Expand Down
Expand Up @@ -7,8 +7,7 @@ import { LootTemplateIdComponent } from '@keira-abstract/components/editors/loot

@Component({
selector: 'keira-skinning-loot-template',
templateUrl: '../../../shared/abstract/components/editors/loot-template/loot-template.component.html',
styleUrls: ['../../../shared/abstract/components/editors/loot-template/loot-template.component.scss']
templateUrl: '../../../shared/abstract/components/editors/loot-template/loot-template-id.component.html',
})
export class SkinningLootTemplateComponent extends LootTemplateIdComponent<SkinningLootTemplate> {

Expand Down
Expand Up @@ -9,7 +9,6 @@ import { LootTemplateIdComponent } from '@keira-abstract/components/editors/loot
@Component({
selector: 'keira-gameobject-loot-template',
templateUrl: './gameobject-loot-template.component.html',
styleUrls: ['./gameobject-loot-template.component.scss']
})
export class GameobjectLootTemplateComponent extends LootTemplateIdComponent<GameobjectLootTemplate> implements OnInit {

Expand Down
Expand Up @@ -7,8 +7,7 @@ import { LootTemplateIdComponent } from '@keira-abstract/components/editors/loot

@Component({
selector: 'keira-disenchant-loot-template',
templateUrl: '../../../shared/abstract/components/editors/loot-template/loot-template.component.html',
styleUrls: ['../../../shared/abstract/components/editors/loot-template/loot-template.component.scss']
templateUrl: '../../../shared/abstract/components/editors/loot-template/loot-template-id.component.html',
})
export class DisenchantLootTemplateComponent extends LootTemplateIdComponent<DisenchantLootTemplate> {

Expand Down

This file was deleted.

Empty file.
Expand Up @@ -7,8 +7,7 @@ import { LootTemplateComponent } from '@keira-abstract/components/editors/loot-t

@Component({
selector: 'keira-item-loot-template',
templateUrl: './item-loot-template.component.html',
styleUrls: ['./item-loot-template.component.scss']
templateUrl: '../../../shared/abstract/components/editors/loot-template/loot-template.component.html',
})
export class ItemLootTemplateComponent extends LootTemplateComponent<ItemLootTemplate> {

Expand Down
Expand Up @@ -7,8 +7,7 @@ import { LootTemplateComponent } from '@keira-abstract/components/editors/loot-t

@Component({
selector: 'keira-milling-loot-template',
templateUrl: '../item-loot-template/item-loot-template.component.html',
styleUrls: ['../item-loot-template/item-loot-template.component.scss']
templateUrl: '../../../shared/abstract/components/editors/loot-template/loot-template.component.html',
})
export class MillingLootTemplateComponent extends LootTemplateComponent<MillingLootTemplate> {

Expand Down
Expand Up @@ -7,8 +7,7 @@ import { LootTemplateComponent } from '@keira-abstract/components/editors/loot-t

@Component({
selector: 'keira-prospecting-loot-template',
templateUrl: '../item-loot-template/item-loot-template.component.html',
styleUrls: ['../item-loot-template/item-loot-template.component.scss']
templateUrl: '../../../shared/abstract/components/editors/loot-template/loot-template.component.html',
})
export class ProspectingLootTemplateComponent extends LootTemplateComponent<ProspectingLootTemplate> {

Expand Down
13 changes: 13 additions & 0 deletions src/app/features/other-loots/other-loots.module.ts
@@ -0,0 +1,13 @@
import { NgModule } from '@angular/core';

import { ReferenceLootTemplateModule } from './reference-loot/reference-loot-template.module';

const modules = [
ReferenceLootTemplateModule,
];

@NgModule({
imports: [modules],
exports: [modules],
})
export class OtherLootsModule {}
@@ -0,0 +1,15 @@
import { TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';

import { ReferenceLootHandlerService } from './reference-loot-handler.service';

describe('ReferenceLootHandlerService', () => {
beforeEach(() => TestBed.configureTestingModule({
imports: [RouterTestingModule],
providers: [ReferenceLootHandlerService],
}));

it('should be created', () => {
expect(TestBed.inject(ReferenceLootHandlerService)).toBeTruthy();
});
});
@@ -0,0 +1,25 @@
import { Injectable } from '@angular/core';
import { Router } from '@angular/router';

import { HandlerService } from '@keira-abstract/service/handlers/handler.service';
import { REFERENCE_LOOT_TEMPLATE_TABLE, ReferenceLootTemplate } from '@keira-types/reference-loot-template.type';

@Injectable()
export class ReferenceLootHandlerService extends HandlerService<ReferenceLootTemplate> {

get isUnsaved(): boolean { return this.statusMap[REFERENCE_LOOT_TEMPLATE_TABLE]; }

protected _statusMap = {
[REFERENCE_LOOT_TEMPLATE_TABLE]: false,
};

/* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690
constructor(
protected router: Router,
) {
super(
'other-loots/reference',
router,
);
}
}
@@ -0,0 +1,21 @@
import { Component } from '@angular/core';

import { ReferenceLootTemplate } from '@keira-types/reference-loot-template.type';
import { ReferenceLootTemplateService } from './reference-loot-template.service';
import { LootTemplateComponent } from '@keira-abstract/components/editors/loot-template/loot-template.component';
import { ReferenceLootHandlerService } from './reference-loot-handler.service';

@Component({
selector: 'keira-reference-loot-template',
templateUrl: '../../../shared/abstract/components/editors/loot-template/loot-template.component.html',
})
export class ReferenceLootTemplateComponent extends LootTemplateComponent<ReferenceLootTemplate> {

/* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690
constructor(
public editorService: ReferenceLootTemplateService,
public handlerService: ReferenceLootHandlerService,
) {
super(editorService, handlerService);
}
}

0 comments on commit c2d27b6

Please sign in to comment.