Aggregated some Stuff
This commit is contained in:
parent
275910ac05
commit
ae77ec7553
@ -15,7 +15,7 @@ import { UserstoryTableComponent } from './components/tabels/userstory/userstory
|
||||
import { TaskTableComponent } from './components/tabels/task/task-table.component';
|
||||
import { SprintTableComponent } from './components/tabels/sprint/sprint-table.component';
|
||||
import { DashboardComponent } from './components/dashboard/dashboard.component';
|
||||
import { UserstoryInnerTableComponent } from './components/userstory-inner-table/userstory-inner-table.component';
|
||||
import { UserstoryInnerTableComponent } from './components/tabels/userstory-inner-table/userstory-inner-table.component';
|
||||
import { BacklogComponent } from './components/backlog/backlog.component';
|
||||
|
||||
@NgModule({
|
||||
|
@ -1,6 +1,6 @@
|
||||
import {Component} from '@angular/core';
|
||||
import {BackendService, ScrumSprint} from '../../../services/backend.service';
|
||||
import {TableComponentBase} from '../../../services/table-component.base';
|
||||
import {TableComponentBase} from '../table-component.base';
|
||||
import {NgbModal} from '@ng-bootstrap/ng-bootstrap';
|
||||
import {ActivatedRoute, ParamMap, Router} from '@angular/router';
|
||||
import { SprintFormComponent } from '../../sprint-form/sprint-form.component';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {sortByNumberAscending, sortByStringAscending, sortByDateAscending} from './sorting.service';
|
||||
import {Priority} from './backend.service';
|
||||
import {sortByNumberAscending, sortByStringAscending, sortByDateAscending} from '../../services/sorting.service';
|
||||
import {Priority, ScrumTask} from '../../services/backend.service';
|
||||
|
||||
export abstract class TableComponentBase<T> {
|
||||
public sortBy: string;
|
||||
@ -48,4 +48,12 @@ export abstract class TableComponentBase<T> {
|
||||
public getAllPriorities(): string[] {
|
||||
return Object.values(Priority);
|
||||
}
|
||||
|
||||
public sortById() {
|
||||
this.doNumericSort('id', (obj) => obj.id);
|
||||
}
|
||||
|
||||
public sortByTitle() {
|
||||
this.doStringSort('title', (obj) => obj.title);
|
||||
}
|
||||
}
|
@ -21,7 +21,7 @@
|
||||
<span>
|
||||
<span *ngIf="sortBy != 'id'"><i class="fa fa-sort fa-lg"></i></span>
|
||||
<span *ngIf="sortDescending && sortBy === 'id'"><i class="fa fa-sort-up fa-lg"></i></span>
|
||||
<span *ngIf="sortDescending === false && sortBy === 'title'"><i class="fa fa-sort-down fa-lg"></i></span>
|
||||
<span *ngIf="sortDescending === false && sortBy === 'id'"><i class="fa fa-sort-down fa-lg"></i></span>
|
||||
</span>
|
||||
</th>
|
||||
<th (click)="sortByTitle()" class="sortable">
|
||||
|
@ -8,7 +8,7 @@ import {
|
||||
} from '../../../services/backend.service';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TaskFormComponent } from '../../task-form/task-form.component';
|
||||
import { TableComponentBase } from '../../../services/table-component.base';
|
||||
import { TableComponentBase } from '../table-component.base';
|
||||
import { ActivatedRoute, ParamMap, Router } from '@angular/router';
|
||||
import { getNumberForPriority } from '../../../services/sorting.service';
|
||||
import { NONE_TYPE } from '@angular/compiler';
|
||||
@ -113,14 +113,6 @@ export class TaskTableComponent extends TableComponentBase<ScrumTask> {
|
||||
modalRef.componentInstance.task = editTask;
|
||||
}
|
||||
|
||||
sortById() {
|
||||
this.doNumericSort('id', (task) => task.id);
|
||||
}
|
||||
|
||||
sortByTitle() {
|
||||
this.doStringSort('title', (task) => task.title);
|
||||
}
|
||||
|
||||
sortByPrio() {
|
||||
this.doNumericSort('priority', (task) =>
|
||||
getNumberForPriority(task.priority)
|
||||
|
@ -5,11 +5,11 @@ import {
|
||||
ScrumUserstory,
|
||||
ScrumStatus,
|
||||
ScrumCategory,
|
||||
} from '../../services/backend.service';
|
||||
} from '../../../services/backend.service';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TableComponentBase } from '../../services/table-component.base';
|
||||
import { getNumberForPriority } from '../../services/sorting.service';
|
||||
import { UserstoryFormComponent } from '../userstory-form/userstory-form.component';
|
||||
import { TableComponentBase } from '../table-component.base';
|
||||
import { getNumberForPriority } from '../../../services/sorting.service';
|
||||
import { UserstoryFormComponent } from '../../userstory-form/userstory-form.component';
|
||||
import { ActivatedRoute, ParamMap, Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
@ -102,14 +102,6 @@ export class UserstoryInnerTableComponent extends TableComponentBase<ScrumUserst
|
||||
return this.tasks.filter((t) => t.userstoryid === userstory.id).length;
|
||||
}
|
||||
|
||||
public sortById() {
|
||||
this.doNumericSort('id', (us) => us.id);
|
||||
}
|
||||
|
||||
public sortByTitle() {
|
||||
this.doStringSort('title', (us) => us.title);
|
||||
}
|
||||
|
||||
public sortByPrio() {
|
||||
this.doNumericSort('priority', (us) => getNumberForPriority(us.priority));
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user