ngx-edu-sharing-ui 10.0.29 → 10.0.30

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.
@@ -7358,6 +7358,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
7358
7358
  }]
7359
7359
  }] });
7360
7360
 
7361
+ class OptionsHelperDataGlobalService {
7362
+ constructor() {
7363
+ this.downloadUrl$ = new BehaviorSubject(null);
7364
+ }
7365
+ /**
7366
+ * used by rs: set a custom download url for the current service
7367
+ * i.e. if a special, temporary download url is available
7368
+ */
7369
+ setDownloadUrl(downloadUrl) {
7370
+ console.log('got custom download url', downloadUrl);
7371
+ this.downloadUrl$.next(downloadUrl);
7372
+ }
7373
+ observeDownloadUrl() {
7374
+ return this.downloadUrl$.asObservable();
7375
+ }
7376
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: OptionsHelperDataGlobalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
7377
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: OptionsHelperDataGlobalService, providedIn: 'root' }); }
7378
+ }
7379
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: OptionsHelperDataGlobalService, decorators: [{
7380
+ type: Injectable,
7381
+ args: [{
7382
+ providedIn: 'root'
7383
+ }]
7384
+ }], ctorParameters: () => [] });
7385
+
7361
7386
  class KeyboardShortcutsService {
7362
7387
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KeyboardShortcutsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
7363
7388
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KeyboardShortcutsService }); }
@@ -7370,7 +7395,7 @@ class OptionsHelperService {
7370
7395
  }
7371
7396
 
