@provoly/dashboard 1.2.7 → 1.2.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.
@@ -7429,11 +7429,14 @@ const canManifestBeMadePublic = (manifest, datasets) => {
7429
7429
  return datasource?.groups?.includes(PUBLIC_GROUP) ?? false;
7430
7430
  });
7431
7431
  };
7432
- const getCommonDatasourceGroupsForManifest = (manifest, datasets) => {
7432
+ const getCommonDatasourceGroupsForManifest = (manifest, datasets, allGroups) => {
7433
7433
  let result = [];
7434
7434
  const allDsGroups = manifest.datasource.map((dsId) => datasets.find((d) => d.id === dsId)?.groups ?? []);
7435
- if (allDsGroups.every((dsGroups) => dsGroups.includes(AUTHENTICATED_USERS_GROUP))) {
7436
- result = [...new Set(allDsGroups.flat())];
7435
+ if (allDsGroups.every((dsGroups) => dsGroups.includes(PUBLIC_GROUP))) {
7436
+ result = allGroups.map((group) => group.name);
7437
+ }
7438
+ else if (allDsGroups.every((dsGroups) => dsGroups.includes(PUBLIC_GROUP) || dsGroups.includes(AUTHENTICATED_USERS_GROUP))) {
7439
+ result = allGroups.filter((group) => group.name !== PUBLIC_GROUP).map((group) => group.name);
7437
7440
  }
7438
7441
  else {
7439
7442
  const allDsGroupsFiltered = allDsGroups.filter((dsGroups) => !dsGroups.includes(AUTHENTICATED_USERS_GROUP) && !dsGroups.includes(PUBLIC_GROUP));
@@ -7694,7 +7697,6 @@ class PryAccessRightsShareComponent extends SubscriptionnerDirective {
7694
7697
  this.getGroupLabelByName = getGroupLabelByName;
7695
7698
  this.PUBLIC_GROUP = PUBLIC_GROUP;
7696
7699
  this.AUTHENTICATED_USERS_GROUP = AUTHENTICATED_USERS_GROUP;
7697
- this.store.dispatch(ConfigActions.loadAccessGroups());
7698
7700
  this.groups$ = combineLatest([
7699
7701
  this.store.select(ConfigSelectors.accessGroups),
7700
7702
  this._allowedGroups$,
@@ -7814,14 +7816,16 @@ class PryAccessRightsShareModalComponent {
7814
7816
  this.accessRightsByGroup = {};
7815
7817
  this.disableShareButton$ = new BehaviorSubject(false);
7816
7818
  this.store.dispatch(DataSourceActions.dataset.loadDataset());
7819
+ this.store.dispatch(ConfigActions.loadAccessGroups());
7817
7820
  this.manifest = this.data.manifest;
7818
7821
  this.accessRightsByGroup = { ...this.manifest.accessRightsByGroup };
7819
7822
  this.allowedShareGroups$ = combineLatest([
7820
7823
  this.store.select(DataSourceSelectors.datasets),
7821
- this.store.select(DashboardSelectors.currentManifest)
7822
- ]).pipe(map(([datasets, current]) => {
7824
+ this.store.select(DashboardSelectors.currentManifest),
7825
+ this.store.select(ConfigSelectors.accessGroups)
7826
+ ]).pipe(map(([datasets, current, groups]) => {
7823
7827
  return current && current.datasource.length > 0
7824
- ? getCommonDatasourceGroupsForManifest(current, datasets)
7828
+ ? getCommonDatasourceGroupsForManifest(current, datasets, groups)
7825
7829
  : null;
7826
7830
  }));
7827
7831
  }
@@ -7841,11 +7845,9 @@ class PryAccessRightsShareModalComponent {
7841
7845
  }
7842
7846
  validate() {
7843
7847
  this.store.dispatch(DashboardActions.saveManifest({
7844
- id: this.manifest.id ?? '',
7845
- name: this.manifest.name ?? '',
7846
- description: this.manifest.description ?? '',
7847
- image: this.manifest.image ?? '',
7848
- accessRightsByGroup: this.accessRightsByGroup
7848
+ ...this.manifest,
7849
+ accessRightsByGroup: this.accessRightsByGroup,
7850
+ metadata: undefined
7849
7851
  }));
7850
7852
  this.toggleModal();
7851
7853
  }