@glissandoo/lib 1.17.0 → 1.17.1

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.
@@ -1,3 +1,4 @@
1
+ import { MusicStyleType } from '../../../../../helpers/musicStyles';
1
2
  import { LanguagesTypes } from '../../../../../lang';
2
3
  import { FileSectionId } from './types';
3
4
  export default class GroupRepertoryFileSection {
@@ -5,4 +6,5 @@ export default class GroupRepertoryFileSection {
5
6
  private lang;
6
7
  constructor(id: FileSectionId, lang?: LanguagesTypes);
7
8
  get name(): string;
9
+ getOrder(musicStyle: MusicStyleType): number;
8
10
  }
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const orders_1 = require("../../../../../helpers/fileSections/orders");
6
7
  const lang_1 = require("../../../../../lang");
7
8
  const Instrument_1 = __importDefault(require("../../../../Instrument"));
8
9
  const types_1 = require("./types");
@@ -16,5 +17,8 @@ class GroupRepertoryFileSection {
16
17
  ? lang_1.getTranslation(`sections.all`, this.lang)
17
18
  : new Instrument_1.default(this.id).name) || this.id);
18
19
  }
20
+ getOrder(musicStyle) {
21
+ return orders_1.getOrderByMusicStyle(musicStyle).indexOf(this.id) + 1 || Infinity;
22
+ }
19
23
  }
20
24
  exports.default = GroupRepertoryFileSection;
@@ -36,6 +36,7 @@ export interface AGroupRepertoireScoreFilePage extends GroupRepertoireScoreFileP
36
36
  id: FileSectionId;
37
37
  }
38
38
  declare type PageNumber = string;
39
+ declare type FileId = string;
39
40
  export interface GroupRepertoireFileSections {
40
41
  tags?: string[];
41
42
  pages?: Record<PageNumber, GroupRepertoireScoreFilePage>;
@@ -67,7 +68,7 @@ export interface GroupRepertoryData extends ThemeBasicData {
67
68
  audios: string[];
68
69
  /** @deprecated */
69
70
  identifyAt: Timestamp | null;
70
- files: Record<string, GroupRepertoireFile>;
71
+ files: Record<FileId, GroupRepertoireFile>;
71
72
  filesPath: Partial<Record<FileSectionId, GroupRepertoireFilePathItem[]>>;
72
73
  votes: Record<string, number>;
73
74
  thumbnailURL: string | null;
@@ -2,7 +2,7 @@ import { DocumentReference, DocumentSnapshot } from '@google-cloud/firestore';
2
2
  import { PlansGroup } from '../../helpers/plans';
3
3
  import { LanguagesTypes } from '../../lang';
4
4
  import GroupBasic from './basic';
5
- import { GroupData, GroupRepertoireTag, GroupStatus, SocialNetwork } from './types';
5
+ import { GroupData, GroupStatus, SocialNetwork } from './types';
6
6
  export default class Group extends GroupBasic<GroupData> {
7
7
  constructor(doc: DocumentSnapshot, lang?: LanguagesTypes);
8
8
  get owner(): DocumentReference;
@@ -61,10 +61,9 @@ export default class Group extends GroupBasic<GroupData> {
61
61
  id: string;
62
62
  })[];
63
63
  get firstAnswerAt(): FirebaseFirestore.Timestamp | null;
64
- get repertoireTags(): Record<string, GroupRepertoireTag>;
65
- get repertoireTagsList(): (GroupRepertoireTag & {
64
+ get repertoireTags(): Record<string, import("./types").GroupRepertoireTag>;
65
+ get repertoireTagsList(): (import("./types").GroupRepertoireTag & {
66
66
  id: string;
67
67
  })[];
68
68
  getRepertoireTagName(id: string): string | null;
69
- getRepertoireTagNameTranslator(): (id: string, repertoireTags?: Record<string, GroupRepertoireTag>, lang?: LanguagesTypes) => string | null;
70
69
  }
@@ -174,13 +174,5 @@ class Group extends basic_1.default {
174
174
  const tag = this.repertoireTags[id];
175
175
  return tag.default ? lang_1.getTranslation(tag.title, this.lang) : tag.title;
176
176
  }
177
- getRepertoireTagNameTranslator() {
178
- return (id, repertoireTags = { ...this.repertoireTags }, lang = this.lang) => {
179
- if (!(id in repertoireTags))
180
- return null;
181
- const tag = repertoireTags[id];
182
- return tag.default ? lang_1.getTranslation(tag.title, lang) : tag.title;
183
- };
184
- }
185
177
  }
186
178
  exports.default = Group;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissandoo/lib",
3
- "version": "1.17.0",
3
+ "version": "1.17.1",
4
4
  "description": "Glissandoo library js",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",