7372
7397
  class OptionsHelperDataService {
7373
- constructor(ngZone, route, localEvents, authenticationService, toast, userService, networkService, keyboardShortcutsService, optionsHelperService) {
7398
+ constructor(ngZone, route, localEvents, authenticationService, toast, userService, networkService, optionsHelperDataGlobalService, keyboardShortcutsService, optionsHelperService) {
7374
7399
  this.ngZone = ngZone;
7375
7400
  this.route = route;
7376
7401
  this.localEvents = localEvents;
@@ -7378,15 +7403,20 @@ class OptionsHelperDataService {
7378
7403
  this.toast = toast;
7379
7404
  this.userService = userService;
7380
7405
  this.networkService = networkService;
7406
+ this.optionsHelperDataGlobalService = optionsHelperDataGlobalService;
7381
7407
  this.keyboardShortcutsService = keyboardShortcutsService;
7382
7408
  this.optionsHelperService = optionsHelperService;
7383
- this.downloadUrl$ = new BehaviorSubject(null);
7384
7409
  this.destroyed = new Subject();
7385
7410
  this.virtualNodesAdded = new EventEmitter();
7386
7411
  this.nodesChanged = new EventEmitter();
7387
7412
  this.nodesDeleted = new EventEmitter();
7388
7413
  this.displayTypeChanged = new EventEmitter();
7389
7414
  this.registerStaticSubscriptions();
7415
+ this.optionsHelperDataGlobalService.observeDownloadUrl().subscribe(() => {
7416
+ if (this.data) {
7417
+ this.refreshComponents();
7418
+ }
7419
+ });
7390
7420
  }
7391
7421
  /** Performs subscriptions that don't have to be refreshed. */
7392
7422
  registerStaticSubscriptions() {
@@ -7412,22 +7442,14 @@ class OptionsHelperDataService {
7412
7442
  }
7413
7443
  }
7414
7444
  getData() {
7415
- return this.data;
7445
+ return {
7446
+ ...this.data,
7447
+ customDownloadUrl: this.optionsHelperDataGlobalService.downloadUrl$.value
7448
+ };
7416
7449
  }
7417
7450
  setData(data) {
7418
7451
  this.data = this.optionsHelperService?.wrapOptionCallbacks(data) || data;
7419
7452
  }
7420
- /**
7421
- * used by rs: set a custom download url for the current service
7422
- * i.e. if a special, temporary download url is available
7423
- */
7424
- setDownloadUrl(downloadUrl) {
7425
- console.log('got custom download url', downloadUrl);
7426
- this.downloadUrl$.next(downloadUrl);
7427
- if (this.data !== null) {
7428
- void this.refreshComponents();
7429
- }
7430
- }
7431
7453
  async refreshComponents() {
7432
7454
  if (this.data == null) {
7433
7455
  console.warn('options helper refresh called but no data previously bound');
@@ -7438,10 +7460,10 @@ class OptionsHelperDataService {
7438
7460
  return;
7439
7461
  }
7440
7462
  this.globalOptions = await this.getAvailableOptions(Target.Actionbar);
7441
- await this.optionsHelperService?.refreshComponents(this.components, this.data);
7463
+ await this.optionsHelperService?.refreshComponents(this.components, this.getData());
7442
7464
  }
7443
7465
  getAvailableOptions(target, objects = null) {
7444
- return this.optionsHelperService?.getAvailableOptions(target, objects, this.components, this.data);
7466
+ return this.optionsHelperService?.getAvailableOptions(target, objects, this.components, this.getData());
7445
7467
  }
7446
7468
  addVirtualObjects(objects) {
7447
7469
  objects = objects.map((o) => {
@@ -7481,7 +7503,7 @@ class OptionsHelperDataService {
7481
7503
  }
7482
7504
  }
7483
7505
  filterOptions(options, target, objects = null) {
7484
- return (this.optionsHelperService?.filterOptions(options, target, this.data, objects) || options);
7506
+ return (this.optionsHelperService?.filterOptions(options, target, this.getData(), objects) || options);
7485
7507
  }
7486
7508
  /**
7487
7509
  * shortcut to simply disable all options on the given compoennts
@@ -7497,14 +7519,14 @@ class OptionsHelperDataService {
7497
7519
  }
7498
7520
  }
7499
7521
  pasteNode(nodes = []) {
7500
- this.optionsHelperService.pasteNode(this.components, this.data, true, nodes);
7522
+ this.optionsHelperService.pasteNode(this.components, this.getData(), true, nodes);
7501
7523
  }
7502
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: OptionsHelperDataService, deps: [{ token: i0.NgZone }, { token: i2$1.ActivatedRoute }, { token: LocalEventsService }, { token: i2.AuthenticationService }, { token: Toast }, { token: i2.UserService }, { token: i2.NetworkService }, { token: KeyboardShortcutsService, optional: true }, { token: OptionsHelperService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
7524
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: OptionsHelperDataService, deps: [{ token: i0.NgZone }, { token: i2$1.ActivatedRoute }, { token: LocalEventsService }, { token: i2.AuthenticationService }, { token: Toast }, { token: i2.UserService }, { token: i2.NetworkService }, { token: OptionsHelperDataGlobalService }, { token: KeyboardShortcutsService, optional: true }, { token: OptionsHelperService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
7503
7525
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: OptionsHelperDataService }); }
7504
7526
  }
7505
7527
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: OptionsHelperDataService, decorators: [{
7506
7528
  type: Injectable
7507
- }], ctorParameters: () => [{ type: i0.NgZone }, { type: i2$1.ActivatedRoute }, { type: LocalEventsService }, { type: i2.AuthenticationService }, { type: Toast }, { type: i2.UserService }, { type: i2.NetworkService }, { type: KeyboardShortcutsService, decorators: [{
7529
+ }], ctorParameters: () => [{ type: i0.NgZone }, { type: i2$1.ActivatedRoute }, { type: LocalEventsService }, { type: i2.AuthenticationService }, { type: Toast }, { type: i2.UserService }, { type: i2.NetworkService }, { type: OptionsHelperDataGlobalService }, { type: KeyboardShortcutsService, decorators: [{
7508
7530
  type: Optional
7509
7531
  }] }, { type: OptionsHelperService, decorators: [{
7510
7532
  type: Optional
@@ -8341,12 +8363,11 @@ class NodeCache {
8341
8363
  }
8342
8364
 
8343
8365
  class RenderHelperService {
8344
- constructor(injector, aboutService, nodeApiUnwrapped, configuration, userService, optionsHelperDataService) {
8366
+ constructor(injector, aboutService, nodeApiUnwrapped, configuration, optionsHelperDataService) {
8345
8367
  this.injector = injector;
8346
8368
  this.aboutService = aboutService;
8347
8369
  this.nodeApiUnwrapped = nodeApiUnwrapped;
8348
8370
  this.configuration = configuration;
8349
- this.userService = userService;
8350
8371
  this.optionsHelperDataService = optionsHelperDataService;
8351
8372
  }
8352
8373
  async getRenderData(nodeId, version = null, repository = HOME_REPOSITORY) {
@@ -8357,8 +8378,6 @@ class RenderHelperService {
8357
8378
  version: version || RestConstants.NODE_VERSION_CURRENT,
8358
8379
  }));
8359
8380
  const node = securedNode.node;
8360
- const user = await firstValueFrom(this.userService.observeCurrentUserInfo());
8361
- console.info(this.injector.get(OptionsHelperDataService));
8362
8381
  this.optionsHelperDataService?.setData({
8363
8382
  scope: Scope.Render,
8364
8383
  activeObjects: [node],
@@ -8392,35 +8411,22 @@ class RenderHelperService {
8392
8411
  securedNode: securedNode.signedNode,
8393
8412
  signature: securedNode.signature,
8394
8413
  token: token,
8395
- userData: {
8396
- authorityName: user.user.person.authorityName,
8397
- firstName: user.user.person.profile.firstName,
8398
- surName: user.user.person.profile.lastName,
8399
- userEMail: user.user.person.profile.email,
8400
- },
8401
8414
  };
8402
8415
  return {
8403
8416
  node,
8404
8417
  request,
8405
8418
  };
8406
8419
  }
8407
- async getRenderDataForLms(encodedNode, signature, jwt, renderUrl, encodedUser) {
8420
+ async getRenderDataForLms(encodedNode, signature, jwt, renderUrl) {
8408
8421
  this.injector.get(RSApiConfiguration).rootUrl = renderUrl;
8409
8422
  const decodedNodeString = this.base64ToUtf8(encodedNode);
8410
8423
  const node = JSON.parse(decodedNodeString);
8411
- const userData = JSON.parse(this.base64ToUtf8(encodedUser));
8412
8424
  const request = {
8413
8425
  nodeId: node.ref.id,
8414
8426
  repoId: node.ref.repo,
8415
8427
  securedNode: encodedNode,
8416
8428
  signature: signature,
8417
8429
  token: jwt,
8418
- userData: {
8419
- authorityName: userData.authorityName ?? '',
8420
- firstName: userData.firstName ?? '',
8421
- surName: userData.lastName ?? '',
8422
- userEMail: userData.email ?? '',
8423
- },
8424
8430
  };
8425
8431
  return {
8426
8432
  node,
@@ -8448,13 +8454,13 @@ class RenderHelperService {
8448
8454
  bytes[i] = binary.charCodeAt(i);
8449
8455
  return new TextDecoder('utf-8', { fatal: false }).decode(bytes);
8450
8456
  }
8451
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: RenderHelperService, deps: [{ token: i0.Injector }, { token: i2.AboutService }, { token: i2.NodeServiceUnwrapped }, { token: EduSharingUiConfiguration }, { token: i2.UserService }, { token: OptionsHelperDataService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
8457
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: RenderHelperService, deps: [{ token: i0.Injector }, { token: i2.AboutService }, { token: i2.NodeServiceUnwrapped }, { token: EduSharingUiConfiguration }, { token: OptionsHelperDataService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
8452
8458
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: RenderHelperService, providedIn: 'root' }); }
8453
8459
  }
8454
8460
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: RenderHelperService, decorators: [{
8455
8461
  type: Injectable,
8456
8462
  args: [{ providedIn: 'root' }]
8457
- }], ctorParameters: () => [{ type: i0.Injector }, { type: i2.AboutService }, { type: i2.NodeServiceUnwrapped }, { type: EduSharingUiConfiguration }, { type: i2.UserService }, { type: OptionsHelperDataService, decorators: [{
8463
+ }], ctorParameters: () => [{ type: i0.Injector }, { type: i2.AboutService }, { type: i2.NodeServiceUnwrapped }, { type: EduSharingUiConfiguration }, { type: OptionsHelperDataService, decorators: [{
8458
8464
  type: Optional
8459
8465
  }] }] });
8460
8466
 
@@ -8805,5 +8811,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
8805
8811
  * Generated bundle index. Do not edit.
8806
8812
  */
8807
8813
 
8808
- export { AccessibilityService, AccessibilitySettings, ActionbarComponent, AppContainerService, AppService, BorderBoxObserverDirective, CheckTextOverflowDirective, ClickSource, ColorHelper, CombinedDataSource, Constrain, CustomFieldSpecialType, CustomOptions, CustomSelectionModel, CustomTemplatesDataSource, DateHelper, DefaultGroups, DropdownComponent, DurationFormat, DurationHelper, EDU_SHARING_UI_CONFIG, EduSharingUiCommonModule, EduSharingUiConfiguration, EduSharingUiModule, ElementType, FallbackTranslationHandler, FocusStateDirective, FormatDatePipe, FormatDurationPipe, FormatOptions, FormatSizePipe, Helper, HideMode, I18N_CONFIG, I18nConfig, IconDirective, InfiniteScrollDirective, InfoMessageComponent, InteractionType, ItemsCap, KeyboardShortcutsService, ListBaseComponent, ListCountsComponent, ListItem, ListItemLabelPipe, ListItemSort, ListItemsModule, ListTextComponent, LocalEventsService, MdsDurationPipe, MdsEditorInstanceServiceAbstract, MdsHelperService, MdsModule, MdsType, MdsViewerComponent, MdsViewerService, MdsViewerWidget, MdsWidgetComponent, MdsWidgetType, NodeCache, NodeDataSource, NodeDataSourceRemote, NodeEntriesDisplayType, NodeEntriesGlobalService, NodeEntriesModule, NodeEntriesService, NodeEntriesWrapperComponent, NodeHelperService, NodeIconPipe, NodeImagePipe, NodeImageSizePipe, NodeLicensePipe, NodePersonNamePipe, NodeRatingComponent, NodeRowComponent, NodeStatsBadgesComponent, NodeTitlePipe, NodeTypeBadgeComponent, NodeUrlComponent, NodesDragDirective, NodesDragDropService, NodesDragSourceDirective, NodesDropTargetDirective, NodesRightMode, OPEN_URL_MODE, OptionButtonComponent, OptionGroup, OptionItem, OptionsHelperDataService, OptionsHelperService, PreferredColor, PropertySlugPipe, RelativeMode, RenderHelperService, RepoUrlService, RestHelper, Scope, SearchHelperService, SortDropdownComponent, SortEvent, SpinnerComponent, SpinnerSmallComponent, TRANSLATION_LIST, Target, TemporaryStorageService, Toast, ToastDuration, TranslationLoader, TranslationsModule, TranslationsService, UIAnimation, UIConstants, UIService, VCard, VCardNamePipe, ValueType, ViewInstanceService, WORKFLOW_STATUS_CHECKED, WORKFLOW_STATUS_HASFLAWS, WORKFLOW_STATUS_TO_CHECK, WORKFLOW_STATUS_UNCHECKED, clearDraggedNodes, dragNodesTransferType, getConfigProvider, isNumeric, isTrue, macroTick, matchesShortcutCondition, microTick, notNull, readDraggedNodes, replaceElementWithDiv, saveDraggedNodes };
8814
+ export { AccessibilityService, AccessibilitySettings, ActionbarComponent, AppContainerService, AppService, BorderBoxObserverDirective, CheckTextOverflowDirective, ClickSource, ColorHelper, CombinedDataSource, Constrain, CustomFieldSpecialType, CustomOptions, CustomSelectionModel, CustomTemplatesDataSource, DateHelper, DefaultGroups, DropdownComponent, DurationFormat, DurationHelper, EDU_SHARING_UI_CONFIG, EduSharingUiCommonModule, EduSharingUiConfiguration, EduSharingUiModule, ElementType, FallbackTranslationHandler, FocusStateDirective, FormatDatePipe, FormatDurationPipe, FormatOptions, FormatSizePipe, Helper, HideMode, I18N_CONFIG, I18nConfig, IconDirective, InfiniteScrollDirective, InfoMessageComponent, InteractionType, ItemsCap, KeyboardShortcutsService, ListBaseComponent, ListCountsComponent, ListItem, ListItemLabelPipe, ListItemSort, ListItemsModule, ListTextComponent, LocalEventsService, MdsDurationPipe, MdsEditorInstanceServiceAbstract, MdsHelperService, MdsModule, MdsType, MdsViewerComponent, MdsViewerService, MdsViewerWidget, MdsWidgetComponent, MdsWidgetType, NodeCache, NodeDataSource, NodeDataSourceRemote, NodeEntriesDisplayType, NodeEntriesGlobalService, NodeEntriesModule, NodeEntriesService, NodeEntriesWrapperComponent, NodeHelperService, NodeIconPipe, NodeImagePipe, NodeImageSizePipe, NodeLicensePipe, NodePersonNamePipe, NodeRatingComponent, NodeRowComponent, NodeStatsBadgesComponent, NodeTitlePipe, NodeTypeBadgeComponent, NodeUrlComponent, NodesDragDirective, NodesDragDropService, NodesDragSourceDirective, NodesDropTargetDirective, NodesRightMode, OPEN_URL_MODE, OptionButtonComponent, OptionGroup, OptionItem, OptionsHelperDataGlobalService, OptionsHelperDataService, OptionsHelperService, PreferredColor, PropertySlugPipe, RelativeMode, RenderHelperService, RepoUrlService, RestHelper, Scope, SearchHelperService, SortDropdownComponent, SortEvent, SpinnerComponent, SpinnerSmallComponent, TRANSLATION_LIST, Target, TemporaryStorageService, Toast, ToastDuration, TranslationLoader, TranslationsModule, TranslationsService, UIAnimation, UIConstants, UIService, VCard, VCardNamePipe, ValueType, ViewInstanceService, WORKFLOW_STATUS_CHECKED, WORKFLOW_STATUS_HASFLAWS, WORKFLOW_STATUS_TO_CHECK, WORKFLOW_STATUS_UNCHECKED, clearDraggedNodes, dragNodesTransferType, getConfigProvider, isNumeric, isTrue, macroTick, matchesShortcutCondition, microTick, notNull, readDraggedNodes, replaceElementWithDiv, saveDraggedNodes };
8809
8815
  //# sourceMappingURL=ngx-edu-sharing-ui.mjs.map