Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
/** Costume filter: 9000 any, 0 none, N that costume. See shared/utils/costumes.ts. */
costume: number;
def: number;
/** The sentence PoracleNG renders for this rule, in the alert language. Read-only. */
description?: null | string;
distance: number;
form: number;
gender: number;
Expand Down Expand Up @@ -45,16 +47,18 @@
uid: number;
}

export type MonsterCreate = Omit<Monster, 'uid' | 'id' | 'profileNo'>;
export type MonsterCreate = Omit<Monster, 'description' | 'uid' | 'id' | 'profileNo'>;

export type MonsterUpdate = Partial<MonsterCreate>;

// ─── Raid ──────────────────────────────────────────────────────────────────────

export interface Raid {
clean: number;
/** The sentence PoracleNG renders for this rule, in the alert language. Read-only. */
description?: null | string;
/** Costume filter on the boss: 9000 any, 0 none, N that costume. See shared/utils/costumes.ts. */
costume: number;

Check warning on line 61 in Applications/Pgan.PoracleWebNet.App/ClientApp/src/app/core/models/index.ts

View workflow job for this annotation

GitHub Actions / Frontend (Angular)

Expected "costume" to come before "description"
distance: number;
evolution: number;
exclusive: number;
Expand All @@ -74,14 +78,16 @@
uid: number;
}

export type RaidCreate = Omit<Raid, 'uid' | 'id' | 'profileNo'>;
export type RaidCreate = Omit<Raid, 'description' | 'uid' | 'id' | 'profileNo'>;

export type RaidUpdate = Partial<RaidCreate>;

// ─── Max Battle ───────────────────────────────────────────────────────────────

export interface MaxBattle {
clean: number;
/** The sentence PoracleNG renders for this rule, in the alert language. Read-only. */
description?: null | string;
distance: number;
evolution: number;
form: number;
Expand All @@ -99,14 +105,16 @@
uid: number;
}

export type MaxBattleCreate = Omit<MaxBattle, 'uid' | 'id' | 'profileNo'>;
export type MaxBattleCreate = Omit<MaxBattle, 'description' | 'uid' | 'id' | 'profileNo'>;

export type MaxBattleUpdate = Partial<MaxBattleCreate>;

// ─── Egg ───────────────────────────────────────────────────────────────────────

export interface Egg {
clean: number;
/** The sentence PoracleNG renders for this rule, in the alert language. Read-only. */
description?: null | string;
distance: number;
exclusive: number;
gymId: string | null;
Expand All @@ -122,7 +130,7 @@
uid: number;
}

export type EggCreate = Omit<Egg, 'uid' | 'id' | 'profileNo'>;
export type EggCreate = Omit<Egg, 'description' | 'uid' | 'id' | 'profileNo'>;

export type EggUpdate = Partial<EggCreate>;

Expand All @@ -132,6 +140,8 @@
/** Fewest of the reward the quest must give. Items, candy and mega energy only; 0 means any. */
amount: number;
clean: number;
/** The sentence PoracleNG renders for this rule, in the alert language. Read-only. */
description?: null | string;
distance: number;
id: string;
overrideAreas?: null | string[];
Expand All @@ -146,14 +156,16 @@
uid: number;
}

export type QuestCreate = Omit<Quest, 'uid' | 'id' | 'profileNo'>;
export type QuestCreate = Omit<Quest, 'description' | 'uid' | 'id' | 'profileNo'>;

export type QuestUpdate = Partial<QuestCreate>;

// ─── Invasion ──────────────────────────────────────────────────────────────────

export interface Invasion {
clean: number;
/** The sentence PoracleNG renders for this rule, in the alert language. Read-only. */
description?: null | string;
distance: number;
gender: number;
gruntType: string | null;
Expand All @@ -166,14 +178,16 @@
uid: number;
}

export type InvasionCreate = Omit<Invasion, 'uid' | 'id' | 'profileNo'>;
export type InvasionCreate = Omit<Invasion, 'description' | 'uid' | 'id' | 'profileNo'>;

