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

208 adjustable size of col #312

Merged
merged 5 commits into from
Jul 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { MatRadioModule } from '@angular/material/radio';

//module for DD/MM/YYYY date format
import { MAT_DATE_LOCALE } from '@angular/material/core';
import { MatTooltipModule } from '@angular/material/tooltip';

const MaterialComponents = [
MatButtonModule,
Expand All @@ -42,6 +43,7 @@ const MaterialComponents = [
MatProgressSpinnerModule,
MatStepperModule,
MatRadioModule,
MatTooltipModule,
];
const MaterialDatePicker = [MatDatepickerModule, MatNativeDateModule];
@NgModule({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h1>Overview of credential definitions</h1>
[displayedColSelectNames]="this.displayedColSelectNames"
[displayedColNames]="this.displayedColumnNames"
[internalColNames]="this.internalColumnNames"
[buttonFunctions]="[this.openCredDefExpandedWindow, this.openAddDIWindow]"
[buttonFunctions]="[this.openAddDIWindow, this.openCredDefExpandedWindow]"
[dialogRef]="this.dialogRef"
>
</app-filtered-table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class CredDefOverviewPageComponent implements OnInit {
) {
this.initTable();
}
displayedColumnNames: string[] = ['Name', 'Status', 'Expand', 'Send to DI']; //prettier-ignore
displayedColumnNames: string[] = ['Name', 'Status', 'Send to DI', 'Expand']; //prettier-ignore
internalColumnNames: string[] = ['alias', 'active', 'button', 'button']; //prettier-ignore
displayedColSelectNames: string[] = ['All', 'Name', 'Status']; //prettier-ignore
internalColSelectNames: string[] = ['all', 'alias', 'active']; //prettier-ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h1>Overview of proof templates</h1>
[displayedColSelectNames]="this.displayedColSelectNames"
[displayedColNames]="this.displayedColumnNames"
[internalColNames]="this.internalColumnNames"
[buttonFunctions]="[this.openShowProofDialog, this.openAddDIWindow]"
[buttonFunctions]="[this.openAddDIWindow, this.openShowProofDialog]"
[dialogRef]="this.dialogRef"
>
</app-filtered-table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class ProofTemplateOverviewPageComponent implements OnInit {
) {
this.initTable();
}
displayedColumnNames: string[] = ['Name', 'Status', 'Expand', 'Send to DI']; //prettier-ignore
displayedColumnNames: string[] = ['Name', 'Status', 'Send to DI', 'Expand', ]; //prettier-ignore
internalColumnNames: string[] = ['name', 'active', 'button', 'button']; //prettier-ignore
selectableCols: string[] = ['all', 'name', 'active']; //prettier-ignore
displayedColSelectNames: string[] = ['All', 'Name', 'Status']; //prettier-ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,50 @@
height: flex;
min-height: 0px;
}

mat-header-cell .contains-data,
mat-cell .contains-data {
margin-right: 15%;
width: 85%;
}

mat-cell p {
margin-bottom: 0;
white-space: nowrap;
overflow: hidden;
}

mat-cell p:hover {
overflow: auto;
}

.cell-button, .header-button {
flex: 0 0 15%;
}

.mat-column-Edit,
.mat-column-Delete,
.mat-column-Show-details,
.mat-column-Expand {
flex: 0 0 4%;
}


/* width */
::-webkit-scrollbar {
margin-bottom: -15px;
width: 2px;
height: 9px;
}

/* Track */
::-webkit-scrollbar-track {
box-shadow: inset 0 0 5px rgba(128, 128, 128, 1);
border-radius: 10px;
}

/* Handle */
::-webkit-scrollbar-thumb {
background-color: #869196;
border-radius: 10px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
</ng-container>
<br />
<br />
<!-- <div class="table-responsive"> -->
<mat-table
class="filtered-table mat-elevation-z8"
[dataSource]="filteredTableSource"
Expand All @@ -54,12 +55,23 @@
col != 'delete'
"
>
<mat-header-cell *matHeaderCellDef>{{
displayedColNames[i]
}}</mat-header-cell>
<mat-header-cell *matHeaderCellDef>
<div class="contains-data">
{{ displayedColNames[i] }}
</div>
</mat-header-cell>
<mat-cell *matCellDef="let data">
<p *ngIf="data[col] == null">-</p>
<p *ngIf="data[col] != null">{{ data[col] }}</p>
<div class="contains-data">
<p *ngIf="data[col] == null">-</p>

<p
*ngIf="data[col] != null"
class="contains-data"
matTooltip="{{ data[col] }}"
>
{{ data[col] }}
</p>
</div>
</mat-cell>
</div>
<div *ngIf="col == 'checkbox'">
Expand Down Expand Up @@ -101,8 +113,14 @@
<div *ngIf="col == 'button'">
<!-- normal buttons -->
<ng-container>
<mat-header-cell *matHeaderCellDef></mat-header-cell>
<mat-cell *matCellDef="let row = dataIndex">
<mat-header-cell
*matHeaderCellDef
class="{{ 'header-' + getButtonColName(i) }}"
></mat-header-cell>
<mat-cell
*matCellDef="let row = dataIndex"
class="{{ 'cell-' + getButtonColName(i) }}"
>
<div [ngSwitch]="displayedColNames[i]">
<div *ngSwitchCase="'Edit'">
<button mat-icon-button (mousedown)="this.buttonEvent(row, i)">
Expand All @@ -120,7 +138,7 @@
</div>
<div *ngSwitchCase="'Expand'">
<button mat-icon-button (mousedown)="this.buttonEvent(row, i)">
<mat-icon>manage_accounts</mat-icon>
<mat-icon>contacts</mat-icon>
</button>
</div>
<div *ngSwitchCase="'Show details'">
Expand Down Expand Up @@ -237,3 +255,4 @@
></mat-row>
</div>
</mat-table>
<!-- </div> -->
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ export class FilteredTableComponent implements OnInit {
selection: SelectionModel<any>;
expandedDetailsFormArray: FormArray = new FormArray([]);

constructor(public fb: FormBuilder, private dataUpdateService: DataUpdateService) {
constructor(
public fb: FormBuilder,
private dataUpdateService: DataUpdateService
) {
const initialSelection: any[] | undefined = [];
const allowMultiSelect = true;
this.selection = new SelectionModel<any>(
Expand Down Expand Up @@ -254,9 +257,9 @@ export class FilteredTableComponent implements OnInit {
dataStr = Object.keys(data)
.reduce((currentTerm: string, key: string) => {
if (this.internalColSelectNames.find((x) => key == x)) {
let tmp_data = (data as { [key: string]: any })[key]
let tmp_data = (data as { [key: string]: any })[key];
if (tmp_data == undefined) {
return currentTerm + '◬'
return currentTerm + '◬';
}
if (key == 'active') {
return currentTerm + '◬' + ((tmp_data) ? 'active' : 'inactive');
Expand All @@ -269,11 +272,10 @@ export class FilteredTableComponent implements OnInit {
}, '')
.toLowerCase();
} else {
let tmp_data = (data as { [key: string]: any })[column]
let tmp_data = (data as { [key: string]: any })[column];
if (tmp_data == undefined) {
dataStr = ''
}
else {
dataStr = '';
} else {
if (column == 'active') {
dataStr = '◬' + ((tmp_data) ? 'active' :'inactive');
} else {
Expand Down Expand Up @@ -384,4 +386,10 @@ export class FilteredTableComponent implements OnInit {
isRowDisabled(row: number) {
return !this.selection.isSelected(this.tableData[row]);
}

getButtonColName(i: number) {
return this.internalColNames[i] == 'button'
? 'button'
: this.displayedColNames[i];
}
}
43 changes: 40 additions & 3 deletions src/digitalIdentity-frontend/src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,44 @@ h2 {
justify-content: left;
color: $adorsys-text !important;
}
// tooltip
.mat-tooltip {
font-size: larger;
max-width: 20rem !important;
background-color: $adorsys-primary;
}

// scroll able table

// .table-responsive {
// display: block;
// width: 100%;
// overflow-x: auto;
// .mat-table {
// width: 100%;
// max-width: 100%;
// margin-bottom: 1rem;
// display: table;
// border-collapse: collapse;
// margin: 0px;
// }
// .mat-row,
// .mat-header-row {
// display: table-row;
// padding: 0.8rem 0.2rem;
// }
// .mat-cell,
// .mat-header-cell {
// word-wrap: initial;
// display: table-cell;
// // padding: 0px 5px;
// line-break: unset;
// width: auto;
// white-space: nowrap;
// overflow: hidden;
// vertical-align: middle;
// }
// }

// filters
.filter-selection {
Expand All @@ -372,8 +410,7 @@ h2 {
.filter-col-selection {
.mat-select-value,
.mat-select-arrow,
.mat-input-element
{
.mat-input-element {
color: white !important;
}
}
Expand Down Expand Up @@ -506,7 +543,7 @@ mat-card {
color: white !important;
}

.aligned-with-icon{
.aligned-with-icon {
position: absolute;
margin-top: 5px;
}