Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #25805: Containers Portlet only show containers from current site #25966

Merged
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
621fde2
refactor (containers portlet): table is showing and partially working
zJaaal Aug 30, 2023
4c69947
fix (containers list module): querying and pagination were broken
zJaaal Aug 31, 2023
3f556fb
fix (containers list styles): table was overflowing
zJaaal Aug 31, 2023
deb3924
Merge branch 'master' into issue-25805-containers-only-show-container…
zJaaal Aug 31, 2023
d689c59
Merge branch 'master' into issue-25805-containers-only-show-container…
zJaaal Aug 31, 2023
49ff45f
dev (container list module): add missing functionalities
zJaaal Aug 31, 2023
f3310fc
Merge branch 'master' into issue-25805-containers-only-show-container…
zJaaal Aug 31, 2023
a8bb12e
copywritting (container list component): fix comment
zJaaal Aug 31, 2023
dbf5dce
fix (container list tests): fixed some tests that were broken
zJaaal Aug 31, 2023
9fdbe45
dev (container list test): add and fix tests
zJaaal Sep 1, 2023
ccb10a3
copywirtting (container list test): delete unnecessary comment
zJaaal Sep 1, 2023
b6d6a28
Merge branch 'master' into issue-25805-containers-only-show-container…
zJaaal Sep 1, 2023
a2aaa4a
fix (dot containers store): portlet not initializing on navigation
zJaaal Sep 1, 2023
60ee848
Merge branch 'issue-25805-containers-only-show-containers-from-curren…
zJaaal Sep 1, 2023
279b271
fix (dot containers store): pagination service is not cleaning extra …
zJaaal Sep 1, 2023
d087b61
Merge branch 'master' into issue-25805-containers-only-show-container…
zJaaal Sep 1, 2023
3c5ccf1
dev (containers list store): small refactor to getbyHost
zJaaal Sep 1, 2023
12006d7
Merge branch 'issue-25805-containers-only-show-containers-from-curren…
zJaaal Sep 1, 2023
0cea431
fix (containers list test): fix broken tests
zJaaal Sep 1, 2023
f215b75
Merge branch 'master' into issue-25805-containers-only-show-container…
zJaaal Sep 5, 2023
dc0961c
Merge branch 'master' into issue-25805-containers-only-show-container…
zJaaal Sep 5, 2023
c79c232
Merge branch 'master' into issue-25805-containers-only-show-container…
zJaaal Sep 5, 2023
380b2fd
Merge branch 'master' into issue-25805-containers-only-show-container…
zJaaal Sep 5, 2023
23ffca1
Merge branch 'master' into issue-25805-containers-only-show-container…
zJaaal Sep 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,63 +1,96 @@
<div class="container-listing">
<dot-portlet-base *ngIf="vm$ | async as vm">
<dot-listing-data-table
#listing
*ngIf="vm.tableColumns && vm.actionHeaderOptions"
[actionHeaderOptions]="vm.actionHeaderOptions"
[columns]="vm.tableColumns"
[actions]="[]"
[checkbox]="true"
[mapItems]="getContainersWithDisabledEntities"
(selectedItems)="updateSelectedContainers($event)"
(rowWasClicked)="handleRowClick($event)"
url="v1/containers"
dataKey="inode"
>
<div class="container-listing__header-options">
<div class="container-listing__filter-controls">
<button
class="p-button-outlined p-button"
[label]="'Search' | dm"
type="button"
pButton
></button>
<p-checkbox
[label]="'Show-Archived' | dm"
[binary]="true"
(onChange)="handleArchivedFilter($event.checked)"
data-testid="archiveCheckbox"
></p-checkbox>
</div>

<div>
<button
class="p-button-outlined p-button"
[label]="'Actions' | dm"
[disabled]="!vm.selectedContainers.length"
(click)="actionsMenu.toggle($event)"
type="button"
pButton
icon="pi pi-ellipsis-v"
attr.data-testid="bulkActions"
></button>

<p-menu
#actionsMenu
[popup]="true"
[model]="vm.containerBulkActions"
appendTo="body"
></p-menu>
</div>
<dot-portlet-base *ngIf="vm$ | async as vm">
<dot-action-header [options]="vm.actionHeaderOptions">
<dot-content-type-selector
(selected)="changeContentTypeSelector($event)"></dot-content-type-selector>
<input
#gf
(input)="handleQueryFilter($event.target.value)"
(keydown.arrowdown)="focusFirstRow()"
pInputText
placeholder="{{ 'global-search' | dm }}"
type="text"
data-testId="query-input" />
<div class="container-listing__header-options">
<div class="container-listing__filter-controls">
<p-checkbox
[label]="'Show-Archived' | dm"
[binary]="true"
(onChange)="handleArchivedFilter($event.checked)"
data-testId="archiveCheckbox"></p-checkbox>
</div>

<ng-template #beforeSearchTemplate>
<dot-content-type-selector
(selected)="changeContentTypeSelector($event)"
></dot-content-type-selector>
</ng-template>
<div>
<button
class="p-button-outlined p-button"
[label]="'Actions' | dm"
[disabled]="!selectedContainers.length"
(click)="handleActionMenuOpen($event)"
type="button"
pButton
icon="pi pi-ellipsis-v"
data-testId="bulkActions"></button>

<ng-template #rowTemplate *ngIf="vm.tableColumns as tableColumns" let-rowData="rowData">
<td [ngStyle]="{ 'text-align': tableColumns[0].textAlign }">
<p-menu
#actionsMenu
[popup]="true"
[model]="vm.containerBulkActions"
appendTo="body"></p-menu>
</div>
</div>
</dot-action-header>
<p-table
*ngIf="vm.tableColumns && vm.actionHeaderOptions"
[(selection)]="selectedContainers"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why two conditions here?