export type InvasionUpdate = Partial<InvasionCreate>;

// ─── Lure ──────────────────────────────────────────────────────────────────────

export interface Lure {
clean: number;
/** The sentence PoracleNG renders for this rule, in the alert language. Read-only. */
description?: null | string;
distance: number;
id: string;
lureId: number;
Expand All @@ -185,14 +199,16 @@
uid: number;
}

export type LureCreate = Omit<Lure, 'uid' | 'id' | 'profileNo'>;
export type LureCreate = Omit<Lure, 'description' | 'uid' | 'id' | 'profileNo'>;

export type LureUpdate = Partial<LureCreate>;

// ─── Nest ──────────────────────────────────────────────────────────────────────

export interface Nest {
clean: number;
/** The sentence PoracleNG renders for this rule, in the alert language. Read-only. */
description?: null | string;
distance: number;
id: string;
minSpawnAvg: number;
Expand All @@ -205,14 +221,16 @@
uid: number;
}

export type NestCreate = Omit<Nest, 'uid' | 'id' | 'profileNo'>;
export type NestCreate = Omit<Nest, 'description' | 'uid' | 'id' | 'profileNo'>;

export type NestUpdate = Partial<NestCreate>;

// ─── Fort Change ──────────────────────────────────────────────────────────────

export interface FortChange {
changeTypes: string[];
/** The sentence PoracleNG renders for this rule, in the alert language. Read-only. */
description?: null | string;
distance: number;
fortType: string | null;
id: string;
Expand All @@ -225,7 +243,7 @@
uid: number;
}

export type FortChangeCreate = Omit<FortChange, 'uid' | 'id' | 'profileNo'>;
export type FortChangeCreate = Omit<FortChange, 'description' | 'uid' | 'id' | 'profileNo'>;

export type FortChangeUpdate = Partial<FortChangeCreate>;

Expand All @@ -234,6 +252,8 @@
export interface Gym {
battleChanges: number;
clean: number;
/** The sentence PoracleNG renders for this rule, in the alert language. Read-only. */
description?: null | string;
distance: number;
gymId: string | null;
id: string;
Expand All @@ -247,7 +267,7 @@
uid: number;
}

export type GymCreate = Omit<Gym, 'uid' | 'id' | 'profileNo'>;
export type GymCreate = Omit<Gym, 'description' | 'uid' | 'id' | 'profileNo'>;

