Files
adastra_app/src/app/components/herowars-guildraid/herowars-guildraid.component.ts
T
julien be5f5775ef chore(deps): upgrade Angular 19 → 20
- ng update @angular/core@20 @angular/cli@20 @angular/material@20 @angular-eslint@20 @angular/google-maps@20
- Remove ng-chartist (abandoned, incompatible with Angular 20): replace <x-chartist> with <app-bars-chart> in dropzones-bar and jumps-by-month
- Migrate all constructor injection to inject() function (ng generate @angular/core:inject, 67 files)
- TypeScript 5.5 → 5.9.3
- DOCUMENT import moved from @angular/common to @angular/core (automatic migration)
- tsconfig moduleResolution updated to "bundler"
2026-04-26 06:40:13 +02:00

90 lines
3.2 KiB
TypeScript

import { DatePipe } from '@angular/common';
import { Title } from '@angular/platform-browser';
import { trigger, state, style, animate, transition } from '@angular/animations';
import { Component, DestroyRef, Injectable, inject, OnInit } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { STEPPER_GLOBAL_OPTIONS } from '@angular/cdk/stepper';
import { MatCardModule } from '@angular/material/card';
import { MatButtonModule } from '@angular/material/button';
import { MatDividerModule } from '@angular/material/divider';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { MatStepperIntl, MatStepperModule } from '@angular/material/stepper';
import { ListErrorsComponent } from '@components/shared';
import { Errors } from '@models';
import { HWGuildRaid, HWGuildRaidStage, HWMember } from '@models/herowars';
@Injectable()
export class GuildRaidStepperIntl extends MatStepperIntl {
// the default optional label text, if unspecified is "Optional"
override optionalLabel = 'Optional Label';
}
@Component({
selector: 'app-herowars-guildraid',
providers: [
{
provide: STEPPER_GLOBAL_OPTIONS,
useValue: { displayDefaultIndicatorType: false },
},
],
imports: [
DatePipe,
FormsModule,
ListErrorsComponent,
MatButtonModule,
MatCardModule,
MatDividerModule,
MatFormFieldModule,
MatIconModule,
MatInputModule,
MatStepperModule,
],
templateUrl: './herowars-guildraid.component.html',
styleUrl: './herowars-guildraid.component.scss',
animations: [
trigger('flyInOut', [
state('in', style({ transform: 'translateY(0)' })),
transition('void => *', [style({ transform: 'translateY(-100%)' }), animate(200)]),
transition('* => void', [style({ transform: 'translateY(100%)' }), animate(200)]),
]),
],
})
export class HerowarsGuildraidComponent implements OnInit {
private _titleService = inject(Title);
public title = 'Guild Raids';
public subtitle = 'Log';
public description = 'Tools in working progress.';
public errors: Errors = { errors: {} };
public destroyRef = inject(DestroyRef);
public minVarPct = 3;
public minValue = 0;
public now = new Date();
private _guildMembers: HWMember[] = [];
private _matStepperIntl = inject(MatStepperIntl);
private _guildRaids: HWGuildRaid[] = [];
private _raidStages: HWGuildRaidStage[] = [
{ num: 1, name: 'Stage 1', maxPower: 320000, duration: 8, startTime: 0, endTime: 0 },
{ num: 2, name: 'Stage 2', maxPower: 500000, duration: 8, startTime: 0, endTime: 0 },
{ num: 3, name: 'Stage 3', maxPower: 0, duration: 0, startTime: 0, endTime: 0 },
];
ngOnInit() {
this._titleService.setTitle(this.title);
this._guildMembers.map((data) => {
data.raids = [];
data.raidsInfo = {
variationAvg: 0,
variationSum: 0,
};
return data;
});
}
getMembers(): HWMember[] {
return this._guildMembers;
}
}