Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 39b360b7 authored by Sebastian-Ion TINCU's avatar Sebastian-Ion TINCU
Browse files

Merge pull request #123 in EDELIVERY/smp from...

Merge pull request #123 in EDELIVERY/smp from bugfix/EDELIVERY-4014-icon-for-service-metadata to development

* commit '40579c57049fabc717f1756952a0f09765665f6c':
  EDELIVERY-4014 "+" icon for Service metadata on search/edit page is
  EDELIVERY-4014 "+" icon for Service metadata on search/edit page is
parents 5c9bac49 87e20c86
No related branches found
No related tags found
No related merge requests found
......@@ -10,4 +10,11 @@ export interface SearchTableController {
newRow(): SearchTableEntity;
newDialog(config?: MatDialogConfig): MatDialogRef<any>;
dataSaved();
/**
* Returns whether the row expander should be shown as disabled even when the actual row is not fully disabled.
*
* @param row the row for which the row expander should be disabled or not
*/
isRowExpanderDisabled(row: SearchTableEntity): boolean;
}
......@@ -85,8 +85,8 @@
</ng-template>
<ng-template #rowExpand let-row="row" let-expanded="expanded" let-disabled="disabled" ngx-datatable-cell-template >
<span *ngIf="disabled">( )</span>
<a *ngIf="!disabled" class="table-button-expand"
<span *ngIf="isRowExpanderDisabled(row, disabled)">()</span>
<a *ngIf="!isRowExpanderDisabled(row, disabled)" class="table-button-expand"
href="javascript:void(0)"
title="Expand/Collapse Row"
(click)="toggleExpandRow(row)">{{expanded?'(-)':'(+)'}}
......
......@@ -332,6 +332,10 @@ export class SearchTableComponent implements OnInit {
return !(!this.submitButtonsEnabled || this.forceRefresh);
}
isRowExpanderDisabled(row: any, rowDisabled: boolean): boolean {
return rowDisabled || this.searchTableController.isRowExpanderDisabled(row);
}
private editSearchTableEntity(rowNumber: number) {
const row = this.rows[rowNumber];
const formRef: MatDialogRef<any> = this.searchTableController.newDialog({
......
......@@ -61,4 +61,8 @@ export class DomainController implements SearchTableController {
stringMessage: '',
}
}
isRowExpanderDisabled(row: SearchTableEntity): boolean {
return false;
}
}
......@@ -8,6 +8,7 @@ import {ServiceGroupMetadataDialogComponent} from "./service-group-metadata-dial
import {of} from "rxjs/internal/observable/of";
import {SearchTableValidationResult} from "../common/search-table/search-table-validation-result.model";
import {SearchTableEntity} from "../common/search-table/search-table-entity.model";
import {ServiceGroupSearchRo} from "../service-group-search/service-group-search-ro.model";
export class ServiceGroupEditController implements SearchTableController {
......@@ -84,4 +85,8 @@ export class ServiceGroupEditController implements SearchTableController {
}
}
isRowExpanderDisabled(row: ServiceGroupEditRo): boolean {
const serviceGroup = <ServiceGroupEditRo>row;
return !(serviceGroup.serviceMetadata && serviceGroup.serviceMetadata.length);
}
}
......@@ -4,6 +4,7 @@ import {ServiceGroupSearchRo} from './service-group-search-ro.model';
import {of} from "rxjs/internal/observable/of";
import {SearchTableValidationResult} from "../common/search-table/search-table-validation-result.model";
import {SearchTableEntity} from "../common/search-table/search-table-entity.model";
import {ServiceGroupEditRo} from "../service-group-edit/service-group-edit-ro.model";
export class ServiceGroupSearchController implements SearchTableController {
......@@ -39,4 +40,9 @@ export class ServiceGroupSearchController implements SearchTableController {
stringMessage: message,
}
}
isRowExpanderDisabled(row: SearchTableEntity): boolean {
const serviceGroup = <ServiceGroupSearchRo>row;
return !(serviceGroup.serviceMetadata && serviceGroup.serviceMetadata.length);
}
}
......@@ -4,11 +4,8 @@ import {UserDetailsDialogComponent} from './user-details-dialog/user-details-dia
import {UserRo} from './user-ro.model';
import {SearchTableEntityStatus} from '../common/search-table/search-table-entity-status.model';
import {GlobalLookups} from "../common/global-lookups";
import {CertificateRo} from "./certificate-ro.model";
import {SearchTableEntity} from "../common/search-table/search-table-entity.model";
import {of} from "rxjs/internal/observable/of";
import {SearchTableValidationResult} from "../common/search-table/search-table-validation-result.model";
import {ServiceMetadataValidationEditRo} from "../service-group-edit/service-group-metadata-dialog/service-metadata-validation-edit-ro.model";
import {SmpConstants} from "../smp.constants";
import {HttpClient} from "@angular/common/http";
......@@ -64,7 +61,8 @@ export class UserController implements SearchTableController {
}
}
isRowExpanderDisabled(row: SearchTableEntity): boolean {
return false;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment