Author SHA1 Message Date
Adriano Markovic f5691ef3a3 [66] #REFACTOR 'layout: user'
LocationBasedServices/maptology/angular-layout-refactoring This commit looks good
LocationBasedServices/maptology/master This commit looks good
{Added css flex classes.}
2020-03-18 13:04:09 +01:00
Adriano Markovic 8e3dc80fb8 [66] #REFACTOR 'layout: tables'
LocationBasedServices/maptology/angular-layout-refactoring This commit looks good
{Revised layouts and solved linter issues with time-sheet.service.ts.}
2020-02-26 16:24:27 +01:00
Adriano Markovic 20108b282d [66] #REFACTOR 'layout: user'
LocationBasedServices/maptology/angular-layout-refactoring This commit looks good
{Layout revised.}
2020-02-26 13:24:50 +01:00
Adriano Markovic aac6c5f5f3 [66] #REFACTOR 'layout: export'
{Revised the layout of the exort component.}
2020-02-26 12:05:52 +01:00
Adriano Markovic 3b644cece3 [66] #REFACTOR 'Layout: tables'
{Table view layout revised.}
2020-02-26 11:36:05 +01:00
Adriano Markovic 6b5f01a573 [66] #REFACTOR 'layout: privileges'
{Layout revised. Added content-layout.}
2020-02-26 11:13:07 +01:00
Adriano Markovic 98212476f4 Removed old templates. 2020-02-26 10:36:08 +01:00
Adriano Markovic eac84438f1 [66] #REFACTOR 'Component Renamed' 2020-02-26 10:34:01 +01:00
Adriano Markovic dfacfd4ff4 [66] #REFACTOR 'layout: notices'
LocationBasedServices/maptology/angular-layout-refactoring This commit looks good
{Revised layout.}
2020-02-25 21:06:56 +01:00
Adriano Markovic 301578f241 [66] #REFACTOR 'layout: timesheet'
{Revised layout.}
2020-02-25 21:05:59 +01:00
Adriano Markovic 41dc0030c3 [misc] #REFACTOR 'layout: drawer'
{Moved the timesheet nav button up.}
2020-02-25 21:04:46 +01:00
Adriano Markovic 73ea8185a4 [66] #IMPLEMENT 'layout: header'
{Implemented the layout header layout and revised the basic layout.}
2020-02-25 21:03:52 +01:00
Adriano Markovic ff89c9a7cc [66] #REFACTOR 'component:time-sheet'
LocationBasedServices/maptology/angular-layout-refactoring This commit looks good
{Layout revised.}
2020-02-19 22:08:28 +01:00
Adriano Markovic 7451e492c6 [66] #IMPLEMENT 'component:basic-layout'
{Basic layout component added and global stylesheet revised. }
2020-02-19 22:07:04 +01:00
23 changed files with 796 additions and 529 deletions
+12 -8
View File
@@ -29,9 +29,9 @@ import { MatTableModule } from '@angular/material/table';
import { MatTabsModule } from '@angular/material/tabs';
import { MatToolbarModule } from '@angular/material/toolbar';
import { MatTooltipModule } from '@angular/material/tooltip';
import { MatButtonToggleModule } from "@angular/material/button-toggle";
import { CdkTableModule } from "@angular/cdk/table";
import { SatDatepickerModule, SatNativeDateModule } from 'saturn-datepicker'
import { MatButtonToggleModule } from '@angular/material/button-toggle';
import { CdkTableModule } from '@angular/cdk/table';
import { SatDatepickerModule, SatNativeDateModule } from 'saturn-datepicker';
import { LocationStrategy, PathLocationStrategy, registerLocaleData, DatePipe } from '@angular/common';
import LocaleDE from '@angular/common/locales/de';
@@ -44,6 +44,8 @@ import { AppComponent } from './app.component';
import { InsideComponent } from './layouts/inside.component';
import { OutsideComponent } from './layouts/outside.component';
import { FooterComponent } from './layouts/footer.component';
import { ContentLayoutComponent } from './layouts/content-layout.component';
import { ContentHeaderComponent } from './layouts/content-header.component';
import { ToolbarButtonComponent } from './widgets/toolbar-button.component';
import { LoginComponent } from './views/login.component';
@@ -108,7 +110,7 @@ import { DevicePositionService } from './services/device-position.service';
import { DevicePositionsComponent } from './views/device-positions.component';
import { ChartComponent } from './widgets/chart.component';
import { TimeSheetComponent } from './views/time-sheet.component';
import { PlacesDialogComponent } from "./widgets/places-dialog.component";
import { PlacesDialogComponent } from './widgets/places-dialog.component';
/**
@@ -181,6 +183,8 @@ registerLocaleData(LocaleDE);
ChartComponent,
TimeSheetComponent,
PlacesDialogComponent,
ContentLayoutComponent,
ContentHeaderComponent,
],
imports: [
BrowserModule,
@@ -240,10 +244,10 @@ registerLocaleData(LocaleDE);
ManageLogService, ManageUserService, ManageNoticeService
],
entryComponents: [
MessageDialogComponent,
ConfirmationDialogComponent,
ShareDialogComponent,
NicknameDialogComponent,
MessageDialogComponent,
ConfirmationDialogComponent,
ShareDialogComponent,
NicknameDialogComponent,
LogDialogComponent,
PlacesDialogComponent,
],
@@ -0,0 +1,4 @@
<mat-toolbar id="content-toolbar" [ngClass]="headerClass" [ngStyle]="headerStyle">
<ng-content select=".header-title"></ng-content>
<ng-content select=".header-actions"></ng-content>
</mat-toolbar>
@@ -0,0 +1,22 @@
import { Component, Input } from '@angular/core';
/**
* Simple content header component which is containing the name of the page on
* the left side and the action buttons on the right side.
*
* @author Adriano
*/
@Component({
selector: 'app-content-header',
templateUrl: './content-header.component.html'
})
export class ContentHeaderComponent {
/* Attributes which are forwarding the styles and classes
* to the mat-toolbar which where specified on the app-content-header.*/
@Input() headerStyle?: { [klass: string]: any; };
@Input() headerClass?: string | string[] | Set<string> | { [klass: string]: any; };
constructor() { }
}
@@ -0,0 +1,8 @@
<div class="outer-container" [ngClass]="layoutClass" [ngStyle]="layoutStyle">
<ng-content select="app-content-header"></ng-content>
<div #mainDiv class="inner-container">
<ng-content select="aside"></ng-content>
<ng-content select="main"></ng-content>
</div>
</div>
@@ -0,0 +1,32 @@
import { Component, AfterViewInit, ViewChild, ElementRef, Input } from '@angular/core';
/**
* Content layout component which displays an <app-header>
* on the top, a <main> on the left and an <aside> on the right side
* through angular projection.
* The <main> tag is mandatory and the other two can be omitted if necessary.
*
* @author Adriano
*/
@Component({
selector: 'app-content-layout',
templateUrl: './content-layout.component.html'
})
export class ContentLayoutComponent implements AfterViewInit {
/* Attributes which are forwarding the styles and classes
* to the div.outer-container which where specified on the app-content-layout.*/
@Input() layoutStyle?: { [klass: string]: any; };
@Input() layoutClass?: string | string[] | Set<string> | { [klass: string]: any; };
@ViewChild('mainDiv') mainDiv: ElementRef;
constructor() { }
ngAfterViewInit(): void {
const div: HTMLDivElement = this.mainDiv.nativeElement;
if (div.getElementsByTagName('main').length === 0) {
throw new Error('<main> tag not specified!');
}
}
}
@@ -8,6 +8,10 @@
<mat-icon class="icon-button">share</mat-icon>
<span class="mat-button">{{ res.strings('privileges_title') }}</span>
</a>
<a mat-list-item routerLink="/timesheet">
<mat-icon class="icon-button">access_time_icon</mat-icon>
<span class="mat-button">{{ res.strings('time_sheet_title') }}</span>
</a>
<a mat-list-item routerLink="/devices">
<mat-icon class="icon-button">devices</mat-icon>
<span class="mat-button">{{ res.strings('devices_title') }}</span>
@@ -20,10 +24,6 @@
<mat-icon class="icon-button">cloud_download</mat-icon>
<span class="mat-button">{{ res.strings('export_title') }}</span>
</a>
<a mat-list-item routerLink="/timesheet">
<mat-icon class="icon-button">access_time_icon</mat-icon>
<span class="mat-button">{{ res.strings('time_sheet_title') }}</span>
</a>
<h3 mat-subheader>{{res.strings('drawer_settings')}}</h3>
<a mat-list-item routerLink="/profile">
<mat-icon class="icon-button">perm_identity</mat-icon>
@@ -473,7 +473,7 @@ export class ResourceService {
'time_sheet_select_device_tooltip': 'Filtert die Zeiteinträge auf das ausgewählte Gerät.',
'time_sheet_no_device_selected': 'Keins',
'time_sheet_break_time_label': 'Pausendauer',
'time_sheet_break_time_tooltip': 'Gibt an, ab welcher Dauer die Abwesenheit vom Arbeitsplatz als Pausendauer '
'time_sheet_break_time_tooltip': 'Gibt an, ab welcher Dauer die Abwesenheit vom Arbeitsplatz als Pausendauer '
+ 'zu werten ist und somit nicht zum Zeiteintrag hinzugerechnet wird.',
'time_sheet_break_time_minutes': 'Minuten',
'time_sheet_no_break_time_selected': 'Keine',
@@ -29,7 +29,7 @@ export interface TimeSheetData {
}
/**
* Determines how the TimeSheetData
* Determines how the TimeSheetData
* of the service is grouped.
*/
export enum Grouping {
@@ -39,13 +39,17 @@ export enum Grouping {
RAW = 4 /* Raw data which was extracted from the call to the '/users/current/visits' api */
}
type DateRange = { range?: SatDatepickerRangeValue<Date>, begin?: number, end?: number };
interface DateRange {
range?: SatDatepickerRangeValue<Date>;
begin?: number;
end?: number;
}
const COLUMN_SEPARATOR = ';';
const LINE_SEPARATOR = '\r\n';
/**
* A service which is fetching data from the '/users/current/visits'
* A service which is fetching data from the '/users/current/visits'
* api and transforms it to TimeSheetData.
*/
@Injectable({
@@ -57,19 +61,19 @@ export class TimeSheetService extends MatTableDataSource<TimeSheetData> {
private static readonly DAY_IN_MILLI = 86_400_000;
/* Properties representing the current progress in
/* Properties representing the current progress in
* fetching Visit data from the server. */
fetching$ = new BehaviorSubject<boolean>(false);
error$ = new BehaviorSubject<boolean>(false);
private _visitsAvailable: boolean = false;
private _visitsAvailable = false;
private visitsPage: VisitPage = TimeSheetService.emptyPage();
private request = 0;
/* These Properties are used to filter the Visit data which then,
* in turn can be composed to the final timeSheet data shown
* to the user.
* At least the dateRange & workPlaces have to contain
/* These Properties are used to filter the Visit data which then,
* in turn can be composed to the final timeSheet data shown
* to the user.
* At least the dateRange & workPlaces have to contain
* valid values to start the composition process.
* Remark: The prefixed _prev... values serve as a workaround
* for a known bug in angular, where mat-selection is fireing
@@ -81,14 +85,14 @@ export class TimeSheetService extends MatTableDataSource<TimeSheetData> {
private _prevBreakTime: number = null;
private _dateRange: DateRange = {};
private _workPlaces: Place[] = [];
/** Creates an empty page. */
private static emptyPage() {
return { elements: [], offset: 0, total: -1, size: 0 };
}
constructor(
private apiClientService: ApiClientService,
private apiClientService: ApiClientService,
private userService: UserService
) {
super([]);
@@ -114,8 +118,10 @@ export class TimeSheetService extends MatTableDataSource<TimeSheetData> {
set grouped(grouped: Grouping) {
if (grouped != null) {
if (this._grouped !== grouped) {
if ((this._grouped === Grouping.DEFAULT || this.grouped === Grouping.BY_DAY_ACC) && this._breakTime)
if ((this._grouped === Grouping.DEFAULT || this.grouped === Grouping.BY_DAY_ACC)
&& this._breakTime) {
this._breakTime = null;
}
this._grouped = grouped;
this.updateTimeSheet();
}
@@ -129,8 +135,7 @@ export class TimeSheetService extends MatTableDataSource<TimeSheetData> {
set device(device: Device | null) {
this._prevDevice = this._device;
this._device = device;
if (this._prevDevice === null && device === null)
return;
if (this._prevDevice === null && device === null) { return; }
this.updateTimeSheet();
}
@@ -141,8 +146,7 @@ export class TimeSheetService extends MatTableDataSource<TimeSheetData> {
set breakTime(breakTime: number | null) {
this._prevBreakTime = this._breakTime;
this._breakTime = breakTime;
if (this._prevBreakTime === null && breakTime === null)
return;
if (this._prevBreakTime === null && breakTime === null) { return; }
this.updateTimeSheet();
}
@@ -154,7 +158,7 @@ export class TimeSheetService extends MatTableDataSource<TimeSheetData> {
if (dateRange !== null) {
const beginMillis = dateRange.begin.getTime();
const endMillis = new Date(dateRange.end.getTime() + TimeSheetService.DAY_IN_MILLI).getTime();
this._dateRange = {
this._dateRange = {
range: dateRange,
begin: beginMillis,
end: endMillis
@@ -174,7 +178,7 @@ export class TimeSheetService extends MatTableDataSource<TimeSheetData> {
this.updateTimeSheet();
}
setup(paginator?: MatPaginator, sort?: MatSort): void{
setup(paginator?: MatPaginator, sort?: MatSort): void {
this.paginator = paginator;
this.sort = sort;
this.fetchData();
@@ -188,7 +192,7 @@ export class TimeSheetService extends MatTableDataSource<TimeSheetData> {
}
fetchData(): void {
if (this.fetching$.getValue()) return;
if (this.fetching$.getValue()) { return; }
this.resetService(true);
this.fetchAllVisits(this.request);
}
@@ -263,8 +267,9 @@ export class TimeSheetService extends MatTableDataSource<TimeSheetData> {
}
});
/* Filter for specified device. */
if (this.device != null)
if (this.device != null) {
filteredVisits = filteredVisits.filter(visit => visit.device === this.device.id);
}
/* Map filtered visits to TimeSheetData */
if (filteredVisits.length > 0) {
@@ -274,10 +279,9 @@ export class TimeSheetService extends MatTableDataSource<TimeSheetData> {
timeSheet = this.accumulateV2TsByDay(filteredVisits);
break;
case Grouping.BY_DAY:
let tsMap = this.mapV2TsByDay(filteredVisits);
const tsMap = this.mapV2TsByDay(filteredVisits);
tsMap.forEach((ts: TimeSheetData[]) => {
if (ts.length > 0)
timeSheet.push(...ts);
if (ts.length > 0) { timeSheet.push(...ts); }
});
break;
case Grouping.RAW:
@@ -285,13 +289,13 @@ export class TimeSheetService extends MatTableDataSource<TimeSheetData> {
break;
}
}
}
}
this.data = timeSheet;
}
/**
* Mapping the passed Visit objects to raw TimeSheetData objects.
*
*
* @param visits Visits to map.
* @return List of the corresponding TimeSheetData objects.
*/
@@ -319,7 +323,7 @@ export class TimeSheetService extends MatTableDataSource<TimeSheetData> {
* timestamp: 1580425200000
* GMT: Thursday, 30. January 2020 23:00:00
* Germany: Freitag, 31. Januar 2020 00:00:00 GMT+01:00
*
*
* @param visits Visits to map.
* @return Map of TimeSheetData objects grouped by days.
*/
@@ -327,29 +331,29 @@ export class TimeSheetService extends MatTableDataSource<TimeSheetData> {
const timeSheetMap = new Map<number, TimeSheetData[]>();
const rawTimeSheet: TimeSheetData[] = this.mapVisitsToTimeSheet(visits);
const putInMap = (map: Map<number, TimeSheetData[]>, key: number, value: TimeSheetData) => {
if (map.has(key))
if (map.has(key)) {
map.get(key).push(value);
else
} else {
map.set(key, [value]);
}
};
if (rawTimeSheet.length > 0) {
return rawTimeSheet
.reduce((prevMap: Map<number, TimeSheetData[]>, currTS: TimeSheetData) => {
let beginMidnight = this.getMidnightDate(currTS.beginDate.getTime()).getTime();
let endMidnight = this.getMidnightDate(currTS.endDate.getTime()).getTime();
const beginMidnight = this.getMidnightDate(currTS.beginDate.getTime()).getTime();
const endMidnight = this.getMidnightDate(currTS.endDate.getTime()).getTime();
if (beginMidnight === endMidnight) {
putInMap(prevMap, beginMidnight, currTS);
}
else {
} else {
/* If beginDate & endDate are overlapping two or more days then split
* object into multiple TimeSheetData objects till endDate is reached. */
const DAY = TimeSheetService.DAY_IN_MILLI;
for (let j = beginMidnight + DAY; j <= endMidnight; j += DAY) {
const begin = (j == beginMidnight + DAY) ? currTS.beginDate.getTime() : j - DAY;
const begin = (j === beginMidnight + DAY) ? currTS.beginDate.getTime() : j - DAY;
const end = j;
const newTS = {
const newTimeSheet = {
overlappingDays: false,
beginDate: new Date(begin),
endDate: new Date(end),
@@ -357,7 +361,7 @@ export class TimeSheetService extends MatTableDataSource<TimeSheetData> {
placeId: currTS.placeId,
deviceId: currTS.deviceId
};
putInMap(prevMap, end - DAY, newTS);
putInMap(prevMap, end - DAY, newTimeSheet);
}
const newTS = {
@@ -378,10 +382,10 @@ export class TimeSheetService extends MatTableDataSource<TimeSheetData> {
}
/**
* Maps a list of Visits to a list of TimeSheetData which in turn
* is containing only accumulated TimeSheetData object each
* Maps a list of Visits to a list of TimeSheetData which in turn
* is containing only accumulated TimeSheetData object each
* representing a single day.
*
*
* @param visits Visits to map.
* @param workingTimeAcc Function to accumulate the working time.
* @returns List of accumulated TimeSheetData.
@@ -400,8 +404,8 @@ export class TimeSheetService extends MatTableDataSource<TimeSheetData> {
const places = new Set<number>();
const devices = new Set<number>();
tsList.forEach((ts: TimeSheetData) => {
if (ts.placeId) places.add(ts.placeId);
if (ts.deviceId) devices.add(ts.deviceId);
if (ts.placeId) { places.add(ts.placeId); }
if (ts.deviceId) { devices.add(ts.deviceId); }
});
const btThreshold = (this.breakTime) ? this.breakTime * 60_000 : 0;
@@ -430,7 +434,6 @@ export class TimeSheetService extends MatTableDataSource<TimeSheetData> {
{ sheet: null, acc: { hours: 0, minutes: 0 }, breakAcc: { hours: 0, minutes: 0} }
);
const accWorkingHours = this.processWorkingHours(timeAccumulation.acc, timeAccumulation.breakAcc);
timeSheet.push({
overlappingDays: false,
beginDate: new Date(erliestBegin),
@@ -441,14 +444,14 @@ export class TimeSheetService extends MatTableDataSource<TimeSheetData> {
});
}
});
return timeSheet;
return timeSheet;
}
/**
* Processes the work and break time. If Grouping is DEFAULT, the break time is evaluated
* and has to fit the legal requirements of having at least a 30 or 45 minutes break when
* and has to fit the legal requirements of having at least a 30 or 45 minutes break when
* working more than 6 or 9 hours respectively.
*
*
* @param working The time that is counting as work time.
* @param breaking The time between the single work time entries
* which can be seen as break time.
@@ -459,25 +462,26 @@ export class TimeSheetService extends MatTableDataSource<TimeSheetData> {
if (this.grouped === Grouping.DEFAULT) {
let subtrahend = 0;
breaking = this.normalizeTime(breaking);
if (working.hours >= 6 && breaking.hours === 0 && breaking.minutes < 30)
if (working.hours >= 6 && breaking.hours === 0 && breaking.minutes < 30) {
subtrahend = 30 - breaking.minutes;
else if (working.hours >= 9 && breaking.hours === 0 && breaking.minutes < 45)
} else if (working.hours >= 9 && breaking.hours === 0 && breaking.minutes < 45) {
subtrahend = 45 - breaking.minutes;
}
working.minutes -= subtrahend;
if (working.minutes < 0) {
--working.hours;
working.minutes = 60 - working.minutes;
}
/* Rounds up the minutes to a multiple of 15. */
if (working.minutes !== 0)
if (working.minutes !== 0) {
working.minutes += Math.floor(15 - working.minutes % 15);
}
if (working.minutes === 60) {
++working.hours;
working.minutes = 0;
}
if (working.hours >= 10)
working = { hours: 10, minutes: 0 };
if (working.hours >= 10) { working = { hours: 10, minutes: 0 }; }
}
return working;
}
@@ -489,14 +493,14 @@ export class TimeSheetService extends MatTableDataSource<TimeSheetData> {
}
private getMidnightDate(tstp: number): Date {
let midnight = new Date(tstp);
const midnight = new Date(tstp);
midnight.setHours(0, 0, 0, 0);
return midnight;
};
}
private getWorkingTime(beginMillis: number, endMillis: number): Time {
const beginMinutes = Math.floor(beginMillis/1000/60);
const endMinutes = Math.floor(endMillis/1000/60);
const beginMinutes = Math.floor(beginMillis / 1000 / 60);
const endMinutes = Math.floor(endMillis / 1000 / 60);
const totalMinutes = endMinutes - beginMinutes;
const totalHours = totalMinutes / 60;
@@ -511,18 +515,18 @@ export class TimeSheetService extends MatTableDataSource<TimeSheetData> {
}
getWorkplaceName(place: Place): string {
return (place.nickname != null && place.nickname.length > 0)? place.nickname : place.address;
return (place.nickname != null && place.nickname.length > 0) ? place.nickname : place.address;
}
getWorkplaceString(data: TimeSheetData): string {
let res = '';
if (data.placeId) {
const place = this.workPlaces.find(place => place.id === data.placeId);
const place = this.workPlaces.find(p => p.id === data.placeId);
res = this.getWorkplaceName(place);
} else {
data.placesSet.forEach(id => {
const place = this.workPlaces.find(place => place.id === id);
res += this.getWorkplaceName(place) + ', '
const place = this.workPlaces.find(p => p.id === id);
res += this.getWorkplaceName(place) + ', ';
});
res = res.slice(0, res.length - 2);
}
@@ -530,9 +534,9 @@ export class TimeSheetService extends MatTableDataSource<TimeSheetData> {
}
getDate(data: TimeSheetData): string {
if (this.grouped == Grouping.RAW) {
if (this.grouped === Grouping.RAW) {
let prefix = '';
let date = formatDate(data.endDate, 'dd.LL.yyyy', 'de');
const date = formatDate(data.endDate, 'dd.LL.yyyy', 'de');
if (data.overlappingDays) {
prefix = formatDate(data.beginDate, 'dd', 'de') + ' - ';
}
@@ -552,13 +556,13 @@ export class TimeSheetService extends MatTableDataSource<TimeSheetData> {
exportStr = this.createJSON();
break;
}
if (!exportStr) return false;
if (!exportStr) { return false; }
/* '\ufeff' -> UTF-8 Header Byte prepended. */
const blob = new Blob(['\ufeff', exportStr], { type: `text/${type};` });
const login = this.userService.getLogin();
let name = 'timesheet-export';
if (login != null) name += '-' + login;
if (login != null) { name += '-' + login; }
name += '-' + Date.now();
this.saveAs(`${name}.${type}`, blob);
return true;
@@ -580,8 +584,7 @@ export class TimeSheetService extends MatTableDataSource<TimeSheetData> {
}
private createCSV(): string | null {
if (this.data.length === 0)
return null;
if (this.data.length === 0) { return null; }
let result = '';
result += 'DATE' + COLUMN_SEPARATOR;
result += 'FROM' + COLUMN_SEPARATOR;
@@ -609,7 +612,7 @@ export class TimeSheetService extends MatTableDataSource<TimeSheetData> {
to: formatDate(td.endDate, 'H:mm', 'de'),
workingTime: `${td.duration.hours} h ${td.duration.minutes} m`,
workplaces: this.getWorkplaceString(td)
}
};
})
);
}
@@ -1,9 +1,12 @@
<div style="margin: 20px;">
<mat-toolbar>
<mat-icon>devices</mat-icon>
<span style="margin-left: 10px">{{ res.strings('devices_title') }}</span>
</mat-toolbar>
<div class="mat-elevation-z2">
<app-content-layout [layoutClass]="'table-page'">
<app-content-header>
<div class="header-title">
<mat-icon>devices</mat-icon>
<span>{{ res.strings('devices_title') }}</span>
</div>
</app-content-header>
<main class="mat-elevation-z2">
<ng-container *ngIf="loading.getValue()">
<mat-progress-bar mode="indeterminate" color="accent"></mat-progress-bar>
</ng-container>
@@ -65,6 +68,5 @@
<mat-paginator #paginator [pageSize]="20" [pageSizeOptions]="[1, 10, 20, 50]" [showFirstLastButtons]="true">
</mat-paginator>
</div>
</div>
</main>
</app-content-layout>
+61 -63
View File
@@ -1,63 +1,61 @@
<ng-container>
<div style="flex: 1 1 100%;">
<mat-toolbar style="margin-top:20px;background:transparent">
<mat-icon style="margin-left:20px;">cloud_download</mat-icon>
<span style="margin-left: 10px">{{ res.strings('export_title') }}</span>
</mat-toolbar>
<mat-grid-list [cols]="columns" gutterSize="10" rowHeight="450" class="grid-layout">
<mat-grid-tile>
<mat-card class="mat-typography" class="user-card">
<mat-card-title-group>
<mat-card-title>{{ res.strings('export_explain_title') }}</mat-card-title>
<mat-card-subtitle>{{ res.strings('export_explain_subtitle') }}</mat-card-subtitle>
</mat-card-title-group>
<mat-card-content style="min-height:130px">
<p class="mat-body">{{ res.strings('export_explain_content') }}</p>
<p class="mat-body">{{ res.strings('export_explain_process') }}</p>
</mat-card-content>
<mat-card-actions fxFlexLayout="row" fxLayoutAlign="space-around center">
<ng-container *ngIf="exportService.downloading | async; else exportButton">
<button mat-raised-button color="accent" (click)="exportService.stopDownload()">
<mat-icon class="icon-button">cancel</mat-icon>
<span>{{ res.strings('button_cancel') }}</span>
</button>
</ng-container>
<ng-template #exportButton>
<button mat-raised-button color="primary" (click)="exportService.startDownload()">
<mat-icon class="icon-button">import_export</mat-icon>
<span>{{ res.strings('button_export') }}</span>
</button>
</ng-template>
</mat-card-actions>
</mat-card>
</mat-grid-tile>
<mat-grid-tile>
<mat-card class="mat-typography" class="user-card">
<mat-card-title-group>
<mat-card-title>{{ res.strings('export_download_title') }}</mat-card-title>
<mat-card-subtitle>{{ res.strings('export_download_subtitle') }}</mat-card-subtitle>
</mat-card-title-group>
<mat-card-content>
<mat-list>
<mat-divider></mat-divider>
<mat-list-item>
<mat-label style="font-size:85%" matLine>{{ res.strings('export_devices') }}<div style="float: right;">{{ (exportService.devices | async)?.size }}</div></mat-label>
<mat-progress-bar mode="determinate" [value]="progressValue(exportService.devices | async)" matLine></mat-progress-bar>
</mat-list-item>
<mat-divider></mat-divider>
<mat-list-item>
<mat-label style="font-size:85%" matLine>{{ res.strings('export_places') }}<div style="float: right;">{{ (exportService.places | async)?.size }}</div></mat-label>
<mat-progress-bar mode="determinate" [value]="progressValue(exportService.places | async)" matLine></mat-progress-bar>
</mat-list-item>
<mat-divider></mat-divider>
<mat-list-item>
<mat-label style="font-size:85%" matLine>{{ res.strings('export_visits') }}<div style="float: right;">{{ (exportService.visits | async)?.size }}</div></mat-label>
<mat-progress-bar mode="determinate" [value]="progressValue(exportService.visits | async)" matLine></mat-progress-bar>
</mat-list-item>
</mat-list>
</mat-card-content>
</mat-card>
</mat-grid-tile>
</mat-grid-list>
</div>
</ng-container>
<app-content-layout>
<app-content-header [headerClass]="'header-transparent'">
<div class="header-title">
<mat-icon>cloud_download</mat-icon>
<span>{{ res.strings('export_title') }}</span>
</div>
</app-content-header>
<main class="flex-row-wrap justify-space-evenly">
<mat-card class="mat-typography user-card">
<mat-card-title-group>
<mat-card-title>{{ res.strings('export_explain_title') }}</mat-card-title>
<mat-card-subtitle>{{ res.strings('export_explain_subtitle') }}</mat-card-subtitle>
</mat-card-title-group>
<mat-card-content>
<p class="mat-body">{{ res.strings('export_explain_content') }}</p>
<p class="mat-body">{{ res.strings('export_explain_process') }}</p>
</mat-card-content>
<mat-card-actions fxFlexLayout="row" fxLayoutAlign="space-around center">
<ng-container *ngIf="exportService.downloading | async; else exportButton">
<button mat-raised-button color="accent" (click)="exportService.stopDownload()">
<mat-icon class="icon-button">cancel</mat-icon>
<span>{{ res.strings('button_cancel') }}</span>
</button>
</ng-container>
<ng-template #exportButton>
<button mat-raised-button color="primary" (click)="exportService.startDownload()">
<mat-icon class="icon-button">import_export</mat-icon>
<span>{{ res.strings('button_export') }}</span>
</button>
</ng-template>
</mat-card-actions>
</mat-card>
<mat-card class="mat-typography user-card">
<mat-card-title-group>
<mat-card-title>{{ res.strings('export_download_title') }}</mat-card-title>
<mat-card-subtitle>{{ res.strings('export_download_subtitle') }}</mat-card-subtitle>
</mat-card-title-group>
<mat-card-content>
<mat-list>
<mat-divider></mat-divider>
<mat-list-item>
<mat-label class="progress-label" matLine>{{ res.strings('export_devices') }}<div class="progress-float">{{ (exportService.devices | async)?.size }}</div></mat-label>
<mat-progress-bar mode="determinate" [value]="progressValue(exportService.devices | async)" matLine></mat-progress-bar>
</mat-list-item>
<mat-divider></mat-divider>
<mat-list-item>
<mat-label class="progress-label" matLine>{{ res.strings('export_places') }}<div class="progress-float">{{ (exportService.places | async)?.size }}</div></mat-label>
<mat-progress-bar mode="determinate" [value]="progressValue(exportService.places | async)" matLine></mat-progress-bar>
</mat-list-item>
<mat-divider></mat-divider>
<mat-list-item>
<mat-label class="progress-label" matLine>{{ res.strings('export_visits') }}<div class="progress-float">{{ (exportService.visits | async)?.size }}</div></mat-label>
<mat-progress-bar mode="determinate" [value]="progressValue(exportService.visits | async)" matLine></mat-progress-bar>
</mat-list-item>
</mat-list>
</mat-card-content>
</mat-card>
</main>
</app-content-layout>
@@ -12,7 +12,11 @@ import { Snackbars } from '../utils/snackbars';
@Component({
selector: 'app-export',
templateUrl: './export.component.html'
templateUrl: './export.component.html',
styles: [
`.progress-label { font-size: 85% !important; }`,
`.progress-float { float: right; }`
]
})
export class ExportComponent implements OnInit, OnDestroy {
@@ -1,20 +1,32 @@
<mat-toolbar style="margin-top:20px;background:transparent">
<mat-icon style="margin-left:20px;">subject</mat-icon>
<span style="margin-left: 10px">Logs</span>
<div flexLayout="row" fxLayoutAlign="end center" fxFlex="1 1 auto" fxLayoutGap="10px">
<button mat-icon-button [matTooltip]="res.strings('manage_logs_connect_tooltip')" (click)="onConnect()" [disabled]="connected || (connecting | async)">
<mat-icon>play_circle_outline</mat-icon>
<app-content-layout [layoutClass]="'table-page'">
<app-content-header>
<div class="header-title">
<mat-icon>subject</mat-icon>
<span>Logs</span>
</div>
<div class="header-actions">
<button mat-icon-button
[matTooltip]="res.strings('manage_logs_connect_tooltip')"
(click)="onConnect()"
[disabled]="connected || (connecting | async)">
<mat-icon>play_circle_outline</mat-icon>
</button>
<button mat-icon-button [matTooltip]="res.strings('manage_logs_disconnect_tooltip')" (click)="onDisconnect()" [disabled]="!connected || (connecting | async)">
<mat-icon>pause_circle_outline</mat-icon>
<button mat-icon-button
[matTooltip]="res.strings('manage_logs_disconnect_tooltip')"
(click)="onDisconnect()"
[disabled]="!connected || (connecting | async)">
<mat-icon>pause_circle_outline</mat-icon>
</button>
<button mat-icon-button [matTooltip]="res.strings('manage_logs_clear_tooltip')" (click)="onClear()" [disabled]="(connecting | async)">
<mat-icon>not_interested</mat-icon>
<button mat-icon-button
[matTooltip]="res.strings('manage_logs_clear_tooltip')"
(click)="onClear()"
[disabled]="(connecting | async)">
<mat-icon>not_interested</mat-icon>
</button>
</div>
</mat-toolbar>
<div style="margin: 20px;">
<div class="mat-elevation-z2">
</app-content-header>
<main class="mat-elevation-z2">
<ng-container *ngIf="connecting | async">
<mat-progress-bar mode="indeterminate" color="accent"></mat-progress-bar>
</ng-container>
@@ -66,6 +78,5 @@
<mat-header-row *matHeaderRowDef="getColumns()"></mat-header-row>
<mat-row *matRowDef="let row; columns: getColumns();"></mat-row>
</mat-table>
</div>
</div>
</main>
</app-content-layout>
@@ -1,15 +1,18 @@
<div style="margin: 20px;">
<mat-toolbar>
<mat-icon>forum</mat-icon>
<span style="margin-left: 10px">Hinweise</span>
<div flexLayout="row" fxLayoutAlign="end center" fxFlex="1 1 auto" fxLayoutGap="10px">
<app-language-select style="padding-top:5px;" [value]="language" (change)="language = $event"></app-language-select>
<app-content-layout [layoutClass]="'table-page'">
<app-content-header>
<div class="header-title">
<mat-icon>forum</mat-icon>
<span>{{ res.strings('manage_notices_title') }}</span>
</div>
<div class="header-actions flex-row-nowrap align-center">
<app-language-select [value]="language" (change)="language = $event"></app-language-select>
<button mat-icon-button matTooltip="Hinweis hinzufügen" routerLink="0" [disabled]="loading.getValue()">
<mat-icon>add_circle_outline</mat-icon>
</button>
</div>
</mat-toolbar>
<div class="mat-elevation-z2">
</app-content-header>
<main class="mat-elevation-z2">
<ng-container *ngIf="loading.getValue()">
<mat-progress-bar mode="indeterminate" color="accent"></mat-progress-bar>
</ng-container>
@@ -90,6 +93,5 @@
<mat-paginator #paginator [pageSize]="20" [pageSizeOptions]="[1, 10, 20, 50]" [showFirstLastButtons]="true">
</mat-paginator>
</div>
</div>
</main>
</app-content-layout>
@@ -1,29 +1,40 @@
<div style="margin: 20px;">
<mat-toolbar>
<mat-icon>people</mat-icon>
<span style="margin-left: 10px">{{ res.strings('manage_users_title') }}</span>
<div flexLayout="row" fxLayoutAlign="end center" fxFlex="1 1 auto" fxLayoutGap="10px">
<div style="padding-top:15px;">
<form #searchForm="ngForm" style="font-size: 12px">
<mat-form-field style="max-width:120px">
<input matInput #termField="ngModel" maxlength="64" name="term" [placeholder]="res.strings('manage_users_term_placeholder')" [(ngModel)]="term" pattern="([A-Za-z]|[\u00C0-\u00FF]| ){0,64}"
[disabled]="loading.getValue()" (keyup.enter)="onSearch()">
<mat-error *ngIf="termField.invalid">
<ng-container [ngSwitch]="encode(termField.errors)">
<ng-container *ngSwitchCase="FormErrorCode.REQUIRED">{{res.strings('manage_users_term_required')}}</ng-container>
<ng-container *ngSwitchCase="FormErrorCode.PATTERN">{{res.strings('manage_users_term_pattern')}}</ng-container>
<app-content-layout [layoutClass]="'table-page'">
<app-content-header>
<div class="header-title">
<mat-icon>people</mat-icon>
<span>{{ res.strings('manage_users_title') }}</span>
</div>
<div class="header-actions flex-row-nowrap">
<form #searchForm="ngForm" style="font-size: 12px">
<mat-form-field style="max-width:120px">
<input matInput #termField="ngModel"
maxlength="64" name="term"
[placeholder]="res.strings('manage_users_term_placeholder')"
[(ngModel)]="term"
pattern="([A-Za-z]|[\u00C0-\u00FF]| ){0,64}"
[disabled]="loading.getValue()" (keyup.enter)="onSearch()">
<mat-error *ngIf="termField.invalid">
<ng-container [ngSwitch]="encode(termField.errors)">
<ng-container *ngSwitchCase="FormErrorCode.REQUIRED">
{{res.strings('manage_users_term_required')}}
</ng-container>
</mat-error>
</mat-form-field>
</form>
</div>
<button mat-icon-button [matTooltip]="res.strings('manage_users_search_tooltip')" (click)="onSearch()" [disabled]="loading.getValue()">
<ng-container *ngSwitchCase="FormErrorCode.PATTERN">
{{res.strings('manage_users_term_pattern')}}
</ng-container>
</ng-container>
</mat-error>
</mat-form-field>
</form>
<button mat-icon-button
[matTooltip]="res.strings('manage_users_search_tooltip')"
(click)="onSearch()"
[disabled]="loading.getValue()">
<mat-icon>search</mat-icon>
</button>
</div>
</app-content-header>
</mat-toolbar>
<div class="mat-elevation-z2">
<main class="mat-elevation-z2">
<ng-container *ngIf="loading.getValue()">
<mat-progress-bar mode="indeterminate" color="accent"></mat-progress-bar>
</ng-container>
@@ -112,6 +123,5 @@
<mat-paginator #paginator [pageSize]="20" [pageSizeOptions]="[1, 10, 20, 50]" [showFirstLastButtons]="true">
</mat-paginator>
</div>
</div>
</main>
</app-content-layout>
@@ -4,21 +4,24 @@
</div>
</ng-container>
<ng-template #content>
<div style="flex: 1 1 100%;">
<mat-toolbar style="margin-top:20px;background:transparent">
<mat-icon style="margin-left:20px">message</mat-icon>
<span style="margin-left: 10px">{{ res.strings('notices_title') }}</span>
</mat-toolbar>
<div>
<mat-grid-list [cols]="columns" gutterSize="10" rowHeight="480" class="grid-layout">
<ng-container *ngFor="let n of page.getValue().elements">
<ng-container *ngIf="canShow(n, getLanguage())">
<mat-grid-tile colspan="1" rowspan="1">
<app-notice-card [language]="getLanguage()" [notice]="n" class="notice-card"></app-notice-card>
</mat-grid-tile>
</ng-container>
<app-content-layout>
<app-content-header [headerClass]="'header-transparent'">
<div class="header-title">
<mat-icon>message</mat-icon>
<span>{{ res.strings('notices_title') }}</span>
</div>
</app-content-header>
<main class="flex-row-wrap justify-space-evenly">
<ng-container *ngFor="let n of page.getValue().elements">
<ng-container *ngIf="canShow(n, getLanguage())">
<app-notice-card
[language]="getLanguage()"
[notice]="n"
class="flex-notice-card">
</app-notice-card>
</ng-container>
</mat-grid-list>
</div>
</div>
</ng-container>
</main>
</app-content-layout>
</ng-template>
+21 -16
View File
@@ -1,20 +1,26 @@
<div style="margin: 20px;">
<mat-toolbar>
<mat-icon>pie_chart_outlined</mat-icon>
<span style="margin-left: 10px">{{ res.strings('places_title') }}</span>
<div style="padding-top:20px;" flexLayout="row" fxLayoutAlign="end center" fxFlex="1 1 auto" fxLayoutGap="10px">
<form style="font-size: 12px;" fxLayoutAlign="center center" flexLayout="row">
<mat-form-field fxFlex="1 1 180px">
<mat-select [placeholder]="res.strings('places_order_placeholder')" [value]="order.getValue()" (selectionChange)="order.next($event.source.value)">
<mat-option *ngFor="let o of getOrders()" [value]="o">
<span>{{ getOrderName(o) }}</span>
</mat-option>
<app-content-layout [layoutClass]="'table-page'">
<app-content-header>
<div class="header-title">
<mat-icon>pie_chart_outlined</mat-icon>
<span>{{ res.strings('places_title') }}</span>
</div>
<div class="header-actions">
<form style="font-size: 12px;">
<mat-form-field>
<mat-select [placeholder]="res.strings('places_order_placeholder')"
[value]="order.getValue()"
(selectionChange)="order.next($event.source.value)">
<mat-option *ngFor="let o of getOrders()" [value]="o">
<span>{{ getOrderName(o) }}</span>
</mat-option>
</mat-select>
</mat-form-field>
</form>
</div>
</mat-toolbar>
<div class="mat-elevation-z2">
</app-content-header>
<main class="mat-elevation-z2">
<ng-container *ngIf="loading.getValue() || deleting.getValue()">
<mat-progress-bar mode="indeterminate" color="accent"></mat-progress-bar>
</ng-container>
@@ -72,6 +78,5 @@
<mat-paginator #paginator [pageSize]="20" [pageSizeOptions]="[1, 10, 20, 50]" [showFirstLastButtons]="true">
</mat-paginator>
</div>
</div>
</main>
</app-content-layout>
@@ -1,15 +1,20 @@
<div style="margin: 20px;">
<mat-toolbar>
<mat-icon>share</mat-icon>
<span style="margin-left: 10px">{{ res.strings('privileges_title') }}</span>
<div flexLayout="row" fxLayoutAlign="end center" fxFlex="1 1 auto" fxLayoutGap="10px">
<button mat-icon-button [matTooltip]="res.strings('privileges_add_tooltip')" (click)="onAdd()" [disabled]="loading.getValue() || deleting.getValue()">
<mat-icon>add_circle_outline</mat-icon>
<app-content-layout [layoutClass]="'table-page'">
<app-content-header>
<div class="header-title">
<mat-icon>share</mat-icon>
<span>{{ res.strings('privileges_title') }}</span>
</div>
<div class="header-actions">
<button mat-icon-button
[matTooltip]="res.strings('privileges_add_tooltip')"
(click)="onAdd()"
[disabled]="loading.getValue() || deleting.getValue()">
<mat-icon>add_circle_outline</mat-icon>
</button>
</div>
</app-content-header>
</mat-toolbar>
<div class="mat-elevation-z2">
<main class="mat-elevation-z2">
<ng-container *ngIf="loading.getValue() || deleting.getValue()">
<mat-progress-bar mode="indeterminate" color="accent"></mat-progress-bar>
</ng-container>
@@ -68,6 +73,5 @@
<mat-paginator #paginator [pageSize]="20" [pageSizeOptions]="[1, 10, 20, 50]" [showFirstLastButtons]="true">
</mat-paginator>
</div>
</div>
</main>
</app-content-layout>
@@ -1,15 +1,22 @@
<ng-container>
<mat-toolbar style="display: flex; background:transparent;">
<mat-icon style="margin-left: 5px;">access_time_icon</mat-icon>
<span style="margin-left: 10px">{{ res.strings('time_sheet_title') }}</span>
<app-content-layout>
<app-content-header [headerClass]="'header-transparent'">
<div class="header-title">
<mat-icon>access_time_icon</mat-icon>
<span>{{ res.strings('time_sheet_title') }}</span>
</div>
<div flexLayout="row" fxLayoutAlign="end center" fxFlex="1 1 auto" fxLayoutGap="10px">
<div class="header-actions">
<button mat-icon-button
[matTooltip]="res.strings('time_sheet_update_btn_tooltip')"
(click)="updateTimeSheetTable()">
<mat-icon style="font-size: 18px;">update_icon</mat-icon>
<mat-icon>update_icon</mat-icon>
</button>
<button mat-icon-button
[matMenuTriggerFor]="exportMenu"
[matTooltip]="res.strings('time_sheet_export_btn_tooltip')">
<mat-icon>import_export</mat-icon>
</button>
<mat-menu #exportMenu="matMenu" class="mat-elevation-z1">
<ng-template matMenuContent>
<button mat-menu-item
@@ -24,20 +31,16 @@
</button>
</ng-template>
</mat-menu>
<button mat-icon-button
[matMenuTriggerFor]="exportMenu"
[matTooltip]="res.strings('time_sheet_export_btn_tooltip')">
<mat-icon >import_export</mat-icon>
</button>
</div>
</mat-toolbar>
</app-content-header>
<!-- Configuration Side Panel -->
<div class="timesheet-container">
<div class="timesheet-config">
<mat-list class="config-col">
<h3 mat-subheader class="flex-center">{{ res.strings('time_sheet_config_label') }}</h3>
<mat-list-item class="flex-center toggle-btn">
<!-- Configuration Side Panel -->
<aside>
<mat-list>
<mat-list-item class="flex-vrt-center">
<h3 mat-subheader>{{ res.strings('time_sheet_config_label') }}</h3>
</mat-list-item>
<mat-list-item class="flex-vrt-center">
<mat-button-toggle-group
[(value)]="timeSheetService.grouped"
name="groupingChoice"
@@ -52,114 +55,119 @@
{{ res.strings('time_sheet_toggle_raw_label') }}</mat-button-toggle>
</mat-button-toggle-group>
</mat-list-item>
<mat-form-field class="config-item" [matTooltip]="res.strings('time_sheet_select_device_tooltip')">
<mat-label>{{ res.strings('time_sheet_select_device_label') }}</mat-label>
<mat-select
[(value)]="timeSheetService.device">
<mat-option [value]="null">{{ res.strings('time_sheet_no_device_selected') }}</mat-option>
<ng-container *ngIf="devices">
<mat-option *ngFor="let device of devices" [value]="device">
{{ device.model }}
</mat-option>
</ng-container>
</mat-select>
</mat-form-field>
<mat-form-field class="config-item" [matTooltip]="res.strings('time_sheet_break_time_tooltip')">
<mat-label>{{ res.strings('time_sheet_break_time_label') }}</mat-label>
<mat-select
[(value)]="timeSheetService.breakTime"
[disabled]="timeSheetService.grouped > 2">
<mat-option [value]="null">{{ res.strings('time_sheet_no_break_time_selected') }}</mat-option>
<mat-option *ngFor="let opt of breakTimeOptions" [value]="opt">
{{ opt + ' ' + res.strings('time_sheet_break_time_minutes') }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field class="config-item" [matTooltip]="res.strings('time_sheet_time_period_tooltip')">
<input matInput
[placeholder]="res.strings('time_sheet_time_period_label')"
[satDatepicker]="picker"
[value]="timeSheetService.dateRange"
(dateChange)="timeSheetService.dateRange = $event.target.value">
<sat-datepicker #picker [rangeMode]="true" orderPeriodLabel="month"></sat-datepicker>
<sat-datepicker-toggle matSuffix [for]="picker"></sat-datepicker-toggle>
</mat-form-field>
</mat-list>
<mat-list-item class="vrt-margin">
<mat-form-field class="hrz-margin" [matTooltip]="res.strings('time_sheet_select_device_tooltip')">
<mat-label>{{ res.strings('time_sheet_select_device_label') }}</mat-label>
<mat-select
[(value)]="timeSheetService.device">
<mat-option [value]="null">{{ res.strings('time_sheet_no_device_selected') }}</mat-option>
<ng-container *ngIf="devices">
<mat-option *ngFor="let device of devices" [value]="device">
{{ device.model }}
</mat-option>
</ng-container>
</mat-select>
</mat-form-field>
</mat-list-item>
<mat-list-item class="vrt-margin">
<mat-form-field class="hrz-margin" [matTooltip]="res.strings('time_sheet_break_time_tooltip')">
<mat-label>{{ res.strings('time_sheet_break_time_label') }}</mat-label>
<mat-select
[(value)]="timeSheetService.breakTime"
[disabled]="timeSheetService.grouped > 2">
<mat-option [value]="null">{{ res.strings('time_sheet_no_break_time_selected') }}</mat-option>
<mat-option *ngFor="let opt of breakTimeOptions" [value]="opt">
{{ opt + ' ' + res.strings('time_sheet_break_time_minutes') }}
</mat-option>
</mat-select>
</mat-form-field>
</mat-list-item>
<mat-list-item class="vrt-margin">
<mat-form-field class="hrz-margin" [matTooltip]="res.strings('time_sheet_time_period_tooltip')">
<input matInput
[placeholder]="res.strings('time_sheet_time_period_label')"
[satDatepicker]="picker"
[value]="timeSheetService.dateRange"
(dateChange)="timeSheetService.dateRange = $event.target.value">
<sat-datepicker #picker [rangeMode]="true" orderPeriodLabel="month"></sat-datepicker>
<sat-datepicker-toggle matSuffix [for]="picker"></sat-datepicker-toggle>
</mat-form-field>
</mat-list-item>
<mat-divider class="divider"></mat-divider>
<mat-divider class="divider"></mat-divider>
<mat-list class="config-col">
<button mat-subheader mat-button class="config-item" (click)="openWorkPlacesDialog()">
<mat-icon class="icon-button">list_icon</mat-icon>
<span>{{ res.strings('time_sheet_workplace_button') }}</span>
</button>
<mat-list-item class="flex-vrt-center">
<button mat-subheader mat-button (click)="openWorkPlacesDialog()">
<mat-icon class="icon-button">list_icon</mat-icon>
<span>{{ res.strings('time_sheet_workplace_button') }}</span>
</button>
</mat-list-item>
<ng-container *ngIf="workPlaces.length > 0">
<mat-divider class="divider"></mat-divider>
<div class="config-item" *ngFor="let workPlace of workPlaces">
<mat-list-item class="hrz-margin" *ngFor="let workPlace of workPlaces">
<button mat-icon-button (click)="deleteWorkPlaceEntry(workPlace)">
<mat-icon class="icon-button">clear_icon</mat-icon>
</button>
<span fxLayoutAlign="center" fxFlex="1 1 auto">{{ getWorkplaceName(workPlace) }}</span>
</div>
<span>{{ getWorkplaceName(workPlace) }}</span>
</mat-list-item>
<mat-divider class="divider"></mat-divider>
<button mat-button style="margin-bottom: 10px;" (click)="clearWorkPlaceList()" color="primary">
<mat-icon class="icon-button" style="margin-left: 12px">delete_icon</mat-icon>
<span>{{ res.strings('time_sheet_workplace_clear_list') }}</span>
</button>
<mat-list-item>
<button mat-button style="margin-bottom: 10px;" (click)="clearWorkPlaceList()" color="primary">
<mat-icon class="icon-button" style="margin-left: 12px">delete_icon</mat-icon>
<span>{{ res.strings('time_sheet_workplace_clear_list') }}</span>
</button>
</mat-list-item>
</ng-container>
</mat-list>
</div>
</aside>
<!-- Table Content -->
<ng-container *ngIf="false">
<mat-progress-bar mode="indeterminate" color="accent"></mat-progress-bar>
</ng-container>
<mat-card class="main-content mat-elevation-z2">
<mat-card-content>
<table mat-table #timeSheet class="main-table" [dataSource]="timeSheetDataSource">
<main class="mat-elevation-z2">
<ng-container *ngIf="false">
<mat-progress-bar mode="indeterminate" color="accent"></mat-progress-bar>
</ng-container>
<table mat-table #timeSheet class="main-table" [dataSource]="timeSheetDataSource">
<ng-container matColumnDef="date">
<th mat-header-cell *matHeaderCellDef>{{ res.strings('time_sheet_table_date') }}</th>
<td mat-cell *matCellDef="let data">{{ getDate(data) }}</td>
</ng-container>
<ng-container matColumnDef="date">
<th mat-header-cell *matHeaderCellDef>{{ res.strings('time_sheet_table_date') }}</th>
<td mat-cell *matCellDef="let data">{{ getDate(data) }}</td>
</ng-container>
<ng-container matColumnDef="from-time">
<th mat-header-cell *matHeaderCellDef>{{ res.strings('time_sheet_table_from') }}</th>
<td mat-cell *matCellDef="let data">
{{ data.beginDate | date:'H:mm' }}
</td>
</ng-container>
<ng-container matColumnDef="from-time">
<th mat-header-cell *matHeaderCellDef>{{ res.strings('time_sheet_table_from') }}</th>
<td mat-cell *matCellDef="let data">
{{ data.beginDate | date:'H:mm' }}
</td>
</ng-container>
<ng-container matColumnDef="to-time">
<th mat-header-cell *matHeaderCellDef>{{ res.strings('time_sheet_table_to') }}</th>
<td mat-cell *matCellDef="let data">
{{ data.endDate | date:'H:mm' }}
</td>
</ng-container>
<ng-container matColumnDef="to-time">
<th mat-header-cell *matHeaderCellDef>{{ res.strings('time_sheet_table_to') }}</th>
<td mat-cell *matCellDef="let data">
{{ data.endDate | date:'H:mm' }}
</td>
</ng-container>
<ng-container matColumnDef="time">
<th mat-header-cell *matHeaderCellDef>{{ res.strings('time_sheet_table_working_time') }}</th>
<td mat-cell *matCellDef="let data">{{ getWorkingTime(data.duration) }}</td>
</ng-container>
<ng-container matColumnDef="time">
<th mat-header-cell *matHeaderCellDef>{{ res.strings('time_sheet_table_working_time') }}</th>
<td mat-cell *matCellDef="let data">{{ getWorkingTime(data.duration) }}</td>
</ng-container>
<ng-container matColumnDef="place">
<th mat-header-cell *matHeaderCellDef>{{ res.strings('time_sheet_table_place') }}</th>
<td mat-cell *matCellDef="let data">{{ getWorkplaceString(data) }}</td>
</ng-container>
<ng-container matColumnDef="place">
<th mat-header-cell *matHeaderCellDef>{{ res.strings('time_sheet_table_place') }}</th>
<td mat-cell *matCellDef="let data">{{ getWorkplaceString(data) }}</td>
</ng-container>
<ng-container matColumnDef="device">
<th mat-header-cell *matHeaderCellDef>{{ res.strings('time_sheet_table_device') }}</th>
<td mat-cell *matCellDef="let data">{{ getDeviceNameString(data) }}</td>
</ng-container>
<ng-container matColumnDef="device">
<th mat-header-cell *matHeaderCellDef>{{ res.strings('time_sheet_table_device') }}</th>
<td mat-cell *matCellDef="let data">{{ getDeviceNameString(data) }}</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;" (click)="showTimeSheetRowInfo(row)"></tr>
</table>
<mat-paginator #paginator [pageSizeOptions]="[10, 20, 50, 100]" showFirstLastButtons></mat-paginator>
</mat-card-content>
</mat-card>
</div>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;" (click)="showTimeSheetRowInfo(row)"></tr>
</table>
<mat-paginator #paginator [pageSizeOptions]="[10, 20, 50, 100]" showFirstLastButtons></mat-paginator>
</main>
</app-content-layout>
@@ -1,70 +1,62 @@
import { Component, OnInit, HostListener, ViewChild, OnDestroy, AfterViewInit } from '@angular/core';
import { Time, formatDate } from '@angular/common';
import { MatPaginator } from "@angular/material/paginator";
import { MatTableDataSource } from "@angular/material/table";
import { MatDialog } from "@angular/material/dialog";
import { MatPaginator } from '@angular/material/paginator';
import { MatTableDataSource } from '@angular/material/table';
import { MatDialog } from '@angular/material/dialog';
import { Subscription } from "rxjs";
import { Subscription } from 'rxjs';
import { ResourceService } from "../services/resource.service";
import { DeviceService } from "../services/device.service";
import { ResourceService } from '../services/resource.service';
import { DeviceService } from '../services/device.service';
import { TimeSheetService, TimeSheetData, Grouping } from '../services/time-sheet.service';
import { PlacesDialogComponent } from "../widgets/places-dialog.component";
import { PlacesDialogComponent } from '../widgets/places-dialog.component';
import { Device, Place } from '../../api/models';
import { MessageDialogComponent } from '../widgets/message-dialog.component';
/**
* A view that offers the functionality to generate a timesheet by filtering on the
* A view that offers the functionality to generate a timesheet by filtering on the
* time period and the places a device has been.
* It offers three modes:
* 1. Default -> Shows the time entries per day processed in terms of legal working requirements.
* It also offers the functionality of defining a filter at which point the
* It also offers the functionality of defining a filter at which point the
* absence from a defined "working place" should be booked as a break.
* 2. Summed -> Shows the time entries per day without any processing at all.
* 3. By Day -> Shows every single time entry. Due to that a single day can occure frequently.
*
* @author Adriano
*/
@Component({
selector: 'app-time-sheet',
templateUrl: './time-sheet.component.html',
styles: [
`.flex-center { display: flex; flex: 1 1 auto; justify-content: center; }`,
`.divider { margin: 16px; }`,
`.timesheet-container {
display: flex;
flex-flow: row-reverse wrap;
justify-content: center;
align-items: flex-start;
}`,
`.timesheet-config { width: 350px; max-width: 350px; }`,
`.config-col { display: flex; flex: 1 1 auto; flex-direction: column; justify-content: center; }`,
`.config-col .config-item { margin-left: 32px; margin-right: 32px; }`,
'.config-col .toggle-btn { font-size: 14px; margin: 20px 0px }',
`.main-content { flex: 1 1 auto; margin: 4px; padding: 8px 16px; }`,
`.main-content .main-table { width: 100%; }`,
`.main-content .mat-column-date { width: 16% !important; }`,
`.main-content .mat-column-to-time, .mat-column-from-time { width: 7% !important; }`,
`.main-content .mat-column-time { width: 10% !important; }`,
`.main-content .mat-column-device { width: 20% !important; }`,
`.main-content .mat-column-place { width: 40% !important; }`
`mat-list .hrz-margin { width: 100%; margin-left: 32px; margin-right: 32px; }`,
`mat-list .vrt-margin { margin-top: 20px; margin-bottom: 20px; }`,
`mat-list .divider { margin: 16px; }`,
`.main-table { width: 100%; }`,
`.main-table .mat-column-date { width: 16% !important; }`,
`.main-table .mat-column-to-time, .mat-column-from-time { width: 7% !important; }`,
`.main-table .mat-column-time { width: 10% !important; }`,
`.main-table .mat-column-device { width: 20% !important; }`,
`.main-table .mat-column-place { width: 40% !important; }`
],
})
export class TimeSheetComponent implements OnInit, OnDestroy, AfterViewInit {
private static readonly LAYOUT_BREAKPOINT = 960;
readonly breakTimeOptions = [5, 10, 15, 20, 30, 45, 60, 90, 120, 150, 180];
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
compact = false;
static readonly normalDisplayCol = ['date', 'from-time', 'to-time', 'time', 'device', 'place'];
static readonly compactDisplayCol = ['date', 'time'];
readonly breakTimeOptions = [5, 10, 15, 20, 30, 45, 60, 90, 120, 150, 180];
@ViewChild(MatPaginator) paginator: MatPaginator;
compact = false;
displayedColumns = TimeSheetComponent.normalDisplayCol;
workPlaces: Place[];
devices: Device[];
timeSheetDataSource: MatTableDataSource<TimeSheetData>;
private subscriptions: Subscription;
constructor(
@@ -84,7 +76,7 @@ export class TimeSheetComponent implements OnInit, OnDestroy, AfterViewInit {
this.deviceService.reload();
}
ngAfterViewInit(): void {
this.timeSheetService.setup(this.paginator);
}
@@ -101,20 +93,22 @@ export class TimeSheetComponent implements OnInit, OnDestroy, AfterViewInit {
}
updateTimeSheetTable(): void {
if (!this.timeSheetService.fetching$.getValue())
if (!this.timeSheetService.fetching$.getValue()) {
this.timeSheetService.fetchData();
}
}
exportTimeSheet(type: string): void {
if (!this.timeSheetService.exportTimeSheet(type))
if (!this.timeSheetService.exportTimeSheet(type)) {
this.openMessageDialog(
this.res.strings('time_sheet_export_error_msg_title'),
this.res.strings('time_sheet_export_error_msg')
);
}
}
showTimeSheetRowInfo(data: TimeSheetData): void {
if (!this.compact) return;
if (!this.compact) { return; }
const res_values = [
'time_sheet_table_date', 'time_sheet_table_from', 'time_sheet_table_to',
@@ -123,10 +117,10 @@ export class TimeSheetComponent implements OnInit, OnDestroy, AfterViewInit {
const data_values = [
`${this.getDate(data)}`, `${formatDate(data.beginDate, 'H:mm', 'de')}`,
`${formatDate(data.endDate, 'H:mm', 'de')}`, `${this.getWorkingTime(data.duration)}`,
`${this.getWorkplaceString(data)}`,`${this.getWorkplaceString(data)}`
`${this.getWorkplaceString(data)}`, `${this.getWorkplaceString(data)}`
];
let msg = '';
res_values.forEach((val: string, idx: number, _) => msg += `${this.res.strings(val)}: ${data_values[idx]}; `)
res_values.forEach((val: string, idx: number, _) => msg += `${this.res.strings(val)}: ${data_values[idx]}; `);
this.openMessageDialog(this.res.strings('time_sheet_table_row_dialog_title'), msg.slice(0, msg.length - 2));
}
@@ -150,12 +144,12 @@ export class TimeSheetComponent implements OnInit, OnDestroy, AfterViewInit {
getDeviceNameString(data: TimeSheetData): string {
let res = '';
if (data.deviceId) {
const device = this.devices.find(device => device.id === data.deviceId);
const device = this.devices.find(d => d.id === data.deviceId);
res = device.model;
} else {
data.devicesSet.forEach(id => {
const device = this.devices.find(place => place.id === id);
res += device.model + '; '
res += device.model + '; ';
});
res = res.slice(0, res.length - 2);
}
@@ -164,9 +158,9 @@ export class TimeSheetComponent implements OnInit, OnDestroy, AfterViewInit {
getWorkingTime(time: Time): string {
let res = '';
if (time.hours != 0) res += String(time.hours) + ' h ';
if (time.minutes != 0) res += String(time.minutes) + ' m';
if (res === '') res = '-';
if (time.hours !== 0) { res += String(time.hours) + ' h '; }
if (time.minutes !== 0) { res += String(time.minutes) + ' m'; }
if (res === '') { res = '-'; }
return res;
}
+107 -112
View File
@@ -1,116 +1,111 @@
<ng-container *ngIf="idle | async;else progressBar">
<div *ngIf="user | async as u;else progressBar" style="flex: 1 1 100%;">
<mat-toolbar style="margin-top:20px;background:transparent">
<mat-icon style="margin-left:20px;">perm_identity</mat-icon>
<span style="margin-left: 10px">{{ res.strings('user_title') }}</span>
</mat-toolbar>
<mat-grid-list [cols]="columns" gutterSize="10" rowHeight="350" class="grid-layout">
<mat-grid-tile>
<mat-card class="mat-typography" class="user-card">
<mat-card-title-group>
<mat-card-title>{{ res.strings('user_change_title') }}</mat-card-title>
<mat-card-subtitle>{{ res.strings('user_change_subtitle') }}</mat-card-subtitle>
</mat-card-title-group>
<mat-card-content>
<form #userForm="ngForm">
<app-name-field [name]="u.name" (keyup.enter)="userForm.valid && onChangeUser()"></app-name-field>
<mat-form-field style="width: 100%;">
<mat-select [placeholder]="res.strings('user_change_primary')" name="email" [(ngModel)]="correspondence" style="width: 100%;">
<mat-select-trigger>
{{ correspondence.address }}
</mat-select-trigger>
<ng-container *ngFor="let email of emails">
<mat-option [value]="email" [disabled]="!email.verified">
<mat-icon class="icon-button">{{ email.verified?"mail":"send" }}</mat-icon>{{email.address}}
</mat-option>
</ng-container>
</mat-select>
</mat-form-field>
</form>
</mat-card-content>
<mat-card-actions fxFlexLayout="row" fxLayoutAlign="space-around center">
<button #loginButton mat-raised-button color="primary" [disabled]="userForm.pristine || userForm.invalid" (click)="onChangeUser()">
<mat-icon class="icon-button">save</mat-icon>
<span>{{ res.strings('button_save') }}</span>
</button>
</mat-card-actions>
</mat-card>
</mat-grid-tile>
<mat-grid-tile>
<mat-card class="mat-typography" class="user-card">
<mat-card-title>{{ res.strings('user_password_title') }}</mat-card-title>
<mat-card-subtitle>{{ res.strings('user_password_subtitle') }}</mat-card-subtitle>
<mat-card-content class="caption" style="flex:1">
<form #passwordForm="ngForm">
<app-password-field #oldPassword name="oldPassword" [label]="res.strings('user_password_old')" [hint]="res.strings('user_password_old_hint')"></app-password-field>
<app-password-field #newPassword name="newPassword" [label]="res.strings('user_password_new')" [hint]="res.strings('user_password_new_hint')" (keyup.enter)="passwordForm.valid && onChangePassword()"></app-password-field>
</form>
</mat-card-content>
<mat-card-actions fxFlexLayout="row" fxLayoutAlign="space-around center">
<button mat-raised-button color="primary" (click)="onChangePassword()" [disabled]="passwordForm.pristine || passwordForm.invalid">
<mat-icon class="icon-button">lock_outline</mat-icon>
<span>{{ res.strings('button_change') }}</span>
</button>
</mat-card-actions>
</mat-card>
</mat-grid-tile>
<mat-grid-tile>
<mat-card class="mat-typography" class="user-card">
<mat-card-title>{{ res.strings('user_add_email_title') }}</mat-card-title>
<mat-card-subtitle>{{ res.strings('user_add_email_subtitle') }}</mat-card-subtitle>
<mat-card-content class="caption" style="flex:1">
<form #emailForm="ngForm">
<app-email-field (keyup.enter)="emailForm.valid && onAddEmail()"></app-email-field>
</form>
<div style="height:70px"></div>
</mat-card-content>
<mat-card-actions fxFlexLayout="row" fxLayoutAlign="space-around center">
<button mat-raised-button color="primary" (click)="onAddEmail()" [disabled]="emailForm.pristine || emailForm.invalid">
<mat-icon class="icon-button">add</mat-icon>
<span>{{ res.strings('button_add') }}</span>
</button>
</mat-card-actions>
</mat-card>
</mat-grid-tile>
<mat-grid-tile>
<mat-card class="mat-typography" class="user-card">
<mat-card-title>{{ res.strings('user_del_email_title') }}</mat-card-title>
<mat-card-subtitle>{{ res.strings('user_del_email_subtitle') }}</mat-card-subtitle>
<mat-card-content class="caption" style="flex:1">
<mat-list class="mat-typography">
<ng-container *ngFor="let e of emails">
<ng-container *ngIf="!e.correspondence">
<mat-list-item>
<button mat-icon-button [matTooltip]="res.strings('user_del_email_tooltip')" (click)="onDeleteEmail(e.id)">
<mat-icon>delete</mat-icon>
</button>{{ e.address }}</mat-list-item>
</ng-container>
<app-content-layout *ngIf="idle | async;else progressBar">
<app-content-header [headerClass]="'header-transparent'">
<div class="header-title">
<mat-icon>perm_identity</mat-icon>
<span>{{ res.strings('user_title') }}</span>
</div>
</app-content-header>
<main *ngIf="user | async as u;else progressBar" class="flex-row-wrap justify-space-evenly">
<mat-card class="mat-typography" class="user-card">
<mat-card-title-group>
<mat-card-title>{{ res.strings('user_change_title') }}</mat-card-title>
<mat-card-subtitle>{{ res.strings('user_change_subtitle') }}</mat-card-subtitle>
</mat-card-title-group>
<mat-card-content>
<form #userForm="ngForm">
<app-name-field [name]="u.name" (keyup.enter)="userForm.valid && onChangeUser()"></app-name-field>
<mat-form-field style="width: 100%;">
<mat-select [placeholder]="res.strings('user_change_primary')" name="email" [(ngModel)]="correspondence" style="width: 100%;">
<mat-select-trigger>
{{ correspondence.address }}
</mat-select-trigger>
<ng-container *ngFor="let email of emails">
<mat-option [value]="email" [disabled]="!email.verified">
<mat-icon class="icon-button">{{ email.verified?"mail":"send" }}</mat-icon>{{email.address}}
</mat-option>
</ng-container>
</mat-list>
</mat-card-content>
</mat-card>
</mat-grid-tile>
<mat-grid-tile>
<mat-card class="mat-typography" class="user-card">
<mat-card-title>{{ res.strings('user_delete_title') }}</mat-card-title>
<mat-card-subtitle>{{ res.strings('user_delete_subtitle') }}</mat-card-subtitle>
<mat-card-content class="caption" style="flex:1">
<form #deleteForm="ngForm">
<app-password-field #deletePassword name="deletePassword" [label]="res.strings('user_delete_password')" [hint]="res.strings('user_delete_password_hint')" (keyup.enter)="deleteForm.valid && onDeleteUser()"></app-password-field>
</form>
<div style="height:70px"></div>
</mat-card-content>
<mat-card-actions fxFlexLayout="row" fxLayoutAlign="space-around center">
<button mat-raised-button color="primary" (click)="onDeleteUser()" [disabled]="deleteForm.pristine || deleteForm.invalid">
<mat-icon class="icon-button">delete</mat-icon>
<span>{{ res.strings('button_delete') }}</span>
</button>
</mat-card-actions>
</mat-card>
</mat-grid-tile>
</mat-grid-list>
</div>
</ng-container>
</mat-select>
</mat-form-field>
</form>
</mat-card-content>
<mat-card-actions class="flex-vrt-center">
<button #loginButton mat-raised-button color="primary" [disabled]="userForm.pristine || userForm.invalid" (click)="onChangeUser()">
<mat-icon class="icon-button">save</mat-icon>
<span>{{ res.strings('button_save') }}</span>
</button>
</mat-card-actions>
</mat-card>
<mat-card class="mat-typography" class="user-card">
<mat-card-title>{{ res.strings('user_password_title') }}</mat-card-title>
<mat-card-subtitle>{{ res.strings('user_password_subtitle') }}</mat-card-subtitle>
<mat-card-content class="caption" style="flex:1">
<form #passwordForm="ngForm">
<app-password-field #oldPassword name="oldPassword" [label]="res.strings('user_password_old')" [hint]="res.strings('user_password_old_hint')"></app-password-field>
<app-password-field #newPassword name="newPassword" [label]="res.strings('user_password_new')" [hint]="res.strings('user_password_new_hint')" (keyup.enter)="passwordForm.valid && onChangePassword()"></app-password-field>
</form>
</mat-card-content>
<mat-card-actions class="flex-vrt-center">
<button mat-raised-button color="primary" (click)="onChangePassword()" [disabled]="passwordForm.pristine || passwordForm.invalid">
<mat-icon class="icon-button">lock_outline</mat-icon>
<span>{{ res.strings('button_change') }}</span>
</button>
</mat-card-actions>
</mat-card>
<mat-card class="mat-typography" class="user-card">
<mat-card-title>{{ res.strings('user_add_email_title') }}</mat-card-title>
<mat-card-subtitle>{{ res.strings('user_add_email_subtitle') }}</mat-card-subtitle>
<mat-card-content class="caption" style="flex:1">
<form #emailForm="ngForm">
<app-email-field (keyup.enter)="emailForm.valid && onAddEmail()"></app-email-field>
</form>
<div style="height:70px"></div>
</mat-card-content>
<mat-card-actions class="flex-vrt-center">
<button mat-raised-button color="primary" (click)="onAddEmail()" [disabled]="emailForm.pristine || emailForm.invalid">
<mat-icon class="icon-button">add</mat-icon>
<span>{{ res.strings('button_add') }}</span>
</button>
</mat-card-actions>
</mat-card>
<mat-card class="mat-typography" class="user-card">
<mat-card-title>{{ res.strings('user_del_email_title') }}</mat-card-title>
<mat-card-subtitle>{{ res.strings('user_del_email_subtitle') }}</mat-card-subtitle>
<mat-card-content class="caption" style="flex:1">
<mat-list class="mat-typography">
<ng-container *ngFor="let e of emails">
<ng-container *ngIf="!e.correspondence">
<mat-list-item>
<button mat-icon-button [matTooltip]="res.strings('user_del_email_tooltip')" (click)="onDeleteEmail(e.id)">
<mat-icon>delete</mat-icon>
</button>{{ e.address }}</mat-list-item>
</ng-container>
</ng-container>
</mat-list>
</mat-card-content>
</mat-card>
<mat-card class="mat-typography" class="user-card">
<mat-card-title>{{ res.strings('user_delete_title') }}</mat-card-title>
<mat-card-subtitle>{{ res.strings('user_delete_subtitle') }}</mat-card-subtitle>
<mat-card-content class="caption" style="flex:1">
<form #deleteForm="ngForm">
<app-password-field #deletePassword name="deletePassword" [label]="res.strings('user_delete_password')" [hint]="res.strings('user_delete_password_hint')" (keyup.enter)="deleteForm.valid && onDeleteUser()"></app-password-field>
</form>
<div style="height:70px"></div>
</mat-card-content>
<mat-card-actions class="flex-vrt-center">
<button mat-raised-button color="primary" (click)="onDeleteUser()" [disabled]="deleteForm.pristine || deleteForm.invalid">
<mat-icon class="icon-button">delete</mat-icon>
<span>{{ res.strings('button_delete') }}</span>
</button>
</mat-card-actions>
</mat-card>
</main>
</app-content-layout>
<ng-template #progressBar>
<div fxFlexFill fxLayoutAlign="space-around center">
<mat-spinner [diameter]="100"></mat-spinner>
+127 -19
View File
@@ -145,10 +145,10 @@ mat-form-field {
}
.notice-card {
position:relative;
position: relative;
padding: 10px;
width: 100%;
height: 100%;
max-width: 100%;
max-height: 100%;
}
.notice-card-element {
@@ -179,20 +179,11 @@ mat-form-field {
}
.user-card {
flex:1;
max-width:500px;
min-height:280px;
margin:10px;
}
// TODO: Check if needed
.time-sheet-card {
flex: 1;
// max-width:1280px;
// min-height:580px;
width: 80%;
height: 85%;
margin: 2px;
flex-basis: 400px;
max-width: 500px;
min-height: 280px;
margin: 10px;
}
// fab position on marker map
@@ -215,6 +206,123 @@ mat-form-field {
white-space: normal;
}
.flex-spacer {
flex-grow: 1;
}
// Basic layout styles
.table-page { margin: 10px; }
.header-transparent { background-color: transparent !important; }
.flex-spacer { flex-grow: 1; }
.flex {
display: flex !important;
&-row {
@extend .flex;
flex-direction: row !important;
&-wrap {
@extend .flex-row;
flex-wrap: wrap !important;
}
&-nowrap {
@extend .flex-row;
flex-wrap: nowrap !important;
}
}
&-row-reverse {
@extend .flex;
flex-direction: row-reverse !important;
&-wrap {
@extend .flex-row-reverse;
flex-wrap: wrap !important;
}
&-nowrap {
@extend .flex-row;
flex-wrap: nowrap !important;
}
}
&-col {
@extend .flex;
flex-direction: column !important;
&-wrap {
@extend .flex-col;
flex-wrap: wrap !important;
}
&-nowrap {
@extend .flex-col;
flex-wrap: nowrap !important;
}
}
}
.justify-space-evenly { justify-content: space-evenly !important; }
.justify-space-between { justify-content: space-between !important; }
.align-center { align-items: center !important; }
.flex-vrt-center {
@extend .flex-col-nowrap;
@extend .align-center;
}
.flex-notice-card {
@extend .flex;
flex: 1 1 400px !important;
max-height: 30% !important;
padding: 8px !important;
}
$cont-padding: 8px;
app-content-layout {
div.outer-container {
@extend .flex;
@extend .flex-col-nowrap;
justify-content: flex-start;
overflow: hidden;
app-content-header {
padding-top: $cont-padding;
padding-right: $cont-padding;
padding-left: $cont-padding;
}
div.inner-container {
@extend .flex;
@extend .flex-row-reverse-wrap;
height: auto;
justify-content: space-evenly;
align-items: flex-start;
overflow: hidden;
padding-right: $cont-padding;
padding-bottom: $cont-padding;
padding-left: $cont-padding;
main {
flex: 1 1 600px;
}
aside {
flex: 0 1 350px;
}
}
}
}
app-content-header {
#content-toolbar {
display: flex;
justify-content: space-between;
align-items: center;
padding-top: 20px;
padding-bottom: 10px;
.header-title {
display: flex;
align-items: center;
justify-content: space-around;
> * {
margin-right: 10px;
}
}
.header-actions > * {
margin-right: 8px;
}
}
}
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ContentHeaderComponent } from '../../app/layouts/content-header.component';
describe('HeaderComponent', () => {
let component: ContentHeaderComponent;
let fixture: ComponentFixture<ContentHeaderComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ContentHeaderComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ContentHeaderComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ContentLayoutComponent } from './../../app/layouts/content-layout.component';
describe('MainContentComponent', () => {
let component: ContentLayoutComponent;
let fixture: ComponentFixture<ContentLayoutComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ContentLayoutComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ContentLayoutComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});