@glissandoo/lib 1.79.0 → 1.81.0

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.
@@ -56,7 +56,19 @@ export declare enum AppScenes {
56
56
  Group = "group",
57
57
  GroupPlayer = "groupPlayer",
58
58
  GroupsNavigation = "GroupsNavigation",
59
+ GroupTab = "GroupTab",
59
60
  GroupView = "GroupView",
61
+ GroupPlayerEditInstruments = "GroupPlayerEditInstruments",
62
+ GroupSettings = "GroupSettings",
63
+ GroupSettingsStack = "GroupSettingsStack",
64
+ GroupSettingsDisplayName = "GroupSettingsDisplayName",
65
+ GroupSettingsUsername = "GroupSettingsUsername",
66
+ GroupSettingsMusicStyle = "GroupSettingsMusicStyle",
67
+ GroupSettingsLocality = "GroupSettingsLocality",
68
+ GroupSettingsPhotoURL = "GroupSettingsPhotoURL",
69
+ GroupSettingsDelete = "GroupSettingsDelete",
70
+ GroupSettingsConfigShowAttendance = "GroupSettingsConfigShowAttendance",
71
+ GroupSettingsAddresses = "GroupSettingsAddresses",
60
72
  Join = "Join",
61
73
  JoinImageProfile = "AddProfileImage",
62
74
  JoinInstrument = "SelectGroupInstrument",
@@ -75,6 +87,7 @@ export declare enum AppScenes {
75
87
  ThemeView = "ThemeView",
76
88
  VisorImage = "visorImage",
77
89
  VisorPDF = "visorPDF",
90
+ VisorQR = "VisorQR",
78
91
  NewGroup = "NewGroup",
79
92
  NewGroupInfo = "NewGroupInfo",
80
93
  NewGroupMusicStyle = "NewGroupMusicStyle",
@@ -60,7 +60,19 @@ var AppScenes;
60
60
  AppScenes["Group"] = "group";
61
61
  AppScenes["GroupPlayer"] = "groupPlayer";
62
62
  AppScenes["GroupsNavigation"] = "GroupsNavigation";
63
+ AppScenes["GroupTab"] = "GroupTab";
63
64
  AppScenes["GroupView"] = "GroupView";
65
+ AppScenes["GroupPlayerEditInstruments"] = "GroupPlayerEditInstruments";
66
+ AppScenes["GroupSettings"] = "GroupSettings";
67
+ AppScenes["GroupSettingsStack"] = "GroupSettingsStack";
68
+ AppScenes["GroupSettingsDisplayName"] = "GroupSettingsDisplayName";
69
+ AppScenes["GroupSettingsUsername"] = "GroupSettingsUsername";
70
+ AppScenes["GroupSettingsMusicStyle"] = "GroupSettingsMusicStyle";
71
+ AppScenes["GroupSettingsLocality"] = "GroupSettingsLocality";
72
+ AppScenes["GroupSettingsPhotoURL"] = "GroupSettingsPhotoURL";
73
+ AppScenes["GroupSettingsDelete"] = "GroupSettingsDelete";
74
+ AppScenes["GroupSettingsConfigShowAttendance"] = "GroupSettingsConfigShowAttendance";
75
+ AppScenes["GroupSettingsAddresses"] = "GroupSettingsAddresses";
64
76
  AppScenes["Join"] = "Join";
65
77
  AppScenes["JoinImageProfile"] = "AddProfileImage";
66
78
  AppScenes["JoinInstrument"] = "SelectGroupInstrument";
@@ -79,6 +91,7 @@ var AppScenes;
79
91
  AppScenes["ThemeView"] = "ThemeView";
80
92
  AppScenes["VisorImage"] = "visorImage";
81
93
  AppScenes["VisorPDF"] = "visorPDF";
94
+ AppScenes["VisorQR"] = "VisorQR";
82
95
  AppScenes["NewGroup"] = "NewGroup";
83
96
  AppScenes["NewGroupInfo"] = "NewGroupInfo";
84
97
  AppScenes["NewGroupMusicStyle"] = "NewGroupMusicStyle";
@@ -1,7 +1,4 @@
1
- import { FileSectionId } from '../../models/Group/Repertory/File/Section/types';
2
- import { MusicStyleType } from '../musicStyles/index';
3
- export declare const orders: {
4
- [k: string]: FileSectionId[];
5
- };
6
- export declare const getOrderByMusicStyle: (musicStyle: MusicStyleType) => FileSectionId[];
7
- export declare const orderByMusicStyle: <T>(list: T[], field: keyof T, musicStyle: MusicStyleType) => T[];
1
+ import { FileSectionIdReserved } from '../../models/Group/Repertory/File/Section/types';
2
+ import { InstrumentId } from '../instruments';
3
+ export declare const getFileSectionsOrder: (instrumentsOrder: InstrumentId[]) => (InstrumentId | FileSectionIdReserved)[];
4
+ export declare const orderByInstruments: <T>(list: T[], field: keyof T, instrumentsOrder: InstrumentId[]) => T[];
@@ -1,20 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.orderByMusicStyle = exports.getOrderByMusicStyle = exports.orders = void 0;
3
+ exports.orderByInstruments = exports.getFileSectionsOrder = void 0;
4
4
  const types_1 = require("../../models/Group/Repertory/File/Section/types");
5
- const fileSections_1 = require("../fileSections");
6
- const orders_1 = require("../musicStyles/orders");
7
5
  const utils_1 = require("../utils");
8
- exports.orders = Object.fromEntries(Object.entries(orders_1.orders).map(([musicStyle, instruments]) => [
9
- musicStyle,
10
- [types_1.FileSectionIdReserved.All, ...instruments],
11
- ]));
12
- const getOrderByMusicStyle = (musicStyle) => {
13
- return musicStyle in exports.orders ? exports.orders[musicStyle] : fileSections_1.fileSectionIdList;
6
+ const getFileSectionsOrder = (instrumentsOrder) => [
7
+ types_1.FileSectionIdReserved.All,
8
+ ...instrumentsOrder,
9
+ ];
10
+ exports.getFileSectionsOrder = getFileSectionsOrder;
11
+ const orderByInstruments = (list, field, instrumentsOrder) => {
12
+ const fileSectionsOrder = (0, exports.getFileSectionsOrder)(instrumentsOrder);
13
+ return (0, utils_1.sortByMatch)(list, field, fileSectionsOrder);
14
14
  };
15
- exports.getOrderByMusicStyle = getOrderByMusicStyle;
16
- const orderByMusicStyle = (list, field, musicStyle) => {
17
- const order = (0, exports.getOrderByMusicStyle)(musicStyle);
18
- return (0, utils_1.sortByMatch)(list, field, order);
19
- };
20
- exports.orderByMusicStyle = orderByMusicStyle;
15
+ exports.orderByInstruments = orderByInstruments;
@@ -0,0 +1,2 @@
1
+ import { InstrumentId } from '.';
2
+ export declare const orderByInstruments: <T>(list: T[], field: keyof T, instrumentsOrder: InstrumentId[]) => T[];
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.orderByInstruments = void 0;
4
+ const utils_1 = require("../utils");
5
+ const orderByInstruments = (list, field, instrumentsOrder) => {
6
+ return (0, utils_1.sortByMatch)(list, field, instrumentsOrder);
7
+ };
8
+ exports.orderByInstruments = orderByInstruments;
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const date_fns_1 = require("date-fns");
7
7
  const lodash_1 = require("lodash");
8
8
  const orders_1 = require("../../helpers/musicStyles/orders");
9
- const utils_1 = require("../../helpers/utils");
10
9
  const lang_1 = require("../../lang");
11
10
  const basic_1 = __importDefault(require("./Player/basic"));
12
11
  const promoter_1 = __importDefault(require("./promoter"));
13
12
  const types_1 = require("./types");
13
+ const orders_2 = require("../../helpers/instruments/orders");
14
14
  class Evento extends promoter_1.default {
15
15
  constructor(doc, lang = lang_1.defaultLocale) {
16
16
  super(doc, lang);
@@ -141,7 +141,7 @@ class Evento extends promoter_1.default {
141
141
  }))
142
142
  : Object.entries(this.players).map(([id, player]) => new basic_1.default(this.id, { id, ...player }));
143
143
  const orderedPlayers = order
144
- ? (0, utils_1.sortByMatch)(players, 'mainInstrument', order)
144
+ ? (0, orders_2.orderByInstruments)(players, 'mainInstrument', order)
145
145
  : (0, orders_1.orderByMusicStyle)(players, 'mainInstrument', this.promoterInfo.musicStyle);
146
146
  if (showAll)
147
147
  return orderedPlayers;
@@ -1,4 +1,4 @@
1
- import { MusicStyleType } from '../../../../../helpers/musicStyles';
1
+ import { InstrumentId } from '../../../../../helpers/instruments';
2
2
  import { LanguagesTypes } from '../../../../../lang';
3
3
  import { FileSectionId } from './types';
4
4
  export default class GroupRepertoryFileSection {
@@ -6,5 +6,5 @@ export default class GroupRepertoryFileSection {
6
6
  private lang;
7
7
  constructor(id: FileSectionId, lang?: LanguagesTypes);
8
8
  get name(): string;
9
- getOrder(musicStyle: MusicStyleType): number;
9
+ getOrder(instrumentsIds: InstrumentId[]): number;
10
10
  }
@@ -17,8 +17,8 @@ class GroupRepertoryFileSection {
17
17
  ? (0, lang_1.getTranslation)(`sections.all`, this.lang)
18
18
  : new Instrument_1.default(this.id, this.lang).name) || this.id);
19
19
  }
20
- getOrder(musicStyle) {
21
- return (0, orders_1.getOrderByMusicStyle)(musicStyle).indexOf(this.id) + 1 || Infinity;
20
+ getOrder(instrumentsIds) {
21
+ return (0, orders_1.getFileSectionsOrder)(instrumentsIds).indexOf(this.id) + 1 || Infinity;
22
22
  }
23
23
  }
24
24
  exports.default = GroupRepertoryFileSection;
@@ -7,12 +7,12 @@ const date_fns_1 = require("date-fns");
7
7
  const lodash_1 = require("lodash");
8
8
  const collections_1 = require("../../helpers/collections");
9
9
  const glissandooAdmin_1 = require("../../helpers/glissandooAdmin");
10
- const orders_1 = require("../../helpers/musicStyles/orders");
11
10
  const objects_1 = require("../../helpers/objects");
12
11
  const plans_1 = require("../../helpers/plans");
13
12
  const lang_1 = require("../../lang");
14
13
  const basic_1 = __importDefault(require("./basic"));
15
14
  const types_1 = require("./types");
15
+ const orders_1 = require("../../helpers/instruments/orders");
16
16
  class Group extends basic_1.default {
17
17
  constructor(doc, lang = lang_1.defaultLocale) {
18
18
  super(doc, lang);
@@ -97,7 +97,7 @@ class Group extends basic_1.default {
97
97
  ...this.players[playerId],
98
98
  id: playerId,
99
99
  }));
100
- return (0, orders_1.orderByMusicStyle)(players, 'mainInstrument', this.musicStyle);
100
+ return (0, orders_1.orderByInstruments)(players, 'mainInstrument', this.instrumentsIds);
101
101
  }
102
102
  get isActive() {
103
103
  return this.exists && !this.deletedAt;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissandoo/lib",
3
- "version": "1.79.0",
3
+ "version": "1.81.0",
4
4
  "description": "Glissandoo library js",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",