@glissandoo/lib 1.53.7 → 1.53.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lang/pt.json CHANGED
@@ -46,6 +46,7 @@
46
46
  "instruments.agogo": "Agogô",
47
47
  "instruments.altoClarinet": "Clarinete Alto",
48
48
  "instruments.altoSaxophone": "Saxofone alto",
49
+ "instruments.auxiliar": "Assistente",
49
50
  "instruments.bagpipes": "Gaita de Foles",
50
51
  "instruments.bandurria": "Bandurria",
51
52
  "instruments.banjo": "Banjo",
@@ -77,6 +78,7 @@
77
78
  "instruments.englishHorn": "Corne Inglês",
78
79
  "instruments.euphonium": "Eufónio",
79
80
  "instruments.flabiol": "Flabiol",
81
+ "instruments.flagBearer": "Porta-estandarte",
80
82
  "instruments.flugelhorn": "Fliscorne",
81
83
  "instruments.flute": "Flauta",
82
84
  "instruments.frenchHorn": "Trompa",
@@ -275,8 +277,8 @@
275
277
  "repertoireTags.4": "4º",
276
278
  "repertoireTags.principal": "Principal",
277
279
  "sections.all": "Todos",
278
- "theme.claim.new.text": "{string:user.0.displayName} uma revisão em {instrument:extra.instrumentId} para “{string:extra.title}”",
280
+ "theme.claim.new.text": "{string:user.0.displayName} uma revisão em {instrument:extra.[instrumentId,customInstrumentName]} para “{string:extra.title}”",
279
281
  "theme.claim.new.title": "Uma revisão da partitura foi enviada por um músico",
280
- "theme.claim.update.text": "A partitura {instrument:extra.instrumentId} da obra “{string:extra.title}” foi adicionada.",
281
- "theme.claim.update.title": "Nova partitura {instrument:extra.instrumentId} foi adicionada"
282
+ "theme.claim.update.text": "A partitura {instrument:extra.[instrumentId,customInstrumentName]} da obra “{string:extra.title}” foi adicionada.",
283
+ "theme.claim.update.title": "Nova partitura {instrument:extra.[instrumentId,customInstrumentName]} foi adicionada"
282
284
  }
@@ -66,8 +66,13 @@ export default class Group extends GroupBasic<GroupData> {
66
66
  get trialEndAt(): Date;
67
67
  get glissandooAdminUrl(): string;
68
68
  get createdOn(): import("./types").GroupCreatedOn;
69
- get instruments(): Partial<Record<import("../../helpers/instruments").InstrumentId, import("./types").GroupInstrument>>;
70
- get instrumentsList(): import("../../helpers/instruments").InstrumentId[];
69
+ get instruments(): Partial<Record<import("../../helpers/instruments").DefaultInstrumentId, import("./types").DefaultGroupInstrument>> & Record<`customInstrument-${string}`, import("./types").CustomGroupInstrument>;
70
+ get instrumentsList(): Pick<(import("./types").DefaultGroupInstrument & {
71
+ id: import("../../helpers/instruments").DefaultInstrumentId | `customInstrument-${string}`;
72
+ }) | (import("./types").CustomGroupInstrument & {
73
+ id: import("../../helpers/instruments").DefaultInstrumentId | `customInstrument-${string}`;
74
+ }), "id">[];
75
+ get instrumentsIds(): (import("../../helpers/instruments").DefaultInstrumentId | `customInstrument-${string}`)[];
71
76
  get visitedDashboardAt(): Record<string, import("../../types/firestore").Timestamp>;
72
77
  get onboardingMessages(): import("./types").GroupOnboardingMessage[];
73
78
  }
@@ -189,7 +189,10 @@ class Group extends basic_1.default {
189
189
  return this.data.instruments || {};
190
190
  }
191
191
  get instrumentsList() {
192
- return (0, objects_1.orderedMapToArray)(this.instruments).map(({ id }) => id);
192
+ return (0, objects_1.orderedMapToArray)(this.instruments);
193
+ }
194
+ get instrumentsIds() {
195
+ return this.instrumentsList.map(({ id }) => id);
193
196
  }
