Add icons to pages and tables

pull/6/head
Max Ehrlicher-Schmidt 4 years ago
parent 28fb8ff8e3
commit 169c0bbc58

@ -29,7 +29,7 @@ export class AppComponent {
children: [ children: [
{ {
displayName: 'Lastenräder', displayName: 'Lastenräder',
iconName: 'group', iconName: 'directions_bike',
route: 'table/bikes' route: 'table/bikes'
}, },
{ {
@ -39,7 +39,7 @@ export class AppComponent {
}, },
{ {
displayName: 'Standorte', displayName: 'Standorte',
iconName: 'group', iconName: 'place',
route: 'table/lendingStations' route: 'table/lendingStations'
}] }]
}]; }];

@ -8,8 +8,9 @@
</div> </div>
<div class="data-page-wrapper" *ngIf="data"> <div class="data-page-wrapper" *ngIf="data">
<h1> <h1 class="headline">
{{ data[headlineDataPath] }} {{ data[headlineDataPath] }}
<mat-icon>{{headlineIconName}}</mat-icon>
</h1> </h1>
<ng-container *ngFor="let object of propertiesInfo"> <ng-container *ngFor="let object of propertiesInfo">
<mat-card class="inline-card" *ngIf="object.type === 'Group'"> <mat-card class="inline-card" *ngIf="object.type === 'Group'">

@ -29,3 +29,11 @@
top: 2em; top: 2em;
right: 2em; right: 2em;
} }
.headline {
display: flex;
align-items: center;
.mat-icon {
margin-left: 8px;
}
}

@ -47,9 +47,12 @@ export class DataPageComponent implements OnInit, OnDestroy {
@Input() @Input()
dataService: any; dataService: any;
/** specifies which property should be shown in the headline */
@Input() @Input()
headlineDataPath: string; headlineDataPath: string;
@Input() @Input()
headlineIconName: string = "help_outline";
@Input()
pageDataGQLType: string; pageDataGQLType: string;
@Input() @Input()
pageDataGQLUpdateInputType: string; pageDataGQLUpdateInputType: string;

@ -1,6 +1,7 @@
<div class="table-page-wrapper"> <div class="table-page-wrapper">
<h1 class="headline" *ngIf="headline"> <h1 class="headline" *ngIf="headline">
{{ headline }} {{ headline }}
<mat-icon>{{headlineIconName}}</mat-icon>
</h1> </h1>
<div class="table-control"> <div class="table-control">
<!--<button <!--<button

@ -3,7 +3,13 @@
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
.headline { .headline {
display: flex;
align-items: center;
margin: 0 0.5em; margin: 0 0.5em;
margin-top: 0.25em;
.mat-icon {
margin-left: 8px;
}
} }
.table-control { .table-control {
margin: 0.5em; margin: 0.5em;

@ -29,8 +29,12 @@ import { SelectObjectDialogComponent } from '../tableComponents/select-object-di
styleUrls: ['./table.component.scss'], styleUrls: ['./table.component.scss'],
}) })
export class TableComponent implements AfterViewInit { export class TableComponent implements AfterViewInit {
/** specifies the headline */
@Input() @Input()
headline: string = null; headline: string = null;
@Input()
headlineIconName: string = "help_outline";
/** this array defines the columns and translations of the table and the order they are displayed */ /** this array defines the columns and translations of the table and the order they are displayed */
@Input() @Input()
columnInfo: { columnInfo: {

@ -2,6 +2,7 @@
[dataService]="dataService" [dataService]="dataService"
[propertiesInfo]="propertiesInfo" [propertiesInfo]="propertiesInfo"
[headlineDataPath]="headlineDataPath" [headlineDataPath]="headlineDataPath"
[headlineIconName]="headlineIconName"
[pageDataGQLType]="pageDataGQLType" [pageDataGQLType]="pageDataGQLType"
[pageDataGQLUpdateInputType]="pageDataGQLUpdateInputType" [pageDataGQLUpdateInputType]="pageDataGQLUpdateInputType"
(lockEvent)="lock($event)" (lockEvent)="lock($event)"

@ -236,6 +236,7 @@ export class BikeComponent implements OnInit {
]; ];
headlineDataPath = 'name'; headlineDataPath = 'name';
headlineIconName = 'directions_bike'
pageDataGQLType: string = 'CargoBike'; pageDataGQLType: string = 'CargoBike';
pageDataGQLUpdateInputType: string = 'CargoBikeUpdateInput'; pageDataGQLUpdateInputType: string = 'CargoBikeUpdateInput';

@ -2,6 +2,7 @@
[dataService]="dataService" [dataService]="dataService"
[propertiesInfo]="propertiesInfo" [propertiesInfo]="propertiesInfo"
[headlineDataPath]="headlineDataPath" [headlineDataPath]="headlineDataPath"
[headlineIconName]="headlineIconName"
[pageDataGQLType]="pageDataGQLType" [pageDataGQLType]="pageDataGQLType"
[pageDataGQLUpdateInputType]="pageDataGQLUpdateInputType" [pageDataGQLUpdateInputType]="pageDataGQLUpdateInputType"
(lockEvent)="lock($event)" (lockEvent)="lock($event)"

@ -28,9 +28,7 @@ export class LendingStationComponent implements OnInit {
{ {
type: 'Group', type: 'Group',
title: 'Öffnungszeiten', title: 'Öffnungszeiten',
properties: [ properties: [],
],
}, },
{ {
type: 'Group', type: 'Group',
@ -54,6 +52,7 @@ export class LendingStationComponent implements OnInit {
}, },
{ dataPath: 'contactInformationIntern.email', translation: 'Email' }, { dataPath: 'contactInformationIntern.email', translation: 'Email' },
{ dataPath: 'contactInformationIntern.email2', translation: 'Email 2' }, { dataPath: 'contactInformationIntern.email2', translation: 'Email 2' },
{ dataPath: 'contactInformationIntern.note', translation: 'Anmerkung' },
], ],
}, },
{ {
@ -78,6 +77,7 @@ export class LendingStationComponent implements OnInit {
}, },
{ dataPath: 'contactInformationExtern.email', translation: 'Email' }, { dataPath: 'contactInformationExtern.email', translation: 'Email' },
{ dataPath: 'contactInformationExtern.email2', translation: 'Email 2' }, { dataPath: 'contactInformationExtern.email2', translation: 'Email 2' },
{ dataPath: 'contactInformationExtern.note', translation: 'Anmerkung' },
], ],
}, },
/* /*
@ -118,6 +118,7 @@ export class LendingStationComponent implements OnInit {
]; ];
headlineDataPath = 'name'; headlineDataPath = 'name';
headlineIconName = 'location_on';
pageDataGQLType: string = 'LendingStation'; pageDataGQLType: string = 'LendingStation';
pageDataGQLUpdateInputType: string = 'LendingStationUpdateInput'; pageDataGQLUpdateInputType: string = 'LendingStationUpdateInput';

@ -1,5 +1,6 @@
<app-table <app-table
[headline]="headline" [headline]="headline"
[headlineIconName]="headlineIconName"
[columnInfo]="columnInfo" [columnInfo]="columnInfo"
[dataService]="dataService" [dataService]="dataService"
[tableDataGQLType]="tableDataGQLType" [tableDataGQLType]="tableDataGQLType"

@ -111,7 +111,13 @@ export class BikesComponent implements OnInit {
translation: '', translation: '',
}, },
{ dataPath: 'lendingStation.id', translation: '' }, { dataPath: 'lendingStation.id', translation: '' },
{ dataPath: 'lendingStation.name', translation: '' }, {
dataPath: 'lendingStation.name',
translation: '',
link: (row: any) => {
return '/lendingStation/' + row['lendingStation.id'];
},
},
{ dataPath: 'lendingStation.address.number', translation: '' }, { dataPath: 'lendingStation.address.number', translation: '' },
{ dataPath: 'lendingStation.address.street', translation: '' }, { dataPath: 'lendingStation.address.street', translation: '' },
{ dataPath: 'lendingStation.address.zip', translation: '' }, { dataPath: 'lendingStation.address.zip', translation: '' },
@ -124,6 +130,7 @@ export class BikesComponent implements OnInit {
tableDataGQLUpdateInputType: string = 'CargoBikeUpdateInput'; tableDataGQLUpdateInputType: string = 'CargoBikeUpdateInput';
headline = 'Lastenräder'; headline = 'Lastenräder';
headlineIconName = 'directions_bike';
loadingRowIds: string[] = []; loadingRowIds: string[] = [];
constructor(private bikesService: BikesService) {} constructor(private bikesService: BikesService) {}

@ -1,25 +0,0 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { EngagementTypesComponent } from './engagement-types.component';
describe('EngagementTypesComponent', () => {
let component: EngagementTypesComponent;
let fixture: ComponentFixture<EngagementTypesComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ EngagementTypesComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(EngagementTypesComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -1,5 +1,6 @@
<app-table <app-table
[headline]="headline" [headline]="headline"
[headlineIconName]="headlineIconName"
[columnInfo]="columnInfo" [columnInfo]="columnInfo"
[dataService]="dataService" [dataService]="dataService"
[tableDataGQLType]="tableDataGQLType" [tableDataGQLType]="tableDataGQLType"

@ -8,6 +8,7 @@ import {EquipmentTypeService} from 'src/app/services/equipmentType.service'
}) })
export class EquipmentTypesComponent implements OnInit { export class EquipmentTypesComponent implements OnInit {
headline = 'Equipmenttypen'; headline = 'Equipmenttypen';
headlineIconName = 'toys';
columnInfo = [ columnInfo = [
{ dataPath: 'id', translation: 'ID', readonly: true }, { dataPath: 'id', translation: 'ID', readonly: true },

@ -1,5 +1,6 @@
<app-table <app-table
[headline]="headline" [headline]="headline"
[headlineIconName]="headlineIconName"
[columnInfo]="columnInfo" [columnInfo]="columnInfo"
[dataService]="dataService" [dataService]="dataService"
[tableDataGQLType]="tableDataGQLType" [tableDataGQLType]="tableDataGQLType"

@ -8,6 +8,7 @@ import { EquipmentService } from 'src/app/services/equipment.service';
}) })
export class EquipmentComponent implements OnInit { export class EquipmentComponent implements OnInit {
headline = 'Equipment'; headline = 'Equipment';
headlineIconName = 'battery_full';
columnInfo = [ columnInfo = [
{ dataPath: 'id', translation: 'ID', readonly: true }, { dataPath: 'id', translation: 'ID', readonly: true },

@ -1,5 +1,6 @@
<app-table <app-table
[headline]="headline" [headline]="headline"
[headlineIconName]="headlineIconName"
[columnInfo]="columnInfo" [columnInfo]="columnInfo"
[dataService]="dataService" [dataService]="dataService"
[tableDataGQLType]="tableDataGQLType" [tableDataGQLType]="tableDataGQLType"

@ -68,6 +68,7 @@ export class LendingStationsComponent implements OnInit {
tableDataGQLUpdateInputType: string = 'LendingStationUpdateInput'; tableDataGQLUpdateInputType: string = 'LendingStationUpdateInput';
headline = 'Standorte'; headline = 'Standorte';
headlineIconName = 'location_on';
loadingRowIds: string[] = []; loadingRowIds: string[] = [];
constructor(private lendingStationsService: LendingStationsService) {} constructor(private lendingStationsService: LendingStationsService) {}

@ -1,5 +1,6 @@
<app-table <app-table
[headline]="headline" [headline]="headline"
[headlineIconName]="headlineIconName"
[columnInfo]="columnInfo" [columnInfo]="columnInfo"
[dataService]="dataService" [dataService]="dataService"
[tableDataGQLType]="tableDataGQLType" [tableDataGQLType]="tableDataGQLType"

@ -9,6 +9,7 @@ import { TimeFrameService } from 'src/app/services/timeFrame.service';
}) })
export class TimeFramesComponent implements OnInit { export class TimeFramesComponent implements OnInit {
headline = 'Zeitscheiben'; headline = 'Zeitscheiben';
headlineIconName = 'access_time';
columnInfo = [ columnInfo = [
{ {

Loading…
Cancel
Save