export type GymUpdate = Partial<GymCreate>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ export class AlertLanguageService {
/** Every language Poracle can write alerts in. */
readonly languages = this.i18n.allLanguages;

/**
* The language Poracle will actually write in, or null when we cannot tell.
*
* Deliberately not `selected()`. That one coerces to 'en' so the picker always has a row highlighted,
* which is right for a menu and wrong for anything that acts on the answer: when Poracle's own locale
* maps onto no UI language (ja, ru, zh-cn), coercing would claim English and put Japanese prose on an
* English card. Null says "unknown", and callers are expected to do nothing rather than guess.
*/
readonly resolved = computed<string | null>(() => this.chosen() ?? this.i18n.serverDefaultLanguage());

readonly selected = computed(() => this.chosen() ?? this.i18n.serverDefaultLanguage() ?? 'en');

/** Sets the alert language, rolling back if the write fails. Returns whether it stuck. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ <h3>{{ getTeamName(gym.team) }}</h3>
[profileAreas]="profileAreas()"
(click)="editScope(gym); $event.stopPropagation()" />
</div>
<app-rule-summary [text]="gym.description" />
</mat-card-content>
<mat-card-actions align="end">
@if (gym.gymId; as gymId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
import { TestAlertService } from '../../core/services/test-alert.service';
import { ConfirmDialogComponent, ConfirmDialogData } from '../../shared/components/confirm-dialog/confirm-dialog.component';
import { DistanceDialogComponent } from '../../shared/components/distance-dialog/distance-dialog.component';
import { RuleSummaryComponent } from '../../shared/components/rule-summary/rule-summary.component';
import { QuietChipComponent } from '../../shared/components/quiet-chip/quiet-chip.component';

Check warning on line 26 in Applications/Pgan.PoracleWebNet.App/ClientApp/src/app/modules/gyms/gym-list.component.ts

View workflow job for this annotation

GitHub Actions / Frontend (Angular)

`../../shared/components/quiet-chip/quiet-chip.component` import should occur before import of `../../shared/components/rule-summary/rule-summary.component`
import { WhereChipComponent } from '../../shared/components/where-chip/where-chip.component';
import { WhereSheetComponent, WhereSheetData } from '../../shared/components/where-sheet/where-sheet.component';
import { AlarmScope, scopeOf, scopeToFields } from '../../shared/utils/alarm-scope';
Expand All @@ -40,6 +41,7 @@
MatTooltipModule,
MatSnackBarModule,
MatProgressSpinnerModule,
RuleSummaryComponent,
TranslatePipe,
WhereChipComponent,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ <h3>{{ getDisplayName(invasion.gruntType, invasion.gender) }}</h3>
[profileAreas]="profileAreas()"
(click)="editScope(invasion); $event.stopPropagation()" />
</div>
<app-rule-summary [text]="invasion.description" />
</mat-card-content>
<mat-card-actions align="end">
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { MasterDataService } from '../../core/services/masterdata.service';
import { TestAlertService } from '../../core/services/test-alert.service';
import { ConfirmDialogComponent, ConfirmDialogData } from '../../shared/components/confirm-dialog/confirm-dialog.component';
import { DistanceDialogComponent } from '../../shared/components/distance-dialog/distance-dialog.component';
import { RuleSummaryComponent } from '../../shared/components/rule-summary/rule-summary.component';
import { WhereChipComponent } from '../../shared/components/where-chip/where-chip.component';
import { WhereSheetComponent, WhereSheetData } from '../../shared/components/where-sheet/where-sheet.component';
import { AlarmScope, scopeOf, scopeToFields } from '../../shared/utils/alarm-scope';
Expand All @@ -46,6 +47,7 @@ import { isAutoDelete as cleanIsAutoDelete } from '../../shared/utils/clean-flag
MatTooltipModule,
MatSnackBarModule,
MatProgressSpinnerModule,
RuleSummaryComponent,
TranslatePipe,
WhereChipComponent,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ <h3>{{ getLureName(lure.lureId) }} {{ 'LURES.LURE_SUFFIX' | translate }}</h3>
[profileAreas]="profileAreas()"
(click)="editScope(lure); $event.stopPropagation()" />
</div>
<app-rule-summary [text]="lure.description" />
</mat-card-content>
<mat-card-actions align="end">
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { LureService } from '../../core/services/lure.service';
import { TestAlertService } from '../../core/services/test-alert.service';
import { ConfirmDialogComponent, ConfirmDialogData } from '../../shared/components/confirm-dialog/confirm-dialog.component';
import { DistanceDialogComponent } from '../../shared/components/distance-dialog/distance-dialog.component';
import { RuleSummaryComponent } from '../../shared/components/rule-summary/rule-summary.component';
import { WhereChipComponent } from '../../shared/components/where-chip/where-chip.component';
import { WhereSheetComponent, WhereSheetData } from '../../shared/components/where-sheet/where-sheet.component';
import { AlarmScope, scopeOf, scopeToFields } from '../../shared/utils/alarm-scope';
Expand All @@ -37,6 +38,7 @@ import { AlarmScope, scopeOf, scopeToFields } from '../../shared/utils/alarm-sco
MatTooltipModule,
MatSnackBarModule,
MatProgressSpinnerModule,
RuleSummaryComponent,
TranslatePipe,
WhereChipComponent,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ <h3>{{ getTitle(mb) }}</h3>
[template]="mb.template"
[editable]="true"
(click)="editScope(mb); $event.stopPropagation()" />
<app-rule-summary [text]="mb.description" />
</mat-card-content>
<mat-card-actions align="end">
@if (mb.stationId; as stationId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
import { AlarmInfoComponent } from '../../shared/components/alarm-info/alarm-info.component';
import { ConfirmDialogComponent, ConfirmDialogData } from '../../shared/components/confirm-dialog/confirm-dialog.component';
import { DistanceDialogComponent } from '../../shared/components/distance-dialog/distance-dialog.component';
import { RuleSummaryComponent } from '../../shared/components/rule-summary/rule-summary.component';
import { QuietChipComponent } from '../../shared/components/quiet-chip/quiet-chip.component';

Check warning on line 25 in Applications/Pgan.PoracleWebNet.App/ClientApp/src/app/modules/max-battles/max-battle-list.component.ts

View workflow job for this annotation

GitHub Actions / Frontend (Angular)

`../../shared/components/quiet-chip/quiet-chip.component` import should occur before import of `../../shared/components/rule-summary/rule-summary.component`
import { WhereSheetComponent, WhereSheetData } from '../../shared/components/where-sheet/where-sheet.component';
import { AlarmScope, scopeOf, scopeToFields } from '../../shared/utils/alarm-scope';

Expand All @@ -36,6 +37,7 @@
MatDialogModule,
MatTooltipModule,
MatSnackBarModule,
RuleSummaryComponent,
TranslatePipe,
AlarmInfoComponent,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ <h3>{{ getPokemonName(nest.pokemonId) }}</h3>
[profileAreas]="profileAreas()"
(click)="editScope(nest); $event.stopPropagation()" />
</div>
<app-rule-summary [text]="nest.description" />
</mat-card-content>
<mat-card-actions align="end">
@if (nest.pokemonId > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
import { TestAlertService } from '../../core/services/test-alert.service';
import { ConfirmDialogComponent, ConfirmDialogData } from '../../shared/components/confirm-dialog/confirm-dialog.component';
import { DistanceDialogComponent } from '../../shared/components/distance-dialog/distance-dialog.component';
import { RuleSummaryComponent } from '../../shared/components/rule-summary/rule-summary.component';
import { QuietChipComponent } from '../../shared/components/quiet-chip/quiet-chip.component';

Check warning on line 27 in Applications/Pgan.PoracleWebNet.App/ClientApp/src/app/modules/nests/nest-list.component.ts

View workflow job for this annotation

GitHub Actions / Frontend (Angular)

`../../shared/components/quiet-chip/quiet-chip.component` import should occur before import of `../../shared/components/rule-summary/rule-summary.component`
import { WhereChipComponent } from '../../shared/components/where-chip/where-chip.component';
import { WhereSheetComponent, WhereSheetData } from '../../shared/components/where-sheet/where-sheet.component';
import { AlarmScope, scopeOf, scopeToFields } from '../../shared/utils/alarm-scope';
Expand All @@ -42,6 +43,7 @@
MatTooltipModule,
MatSnackBarModule,
MatProgressSpinnerModule,
RuleSummaryComponent,
TranslatePipe,
WhereChipComponent,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ <h3>{{ getPokemonName(monster.pokemonId) }}</h3>
}}</span>
</div>
}
<app-rule-summary [text]="monster.description" />
</mat-card-content>
<mat-card-actions align="end">
<!-- Species, not this one rule: quieting Pikachu quiets every Pikachu alert for an hour. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
import { TestAlertService } from '../../core/services/test-alert.service';
import { ConfirmDialogComponent, ConfirmDialogData } from '../../shared/components/confirm-dialog/confirm-dialog.component';
import { DistanceDialogComponent } from '../../shared/components/distance-dialog/distance-dialog.component';
import { RuleSummaryComponent } from '../../shared/components/rule-summary/rule-summary.component';
import { QuietChipComponent } from '../../shared/components/quiet-chip/quiet-chip.component';

Check warning on line 32 in Applications/Pgan.PoracleWebNet.App/ClientApp/src/app/modules/pokemon/pokemon-list.component.ts

View workflow job for this annotation

GitHub Actions / Frontend (Angular)

`../../shared/components/quiet-chip/quiet-chip.component` import should occur before import of `../../shared/components/rule-summary/rule-summary.component`
import { WhereChipComponent } from '../../shared/components/where-chip/where-chip.component';
import { WhereSheetComponent, WhereSheetData } from '../../shared/components/where-sheet/where-sheet.component';
import { AlarmScope, scopeOf, scopeToFields } from '../../shared/utils/alarm-scope';
Expand All @@ -54,6 +55,7 @@
MatFormFieldModule,
MatInputModule,
MatSelectModule,
RuleSummaryComponent,
TranslatePipe,
WhereChipComponent,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ <h3>{{ getQuestTitle(quest) }}</h3>
[template]="quest.template"
[editable]="true"
(click)="editScope(quest); $event.stopPropagation()" />
<app-rule-summary [text]="quest.description" />
</mat-card-content>
<mat-card-actions align="end">
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { TestAlertService } from '../../core/services/test-alert.service';
import { AlarmInfoComponent } from '../../shared/components/alarm-info/alarm-info.component';
import { ConfirmDialogComponent, ConfirmDialogData } from '../../shared/components/confirm-dialog/confirm-dialog.component';
import { DistanceDialogComponent } from '../../shared/components/distance-dialog/distance-dialog.component';
import { RuleSummaryComponent } from '../../shared/components/rule-summary/rule-summary.component';
import { WhereSheetComponent, WhereSheetData } from '../../shared/components/where-sheet/where-sheet.component';
import { AlarmScope, scopeOf, scopeToFields } from '../../shared/utils/alarm-scope';

Expand All @@ -39,6 +40,7 @@ import { AlarmScope, scopeOf, scopeToFields } from '../../shared/utils/alarm-sco
MatDialogModule,
MatTooltipModule,
MatSnackBarModule,
RuleSummaryComponent,
TranslatePipe,
AlarmInfoComponent,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ <h3>{{ getRaidTitle(raid) }}</h3>
[template]="raid.template"
[editable]="true"
(click)="editScope(raid, 'raid'); $event.stopPropagation()" />
<app-rule-summary [text]="raid.description" />
</mat-card-content>
<mat-card-actions align="end">
<!-- The gym, not the raid rule: quieting a gym silences every raid and egg alert there. -->
Expand Down Expand Up @@ -252,6 +253,7 @@ <h3>{{ getRaidLevelName(egg.level) }} {{ 'RAIDS.EGG_SUFFIX' | translate }}</h3>
[template]="egg.template"
[editable]="true"
(click)="editScope(egg, 'egg'); $event.stopPropagation()" />
<app-rule-summary [text]="egg.description" />
</mat-card-content>
<mat-card-actions align="end">
@if (egg.gymId; as eggGymId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { ConfirmDialogComponent, ConfirmDialogData } from '../../shared/componen
import { DistanceDialogComponent } from '../../shared/components/distance-dialog/distance-dialog.component';
import { QuietChipComponent } from '../../shared/components/quiet-chip/quiet-chip.component';
import { RsvpPillComponent } from '../../shared/components/rsvp-pill/rsvp-pill.component';
import { RuleSummaryComponent } from '../../shared/components/rule-summary/rule-summary.component';
import { WhereSheetComponent, WhereSheetData } from '../../shared/components/where-sheet/where-sheet.component';
import { LevelLabelPipe } from '../../shared/pipes/level-label.pipe';
import { AlarmScope, scopeOf, scopeToFields } from '../../shared/utils/alarm-scope';
Expand All @@ -46,6 +47,7 @@ import { NO_COSTUME } from '../../shared/utils/costumes';
MatTooltipModule,
MatSnackBarModule,
MatTabsModule,
RuleSummaryComponent,
TranslatePipe,
AlarmInfoComponent,
RsvpPillComponent,
Expand Down
Loading
Loading