Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/maven/fixes/9.0' into maven/rele…
Browse files Browse the repository at this point in the history
…ase/9.0
  • Loading branch information
metaventis-build committed Jun 11, 2024
2 parents 0c3e629 + ccaef03 commit 00499b2
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ public boolean hasToolPermission(String toolPermission, boolean renew) {
/**
* try to use session cache
*/
// system user is not restricted
if(AuthenticationUtil.isRunAsUserTheSystemUser()) {
return true;
}
Boolean hasToolPerm = false;
HttpSession session = null;
if(Context.getCurrentInstance() != null){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<div
*ngIf="(entriesService.globalOptionsSubject | async)?.length"
*ngIf="(getEnabledOptions() | async)?.length"
role="listitem"
class="global-options"
[class.global-options-small]="displayType === NodeEntriesDisplayType.SmallGrid"
[class.global-options-table]="displayType === NodeEntriesDisplayType.Table"
>
<button
mat-button
*ngFor="let option of entriesService.globalOptionsSubject | async"
*ngFor="let option of getEnabledOptions() | async"
(click)="option.callback()"
class="global-option-btn"
attr.data-test="card-button-{{ option.name }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { Node } from 'ngx-edu-sharing-api';
import { NodeEntriesDisplayType } from '../entries-model';
import { NodeEntriesService } from '../../services/node-entries.service';
import { map } from 'rxjs/operators';

@Component({
selector: 'es-node-entries-global-options',
Expand All @@ -13,4 +14,10 @@ export class NodeEntriesGlobalOptionsComponent<T extends Node> {
readonly NodeEntriesDisplayType = NodeEntriesDisplayType;
@Input() displayType: NodeEntriesDisplayType;
constructor(public entriesService: NodeEntriesService<T>) {}

getEnabledOptions() {
return this.entriesService.globalOptionsSubject.pipe(
map((options) => options.filter((e) => e.isEnabled)),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,42 +31,46 @@
</es-mds-editor-widget-container>

<!-- es-mds-editor-widget-container causes issues with textarea -->
<mat-form-field
<es-mds-editor-widget-container
*ngIf="widget.definition.type === 'textarea'"
class="mat-form-textarea"
[hideRequiredMarker]="true"
[injectedView]="this"
[widget]="widget"
[label]="false"
[wrapInFormField]="false"
[valueType]="valueType"
>
<mat-label>
{{ widget.definition.caption }}
<!-- We use our own required marker to show it even on disabled controls for bulk editing.
-->
<span
*ngIf="widget.definition.isRequired === 'mandatory'"
class="required-marker"
aria-hidden="true"
>*</span
>
</mat-label>
<textarea matInput #textAreaElement *ngIf="showBulkMixedValues()" disabled>{{
'MDS.DIFFERENT_VALUES' | translate
}}</textarea>
<textarea
matInput
#textAreaElement
*ngIf="!showBulkMixedValues()"
[placeholder]="widget.definition.placeholder"
[formControl]="formControl"
(blur)="blur()"
(keydown.enter)="submit()"
></textarea>
<mat-hint [hidden]="!widget.definition.bottomCaption">
{{ widget.definition.bottomCaption }}
</mat-hint>
<mat-error [hidden]="!formControl.errors?.required">
<ng-container *ngTemplateOutlet="error"></ng-container>
</mat-error>
</mat-form-field>

<mat-form-field class="mat-form-textarea" [hideRequiredMarker]="true">
<mat-label>
{{ widget.definition.caption }}
<!-- We use our own required marker to show it even on disabled controls for bulk editing.
-->
<span
*ngIf="widget.definition.isRequired === 'mandatory'"
class="required-marker"
aria-hidden="true"
>*</span
>
</mat-label>
<textarea matInput #textAreaElement *ngIf="showBulkMixedValues()" disabled>{{
'MDS.DIFFERENT_VALUES' | translate
}}</textarea>
<textarea
matInput
#textAreaElement
*ngIf="!showBulkMixedValues()"
[placeholder]="widget.definition.placeholder"
[formControl]="formControl"
(blur)="blur()"
(keydown.enter)="submit()"
></textarea>
<mat-hint [hidden]="!widget.definition.bottomCaption">
{{ widget.definition.bottomCaption }}
</mat-hint>
<mat-error [hidden]="!formControl.errors?.required">
<ng-container *ngTemplateOutlet="error"></ng-container>
</mat-error>
</mat-form-field>
</es-mds-editor-widget-container>
<ng-template #error>
<ng-container *ngIf="widget.definition.isRequired === 'mandatory'">
{{ 'MDS.REQUIRED_MESSAGE' | translate }}
Expand Down

0 comments on commit 00499b2

Please sign in to comment.