194
197
  get visitedDashboardAt() {
195
198
  return this.data.visitedDashboardAt || null;
@@ -1,4 +1,4 @@
1
- import { InstrumentId } from '../../helpers/instruments';
1
+ import { CustomInstrumentId, DefaultInstrumentId } from '../../helpers/instruments';
2
2
  import { MusicStyleType } from '../../helpers/musicStyles';
3
3
  import { PlansGroup } from '../../helpers/plans';
4
4
  import { DocumentReference, GeoPoint, Timestamp } from '../../types/firestore';
@@ -91,12 +91,21 @@ export interface GroupRepertoireTag {
91
91
  export interface AGroupRepertoireTag extends GroupRepertoireTag {
92
92
  id: string;
93
93
  }
94
- export interface GroupInstrument {
94
+ export interface DefaultGroupInstrument {
95
95
  order: number;
96
96
  }
97
- export interface AGroupInstrument extends GroupInstrument {
98
- id: InstrumentId;
97
+ export interface CustomGroupInstrument extends DefaultGroupInstrument {
98
+ icon: string;
99
+ name: string;
100
+ basedOnInstrument: DefaultInstrumentId;
99
101
  }
102
+ export interface AGroupDefaultInstrument extends DefaultGroupInstrument {
103
+ id: DefaultInstrumentId;
104
+ }
105
+ export interface AGroupCustomInstrument extends CustomGroupInstrument {
106
+ id: CustomInstrumentId;
107
+ }
108
+ export type AGroupInstrument = AGroupDefaultInstrument | AGroupCustomInstrument;
100
109
  export interface GroupData extends GroupBasicData {
101
110
  playerIds: string[];
102
111
  players: Record<string, PlayerBasicData>;
@@ -124,7 +133,7 @@ export interface GroupData extends GroupBasicData {
124
133
  eventCount: Record<EventType, number>;
125
134
  communicationCount: number;
126
135
  country: string;
127
- instruments: Partial<Record<InstrumentId, GroupInstrument>>;
136
+ instruments: Partial<Record<DefaultInstrumentId, DefaultGroupInstrument>> & Record<CustomInstrumentId, CustomGroupInstrument>;
128
137
  metadata: Record<string, string>;
129
138
  firstAnswerAt: Timestamp | null;
130
139
  repertoireTags: Record<string, GroupRepertoireTag>;
@@ -0,0 +1,12 @@
1
+ import Instrument from '.';
2
+ import { CustomInstrumentId, InstrumentId } from '../../helpers/instruments';
3
+ import { LanguagesTypes } from '../../lang';
4
+ import { GroupData } from '../Group/types';
5
+ export default class GroupInstrument extends Instrument {
6
+ private groupInstruments;
7
+ constructor(id: InstrumentId, lang: LanguagesTypes | undefined, groupInstruments: GroupData['instruments']);
8
+ static isCustom(instrumentId: InstrumentId): instrumentId is CustomInstrumentId;
9
+ get isCustomInstrument(): boolean;
10
+ get name(): string;
11
+ get icon(): string;
12
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const _1 = __importDefault(require("."));
7
+ const lang_1 = require("../../lang");
8
+ class GroupInstrument extends _1.default {
9
+ constructor(id, lang = lang_1.defaultLocale, groupInstruments) {
10
+ super(id, lang);
11
+ this.groupInstruments = groupInstruments;
12
+ }
13
+ static isCustom(instrumentId) {
14
+ return instrumentId.startsWith('customInstrument-');
15
+ }
16
+ get isCustomInstrument() {
17
+ return GroupInstrument.isCustom(this.id);
18
+ }
19
+ get name() {
20
+ return GroupInstrument.isCustom(this.id) && this.id in this.groupInstruments
21
+ ? this.groupInstruments[this.id].name
22
+ : super.name;
23
+ }
24
+ get icon() {
25
+ return GroupInstrument.isCustom(this.id) && this.id in this.groupInstruments
26
+ ? this.groupInstruments[this.id].icon
27
+ : super.icon;
28
+ }
29
+ }
30
+ exports.default = GroupInstrument;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissandoo/lib",
3
- "version": "1.53.7",
3
+ "version": "1.53.8",
4
4
  "description": "Glissandoo library js",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",