Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
835e8ed
added authorization to individual tiles
nitrosx Jun 30, 2026
7859692
first draft of the e2e test
nitrosx Jun 30, 2026
2375b20
fixed linting
nitrosx Jul 1, 2026
97dfc72
Merge branch 'master' into detaset_tile_access
nitrosx Jul 1, 2026
61b2d7d
fixed linting
nitrosx Jul 1, 2026
a2e8a12
fixed e2e test
nitrosx Jul 1, 2026
448d431
added authorization to individual tiles
nitrosx Jun 30, 2026
752db8f
first draft of the e2e test
nitrosx Jun 30, 2026
d89a73a
fixed linting
nitrosx Jul 1, 2026
3d03bee
fixed e2e test
nitrosx Jul 1, 2026
5416fd4
feat(dataset-detail): add lock icon for restricted tiles with config …
nitrosx Jul 25, 2026
25b07da
docs(dataset-detail): add Restricted Tiles Indicator documentation
nitrosx Jul 25, 2026
567050e
refactor(dataset-detail): ensure sections have authorization field de…
nitrosx Jul 25, 2026
472a2be
test(dataset-detail): configure showRestrictedTilesIndicator for e2e …
nitrosx Jul 25, 2026
78b615a
test(dataset-detail): add assertions for lock icon visibility in e2e …
nitrosx Jul 25, 2026
c127a17
addressed comments and added restricted access indicator
nitrosx Jul 25, 2026
708656f
resolved conflicts
nitrosx Jul 25, 2026
cc0f459
resoled conflicts
nitrosx Jul 25, 2026
d493f34
Merge branch 'master' of https://github.com/SciCatProject/frontend in…
nitrosx Jul 29, 2026
1c9f316
fixed failing tests
nitrosx Jul 29, 2026
0c8a700
Merge branch 'master' into detaset_tile_access
nitrosx Jul 29, 2026
08cf355
implemented new configuration for tile authorization and indicator icon
nitrosx Aug 5, 2026
27c1b5c
updated documentation
nitrosx Aug 5, 2026
0cb2bcc
Updated config and test data
nitrosx Aug 6, 2026
ee2956d
work in progress
nitrosx Aug 6, 2026
663ad1f
updated tests
nitrosx Aug 6, 2026
aed4526
Merge branch 'master' into detaset_tile_access
nitrosx Aug 7, 2026
8fcaf10
fixed linting and unit tests
nitrosx Aug 7, 2026
94a3d3e
fixed linting
nitrosx Aug 7, 2026
b13e90d
Merge branch 'master' of https://github.com/SciCatProject/frontend in…
nitrosx Aug 10, 2026
ee5175b
fixed and renumbered tests
nitrosx Aug 10, 2026
4b65ff5
added configuration to CI
nitrosx Aug 11, 2026
f698ae5
Fixed linting
nitrosx Aug 17, 2026
3afc9bb
updated admin json forms configuration
nitrosx Aug 17, 2026
280599e
fixed configurations and linting
nitrosx Aug 17, 2026
d222df1
updated documentation and refernces to configuratiojn
nitrosx Aug 17, 2026
908c94f
updated documentation
nitrosx Aug 17, 2026
684ec8e
fixed linting and tests
nitrosx Aug 17, 2026
59085eb
wip on e2e tests
nitrosx Aug 17, 2026
0e8db67
updated documentation
nitrosx Aug 17, 2026
c535e13
solving test failing
nitrosx Aug 18, 2026
d4e4dec
refactor failing test
nitrosx Aug 18, 2026
879e262
fixing tests
nitrosx Aug 18, 2026
f5abb96
Merge branch 'master' into detaset_tile_access
nitrosx Aug 18, 2026
7d834f5
updated description in admin panel and order of tiles
nitrosx Aug 18, 2026
a69f1bd
Merge branch 'detaset_tile_access' of https://github.com/SciCatProjec…
nitrosx Aug 18, 2026
207042d
Merge branch 'master' into detaset_tile_access
nitrosx Aug 18, 2026
11a6425
added theme 5 variables to e2e frontend them
nitrosx Aug 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions src/app/admin/schema/frontend.config.jsonforms.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@
"url": { "type": "string" },
"target": { "type": "string" },
"enabled": { "type": "string" },
"authorization": { "type": "array", "items": { "type": "string" } },
Comment thread
nitrosx marked this conversation as resolved.
"inputs": {
"type": "array",
"items": {
Expand Down Expand Up @@ -356,6 +355,10 @@
"type": "string",
"enum": ["table", "json", "tree"]
},
"authorization": {
"type": "array",
"items": { "type": "string" }
},

"options": {
"type": "object",
Expand Down Expand Up @@ -660,10 +663,6 @@
"options": { "multi": true }
},
{ "type": "Control", "scope": "#/properties/filename" },
{
"type": "Control",
"scope": "#/properties/authorization"
},
{
"type": "Control",
"scope": "#/properties/variables",
Expand Down Expand Up @@ -765,7 +764,11 @@
"elements": [
{ "type": "Control", "scope": "#/properties/label" },
{ "type": "Control", "scope": "#/properties/type" },
{ "type": "Control", "scope": "#/properties/order" },
{ "type": "Control", "scope": "#/properties/order" }]
},
{
"type": "HorizontalLayout",
"elements": [
{ "type": "Control", "scope": "#/properties/row" },
{ "type": "Control", "scope": "#/properties/col" },
{
Expand All @@ -783,6 +786,15 @@
}
]
},
{
"type": "HorizontalLayout",
"elements": [
{
"type": "Control",
"scope": "#/properties/authorization"
}
]
},
{
"type": "VerticalLayout",
"label": "Attachments Options",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
$header-2: map.get($color-config, "header-2");
$header-3: map.get($color-config, "header-3");
$header-4: map.get($color-config, "header-4");
$header-5: map.get($color-config, "header-5");
$warn: map.get($color-config, "warn");
$warn-2: map.get($color-config, "warn-2");
.dynamic-template-tile-header {
background-color: mat.m2-get-color-from-palette($header-5, "lighter");
}
.dynamic-template-general-header {
background-color: mat.m2-get-color-from-palette($primary, "lighter");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*ngIf="dataset$ | async as dataset"
>
<!-- Iterate over each section in datasetView -->
<ng-container *ngFor="let section of datasetView">
<ng-container *ngFor="let section of datasetView$ | async">
<ng-container [ngSwitch]="section.type">
<!-- Regular Section -->
<div
Expand All @@ -40,7 +40,7 @@
<mat-card>
<!-- Section Header -->
<mat-card-header
class="dynamic-template-general-header sticky-header"
class="dynamic-template-tile-header sticky-header"
data-cy="section-label"
>
<div mat-card-avatar class="section-icon">
Expand Down Expand Up @@ -160,7 +160,7 @@
<ng-container *ngIf="emptyMetadataTable()">
<mat-card>
<mat-card-header
class="scientific-header sticky-header"
class="dynamic-template-tile-header sticky-header"
data-cy="section-label"
>
<div mat-card-avatar class="section-icon">
Expand Down Expand Up @@ -218,7 +218,7 @@
>
<mat-card>
<mat-card-header
class="dynamic-template-attachments-header sticky-header"
class="dynamic-template-tile-header sticky-header"
data-cy="section-label"
>
<div mat-card-avatar class="section-icon">
Expand Down Expand Up @@ -285,7 +285,7 @@
>
<mat-card>
<mat-card-header
class="dynamic-template-json-view-header sticky-header"
class="dynamic-template-tile-header sticky-header"
data-cy="section-label"
>
<div mat-card-avatar class="section-icon">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

import { MatDialog } from "@angular/material/dialog";
import { Store } from "@ngrx/store";
import { Subscription } from "rxjs";
import { Subscription, Observable } from "rxjs";
import { map } from "rxjs/operators";

import { showMessageAction } from "state-management/actions/user.actions";
import {
selectCurrentAttachments,
selectCurrentDataset,
selectCurrentDatasetWithoutFileInfo,
} from "state-management/selectors/datasets.selectors";
import { selectIsLoading } from "state-management/selectors/user.selectors";
import { selectIsLoading, selectProfile } from "state-management/selectors/user.selectors";

Check failure on line 14 in src/app/datasets/dataset-detail/dataset-detail-dynamic/dataset-detail-dynamic.component.ts

View workflow job for this annotation

GitHub Actions / eslint

Replace `·selectIsLoading,·selectProfile·` with `⏎··selectIsLoading,⏎··selectProfile,⏎`
import { selectCurrentInstrument } from "state-management/selectors/instruments.selectors";

import { AppConfigService } from "app-config.service";
Expand Down Expand Up @@ -50,7 +51,7 @@
export class DatasetDetailDynamicComponent implements OnInit, OnDestroy {
private subscriptions: Subscription[] = [];

datasetView: CustomizationItem[];
datasetView$: Observable<CustomizationItem[]>;
form: FormGroup;
cols = 10;
gutterSize = 12;
Expand All @@ -65,6 +66,8 @@
loading$ = this.store.select(selectIsLoading);
show = false;

userGroups$: Observable<string[]>;

instrument: Instrument | undefined;
dataset: OutputDatasetObsoleteDto | undefined;

Expand All @@ -83,7 +86,11 @@
private router: Router,
private route: ActivatedRoute,
private snackBar: MatSnackBar,
) {}
) {
this.userGroups$ = this.store.select(selectProfile).pipe(

Check failure on line 90 in src/app/datasets/dataset-detail/dataset-detail-dynamic/dataset-detail-dynamic.component.ts

View workflow job for this annotation

GitHub Actions / eslint

Replace `.select(selectProfile).pipe(` with `⏎······.select(selectProfile)`
map((profile) => profile?.accessGroups || [])

Check failure on line 91 in src/app/datasets/dataset-detail/dataset-detail-dynamic/dataset-detail-dynamic.component.ts

View workflow job for this annotation

GitHub Actions / eslint

Map logic at the selector level instead. (https://ngrx.io/guide/eslint-plugin/rules/avoid-mapping-selectors)

Check failure on line 91 in src/app/datasets/dataset-detail/dataset-detail-dynamic/dataset-detail-dynamic.component.ts

View workflow job for this annotation

GitHub Actions / eslint

Replace `map((profile)·=>·profile?.accessGroups·||·[])⏎····` with `.pipe(map((profile)·=>·profile?.accessGroups·||·[])`
);
}

ngOnInit() {
this.form = this.fb.group({});
Expand All @@ -97,7 +104,13 @@
}
});

this.datasetView = sortedDatasetView;
this.datasetView$ = this.userGroups$.pipe(
map((userGroups) =>
sortedDatasetView.filter((section) =>
this.canViewBlock(section.authorization, userGroups)

Check failure on line 110 in src/app/datasets/dataset-detail/dataset-detail-dynamic/dataset-detail-dynamic.component.ts

View workflow job for this annotation

GitHub Actions / eslint

Insert `,`
)

Check failure on line 111 in src/app/datasets/dataset-detail/dataset-detail-dynamic/dataset-detail-dynamic.component.ts

View workflow job for this annotation

GitHub Actions / eslint

Insert `,`
)

Check failure on line 112 in src/app/datasets/dataset-detail/dataset-detail-dynamic/dataset-detail-dynamic.component.ts

View workflow job for this annotation

GitHub Actions / eslint

Insert `,`
);

this.subscriptions.push(
this.store.select(selectCurrentInstrument).subscribe((instrument) => {
Expand All @@ -120,6 +133,29 @@
);
}

/**
* Checks if the current user can view a block based on authorization
* @param blockAuthorization - Optional array of group names from block.authorization
* @param userGroups - Array of groups the current user belongs to
* @returns true if user can view the block
*/
canViewBlock(
blockAuthorization: string[] | undefined,
userGroups: string[]

Check failure on line 144 in src/app/datasets/dataset-detail/dataset-detail-dynamic/dataset-detail-dynamic.component.ts

View workflow job for this annotation

GitHub Actions / eslint

Insert `,`
): boolean {
const auth = blockAuthorization || ["#all"];

if (auth.includes("#all")) {
return true;
}

if (auth.length === 0) {
return false;
}
Comment thread
nitrosx marked this conversation as resolved.

return auth.some((group) => userGroups.includes(group));
}

onCopy(value: string) {
navigator.clipboard.writeText(value).then(
() => {
Expand Down
1 change: 1 addition & 0 deletions src/app/state-management/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export interface CustomizationItem {
source?: string;
options?: AttachmentOptions;
viewMode?: viewModeOptions;
authorization?: string[];
}

export interface Field {
Expand Down
6 changes: 6 additions & 0 deletions src/app/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ export const light: Theme = {
"--theme-header-4-lighter-contrast": "#000000",
"--theme-header-4-darker": "#9b429b",
"--theme-header-4-darker-contrast": "#ffffff",
"--theme-header-5-default": "#7f7f7f",
"--theme-header-5-default-contrast": "#ffffff",
"--theme-header-5-lighter": "#e5e5e5",
"--theme-header-5-lighter-contrast": "#000000",
"--theme-header-5-darker": "#4c4c4c",
"--theme-header-5-darker-contrast": "#ffffff",
Comment thread
nitrosx marked this conversation as resolved.
"--theme-hover-default": "#7f7f7f",
"--theme-hover-default-contrast": "#000000",
"--theme-hover-lighter": "#e5e5e5",
Expand Down
6 changes: 6 additions & 0 deletions src/assets/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
"--theme-header-4-lighter-contrast": "#000000",
"--theme-header-4-darker": "#9b429b",
"--theme-header-4-darker-contrast": "#ffffff",
"--theme-header-5-default": "#7f7f7f",
"--theme-header-5-default-contrast": "#ffffff",
"--theme-header-5-lighter": "#e5e5e5",
"--theme-header-5-lighter-contrast": "#000000",
"--theme-header-5-darker": "#4c4c4c",
"--theme-header-5-darker-contrast": "#ffffff",
"--theme-hover-default": "#7f7f7f",
"--theme-hover-default-contrast": "#000000",
"--theme-hover-lighter": "#e5e5e5",
Expand Down
22 changes: 20 additions & 2 deletions src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,17 @@ $theme-header-4: (
),
);

$theme-header-5: (
default: var(--theme-header-5-default),
lighter: var(--theme-header-5-lighter),
darker: var(--theme-header-5-darker),
contrast: (
default: var(--theme-header-5-default-contrast),
lighter: var(--theme-header-5-lighter-contrast),
darker: var(--theme-header-5-darker-contrast),
),
);

Comment thread
nitrosx marked this conversation as resolved.
$theme-hover: (
default: var(--theme-hover-default),
lighter: var(--theme-hover-lighter),
Expand Down Expand Up @@ -191,6 +202,12 @@ $header-4: mat.m2-define-palette(
"lighter",
"darker"
);
$header-5: mat.m2-define-palette(
$theme-header-5,
"default",
"lighter",
"darker"
);
$hover: mat.m2-define-palette($theme-hover, "default", "lighter", "darker");

$basetheme: mat.m2-define-light-theme(
Expand All @@ -211,8 +228,9 @@ $newcolor: map.merge(
warn-2: $warn-2,
header-1: $header-1,
header-2: $header-2,
header-3: $header-4,
header-3: $header-3,
header-4: $header-4,
header-5: $header-5,
hover: $hover,
)
);
Expand Down Expand Up @@ -476,4 +494,4 @@ display: inline-flex;
.mat-mdc-form-field-icon-suffix {
display: flex;
align-items: center;
}
}
Loading