Добавлено представление задач списками по тегам
This commit is contained in:
parent
3a3366e10f
commit
2e33e6b665
3 changed files with 150 additions and 0 deletions
|
|
@ -45,6 +45,7 @@ import { SimpleKanbanBoardController } from './dashboards/simple-kanban-board.co
|
|||
import { IssueUrlEnhancer } from '@app/event-emitter/issue-enhancers/issue-url-enhancer';
|
||||
import { IssuesByTagsWidgetService } from './dashboards/widgets/issues-by-tags.widget.service';
|
||||
import { CategoryMergeToTagsEnhancer } from './issue-enhancers/category-merge-to-tags-enhancer';
|
||||
import { SimpleIssuesListController } from './dashboards/simple-issues-list.controller';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
|
|
@ -63,6 +64,7 @@ import { CategoryMergeToTagsEnhancer } from './issue-enhancers/category-merge-to
|
|||
CurrentIssuesEccmReportController,
|
||||
DailyEccmReportController,
|
||||
SimpleKanbanBoardController,
|
||||
SimpleIssuesListController,
|
||||
],
|
||||
providers: [
|
||||
AppService,
|
||||
|
|
|
|||
34
src/dashboards/simple-issues-list.controller.ts
Normal file
34
src/dashboards/simple-issues-list.controller.ts
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import { DynamicLoader } from '@app/event-emitter/configs/dynamic-loader';
|
||||
import { Controller, Get, Param, Render } from '@nestjs/common';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { IssuesByTagsWidgetService } from './widgets/issues-by-tags.widget.service';
|
||||
import { parse } from 'jsonc-parser';
|
||||
|
||||
@Controller('simple-issues-list')
|
||||
export class SimpleIssuesListController {
|
||||
private path: string;
|
||||
|
||||
constructor(
|
||||
private issuesByTagsWidgetService: IssuesByTagsWidgetService,
|
||||
private dynamicLoader: DynamicLoader,
|
||||
private configService: ConfigService,
|
||||
) {
|
||||
this.path = this.configService.get<string>('simpleKanbanBoard.path');
|
||||
}
|
||||
|
||||
@Get('/by-tags/:name/raw')
|
||||
async getByTagsRawData(@Param('name') name: string): Promise<any> {
|
||||
const cfg = this.dynamicLoader.load(name, {
|
||||
path: this.path,
|
||||
ext: 'jsonc',
|
||||
parser: parse,
|
||||
});
|
||||
return await this.issuesByTagsWidgetService.render(cfg);
|
||||
}
|
||||
|
||||
@Get('/by-tags/:name')
|
||||
@Render('simple-issues-list')
|
||||
async getByTags(@Param('name') name: string): Promise<any> {
|
||||
return await this.getByTagsRawData(name);
|
||||
}
|
||||
}
|
||||
114
views/simple-issues-list.hbs
Normal file
114
views/simple-issues-list.hbs
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Simple Issues List</title>
|
||||
<style>
|
||||
.list-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
background-color: rgb(225, 225, 225);
|
||||
}
|
||||
|
||||
.list-item {
|
||||
margin: 5px;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.list-item-description {
|
||||
background-color: rgb(196, 196, 196);
|
||||
border-width: 1px;
|
||||
border-color: rgba(255, 255, 255, 0.2) rgba(96, 96, 96, 0.2) rgba(96, 96, 96, 0.2) rgba(255, 255, 255, 0.2);
|
||||
border-style: solid;
|
||||
margin: 2px;
|
||||
padding: 3px;
|
||||
width: 190px;
|
||||
/*display: flex;*/
|
||||
border-radius: 3px;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.kanban-card div {
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
.kanban-card .kanban-card-title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.timepassed-dot {
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
background-color: #bbb;
|
||||
border-radius: 50%;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.timepassed-dot.hot {
|
||||
background-color: red;
|
||||
}
|
||||
|
||||
.timepassed-dot.warm {
|
||||
background-color: orange;
|
||||
}
|
||||
|
||||
.timepassed-dot.comfort {
|
||||
background-color: rgba(255, 255, 0, 0.4);
|
||||
}
|
||||
|
||||
.timepassed-dot.breezy {
|
||||
background-color: rgba(0, 255, 0, 0.4);
|
||||
}
|
||||
|
||||
.timepassed-dot.cold {
|
||||
background-color: rgba(0, 0, 255, 0.1);
|
||||
}
|
||||
|
||||
.issue-tag {
|
||||
font-size: 8pt;
|
||||
border-radius: 4px;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.tags-container {
|
||||
padding-left: 14px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{{#each this}}
|
||||
{{#if this.metainfo}}
|
||||
<h1 id="{{this.metainfo.title}}">{{this.metainfo.title}} <a href="#{{this.metainfo.title}}">#</a></h1>
|
||||
<div class="list-container">
|
||||
{{#each this.data}}
|
||||
|
||||
{{#each this.issues}}
|
||||
<div class="list-item">
|
||||
<div>
|
||||
<span class="timepassed-dot {{this.timePassedClass}}"></span>
|
||||
<span class="issue-subject"><a href="{{{this.url.url}}}">{{this.tracker.name}} #{{this.id}} - {{this.subject}}</a></span>
|
||||
<span class="issue-status">| {{this.status.name}}</span>
|
||||
<span class="issue-time">| {{this.total_spent_hours}} / {{this.total_estimated_hours}}</span>
|
||||
</div>
|
||||
<div class="tags-container">
|
||||
{{#if this.styledTags}}
|
||||
{{#each this.styledTags}}
|
||||
<span class="issue-tag" style="{{{this.style}}}">{{this.tag}}</span>
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Loading…
Reference in a new issue