[columns]="vm.tableColumns"
[value]="vm.containers"
[rows]="40"
[paginator]="true"
[pageLinks]="vm.maxPageLinks"
[totalRecords]="vm.totalRecords"
[responsiveLayout]="'scroll'"
(onPage)="loadDataPaginationEvent($event)"
selectionMode="multiple"
loadingIcon="pi pi-spin pi-spinner"
dataKey="inode"
data-testId="container-list-table">
<ng-template let-columns pTemplate="header">
rjvelazco marked this conversation as resolved.
Show resolved Hide resolved
<tr *ngIf="vm.containers?.length">
<th style="width: 5%">
<p-tableHeaderCheckbox></p-tableHeaderCheckbox>
</th>
<th
*ngFor="let col of columns"
[ngStyle]="{ width: col.width, 'text-align': col.textAlign }"
[pSortableColumnDisabled]="!col.sortable"
[pSortableColumn]="col.fieldName">
{{ col.header }}
<p-sortIcon *ngIf="col.sortable" [field]="col.fieldName"></p-sortIcon>
</th>
<th style="width: 5%"></th>
</tr>
</ng-template>
<ng-template let-columns="columns" let-rowData pTemplate="body">
<tr
#tableRow
[ngClass]="{ 'disabled-row': rowData.disableInteraction }"
[pSelectableRowDisabled]="rowData.disableInteraction"
[pContextMenuRowDisabled]="rowData.disableInteraction"
[attr.data-testRowId]="rowData.identifier"
[pContextMenuRow]="rowData"
[pSelectableRow]="rowData"
[attr.data-testId]="rowData?.variable ? 'row-' + rowData.variable : null"
[attr.data-disabled]="rowData.disableInteraction"
(click)="handleRowClick(rowData)"
(keyup.enter)="handleRowClick(rowData)"
data-testClass="testTableRow">
<td (click)="$event.stopPropagation()">
<p-tableCheckbox
*ngIf="!rowData.disableInteraction"
[value]="rowData"
[attr.test-id]="rowData.friendlyName"
(click)="$event.stopPropagation()"></p-tableCheckbox>
</td>
<td [ngStyle]="{ 'text-align': vm.tableColumns[0].textAlign }">
{{ rowData.name }}
<ng-container *ngIf="rowData.path"
>-
Expand All @@ -66,18 +99,17 @@
}}</span></ng-container
>
</td>
<td [ngStyle]="{ 'text-align': tableColumns[1].textAlign }">
<td [ngStyle]="{ 'text-align': vm.tableColumns[1].textAlign }">
<dot-state-icon
[labels]="vm.stateLabels"
[state]="getContainerState(rowData)"
size="14px"
>
size="14px">
</dot-state-icon>
</td>
<td [ngStyle]="{ 'text-align': tableColumns[2].textAlign }">
<td [ngStyle]="{ 'text-align': vm.tableColumns[2].textAlign }">
{{ rowData.friendlyName }}
</td>
<td [ngStyle]="{ 'text-align': tableColumns[3].textAlign }">
<td [ngStyle]="{ 'text-align': vm.tableColumns[3].textAlign }">
{{ rowData.modDate | dotRelativeDate }}
</td>
<td style="width: 5%">
Expand All @@ -86,17 +118,20 @@
*ngIf="!rowData.disableInteraction"
[attr.data-testid]="rowData.identifier"
[actions]="setContainerActions(rowData)"
[item]="rowData"
>
[item]="rowData">
</dot-action-menu-button>
</td>
</ng-template>
</dot-listing-data-table>
</tr>
</ng-template>
<ng-template pTemplate="emptymessage">
<div class="listing-datatable__empty" data-testId="listing-datatable__empty">
{{ 'No-Results-Found' | dm }}
</div>
</ng-template>
</p-table>

<dot-add-to-bundle
*ngIf="vm.addToBundleIdentifier"
[assetIdentifier]="vm.addToBundleIdentifier"
(cancel)="resetBundleIdentifier()"
></dot-add-to-bundle>
</dot-portlet-base>
</div>
<dot-add-to-bundle
*ngIf="vm.addToBundleIdentifier"
[assetIdentifier]="vm.addToBundleIdentifier"
(cancel)="resetBundleIdentifier()"></dot-add-to-bundle>
</dot-portlet-base>
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
@use "variables" as *;

:host {
height: 100%;
overflow-y: auto;

::ng-deep {
dot-portlet-box {
display: flex;
flex-direction: column;
overflow-y: auto;
}
Comment on lines +8 to +12
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dot-portlet-box supposed to work without any modifications... should we make this global?


p-table {
flex-grow: 1;
}

.p-datatable,
.p-table {
display: flex;
flex-direction: column;
height: 100%;
justify-content: space-between;
background: $white;
Comment on lines +20 to +24
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be global?

}
}
}
.container-listing__header-options {
width: 100%;
display: flex;
Expand All @@ -13,15 +38,17 @@
}
}

.container-listing ::ng-deep {
overflow-y: auto;
height: 100%;
}

.container-listing__path {
color: $color-palette-gray-500;
}

dot-content-type-selector {
margin-right: $spacing-3;
}

.listing-datatable__empty {
display: flex;
justify-content: center;
font-size: $font-size-xxl;
margin-top: $spacing-4;
}