no pipeline
This commit is contained in:
parent
42312cf409
commit
ad358c0b46
31
.github/workflows/node.js.yml
vendored
31
.github/workflows/node.js.yml
vendored
@ -1,31 +0,0 @@
|
|||||||
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
|
|
||||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
|
|
||||||
|
|
||||||
name: Node.js CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "prod" ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ "prod" ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-version: [20.x]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: ${{ matrix.node-version }}
|
|
||||||
cache: 'npm'
|
|
||||||
- run: npm install
|
|
||||||
- run: npm install -g @angular/cli
|
|
||||||
- run: npm run build
|
|
||||||
- run: npm test
|
|
||||||
17
src/app/feature/tag/create/create.component.html
Normal file
17
src/app/feature/tag/create/create.component.html
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<div class="p-5 bg-zinc-700">
|
||||||
|
<div class="mb-5">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="block p-1 w-full text-black dark:text-white bg-gray-50 dark:bg-zinc-700 rounded-lg bg-gray-100 text-base border border-gray-500 dark:border-transparent"
|
||||||
|
[(ngModel)]="description"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button class="basis-full md:basis-auto" (click)="confirm()">
|
||||||
|
<div
|
||||||
|
class="min-w-28 px-3 py-1.5 rounded rounded-lg bg-green-700 hover:bg-green-900 font-bold text-black dark:text-white"
|
||||||
|
>
|
||||||
|
Erstellen
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
0
src/app/feature/tag/create/create.component.scss
Normal file
0
src/app/feature/tag/create/create.component.scss
Normal file
21
src/app/feature/tag/create/create.component.ts
Normal file
21
src/app/feature/tag/create/create.component.ts
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { MatDialogRef } from '@angular/material/dialog';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-create',
|
||||||
|
templateUrl: './create.component.html',
|
||||||
|
styleUrls: ['./create.component.scss'],
|
||||||
|
})
|
||||||
|
export class CreateComponent {
|
||||||
|
description: string = '';
|
||||||
|
|
||||||
|
constructor(public dialogRef: MatDialogRef<CreateComponent>) {}
|
||||||
|
|
||||||
|
confirm(): void {
|
||||||
|
this.dialogRef.close(this.description);
|
||||||
|
}
|
||||||
|
|
||||||
|
onClose(): void {
|
||||||
|
this.dialogRef.close(undefined);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,10 +1,24 @@
|
|||||||
<div class="p-5">
|
<div class="p-5">
|
||||||
<div class="mb-5">
|
<div class="mb-5">
|
||||||
|
<div class="flex flex-row gap-x-2">
|
||||||
|
<div class="basis-full">
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
class="block p-1 w-full text-gray-900 text-black dark:text-white bg-gray-50 dark:bg-zinc-700 rounded-lg bg-gray-100 text-base border border-gray-500 dark:border-transparent"
|
class="block p-1 w-full text-gray-900 text-black dark:text-white bg-gray-50 dark:bg-zinc-700 rounded-lg bg-gray-100 text-base border border-gray-500 dark:border-transparent"
|
||||||
(input)="onInputChanged($event)"
|
(input)="onInputChanged($event)"
|
||||||
/>
|
/>
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div class="basis-auto">
|
||||||
|
<button (click)="createTag()">
|
||||||
|
<div
|
||||||
|
class="block px-3 py-1.5 rounded rounded-lg bg-zinc-700 hover:bg-zinc-900 font-bold text-black dark:text-white"
|
||||||
|
>
|
||||||
|
+
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<shared-table [items]="tags" [columns]="tagListColumns" />
|
<shared-table [items]="tags" [columns]="tagListColumns" />
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { Subject, debounceTime } from 'rxjs';
|
import { Subject, debounceTime } from 'rxjs';
|
||||||
import { TagListEntry } from 'src/app/model/TagListEntry';
|
import { TagListEntry } from 'src/app/model/TagListEntry';
|
||||||
import { RequestService } from 'src/app/request.service';
|
import { RequestService } from 'src/app/request.service';
|
||||||
import { ColumnDefinition } from 'src/app/shared/components/table/table.component';
|
import { ColumnDefinition } from 'src/app/shared/components/table/table.component';
|
||||||
|
import { CreateComponent } from '../create/create.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-list',
|
selector: 'app-list',
|
||||||
@ -32,7 +34,7 @@ export class ListComponent {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
constructor(public requestService: RequestService) {
|
constructor(public requestService: RequestService, public dialog: MatDialog) {
|
||||||
this.query$.pipe(debounceTime(300)).subscribe((query) => {
|
this.query$.pipe(debounceTime(300)).subscribe((query) => {
|
||||||
this.query = query;
|
this.query = query;
|
||||||
this.readList();
|
this.readList();
|
||||||
@ -47,6 +49,28 @@ export class ListComponent {
|
|||||||
this.query$.next((event.target as HTMLTextAreaElement).value);
|
this.query$.next((event.target as HTMLTextAreaElement).value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
createTag(): void {
|
||||||
|
let dialogRef = this.dialog.open(CreateComponent, {
|
||||||
|
panelClass: 'bg-zinc-900',
|
||||||
|
maxHeight: '400px',
|
||||||
|
width: '600px',
|
||||||
|
});
|
||||||
|
|
||||||
|
dialogRef.afterClosed().subscribe((result) => {
|
||||||
|
if (result === undefined) return;
|
||||||
|
|
||||||
|
this.requestService.post(
|
||||||
|
'tag/create',
|
||||||
|
{
|
||||||
|
description: result,
|
||||||
|
},
|
||||||
|
(response: any) => {
|
||||||
|
this.readList();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
readList(): void {
|
readList(): void {
|
||||||
this.requestService.post(
|
this.requestService.post(
|
||||||
'tag-list/read-list',
|
'tag-list/read-list',
|
||||||
|
|||||||
@ -1,17 +1,85 @@
|
|||||||
<div *ngIf="tagDetails !== null">
|
<h1
|
||||||
<h1 class="text-white text-2xl font-bold text-center">
|
*ngIf="tagDetails !== null"
|
||||||
|
class="text-white text-2xl font-bold text-center"
|
||||||
|
>
|
||||||
{{ tagDetails.description }}
|
{{ tagDetails.description }}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<ul class="text-white">
|
<div class="grid grid-cols-1 2xl:grid-cols-4">
|
||||||
<li *ngFor="let alias of tagDetails.aliases">
|
<div class="2xl:col-span-3">
|
||||||
{{ alias.description }}
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<shared-video-list
|
<shared-video-list
|
||||||
(onReadList)="readList($event)"
|
(onReadList)="readList($event)"
|
||||||
[total]="total"
|
[total]="total"
|
||||||
[videos]="videos"
|
[videos]="videos"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="w-full 2xl:col-span-1 p-5">
|
||||||
|
<shared-card *ngIf="tagId !== ''" class="w-full" header="Details">
|
||||||
|
<div class="grid grid-cols-1 gap-2 mt-2">
|
||||||
|
<div id="title" class="flex flex-row gap-2">
|
||||||
|
<div class="basis-auto w-24">Titel:</div>
|
||||||
|
<div class="basis-full">
|
||||||
|
<input
|
||||||
|
*ngIf="tagDetails !== null"
|
||||||
|
type="text"
|
||||||
|
class="p-1 w-full text-gray-900 text-black dark:text-white bg-gray-50 dark:bg-zinc-700 rounded-lg bg-gray-100 text-base border border-gray-500 dark:border-transparent"
|
||||||
|
[(ngModel)]="tagDetails.description"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="tags" class="flex flex-row gap-2">
|
||||||
|
<div class="basis-auto w-24">Alias:</div>
|
||||||
|
<div class="basis-full" *ngIf="tagDetails !== null">
|
||||||
|
<div class="flex flex-row">
|
||||||
|
<div class="basis-full">
|
||||||
|
<span
|
||||||
|
*ngFor="let alias of tagDetails.aliases"
|
||||||
|
class="text-sm font-medium me-2 mx-auto px-2.5 py-0.5 rounded bg-zinc-700 hover:bg-zinc-900"
|
||||||
|
>{{ alias.description }}</span
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div class="basis-auto">
|
||||||
|
<button (click)="addAlias()">
|
||||||
|
<div
|
||||||
|
class="block px-3 py-1.5 rounded rounded-lg bg-zinc-700 hover:bg-zinc-900"
|
||||||
|
>
|
||||||
|
+
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--
|
||||||
|
<div id="actions">
|
||||||
|
<div class="flex flex-col md:flex-row gap-2">
|
||||||
|
<div class="basis-0 md:basis-full"></div>
|
||||||
|
<button class="basis-full md:basis-auto" (click)="delete()">
|
||||||
|
<div
|
||||||
|
class="min-w-28 px-3 py-1.5 rounded rounded-lg bg-red-900 hover:bg-red-950"
|
||||||
|
>
|
||||||
|
Delete
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
<button class="basis-full md:basis-auto" (click)="setThumbnail()">
|
||||||
|
<div
|
||||||
|
class="min-w-28 px-3 py-1.5 rounded rounded-lg bg-zinc-700 hover:bg-zinc-900"
|
||||||
|
>
|
||||||
|
Thumbnail
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
<button class="basis-full md:basis-auto" (click)="update()">
|
||||||
|
<div
|
||||||
|
class="min-w-28 px-3 py-1.5 rounded rounded-lg bg-green-700 hover:bg-green-900"
|
||||||
|
>
|
||||||
|
Save
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
-->
|
||||||
|
</div>
|
||||||
|
</shared-card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@ -4,6 +4,8 @@ import { TagDetails } from 'src/app/model/TagDetails';
|
|||||||
import { VideoListEntry } from 'src/app/model/VideoListEntry';
|
import { VideoListEntry } from 'src/app/model/VideoListEntry';
|
||||||
import { RequestService } from 'src/app/request.service';
|
import { RequestService } from 'src/app/request.service';
|
||||||
import { OnReadListModel } from 'src/app/shared/components/video-list/video-list.component';
|
import { OnReadListModel } from 'src/app/shared/components/video-list/video-list.component';
|
||||||
|
import { CreateComponent } from './create/create.component';
|
||||||
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-tag',
|
selector: 'app-tag',
|
||||||
@ -18,7 +20,8 @@ export class TagComponent {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
public requestService: RequestService
|
public requestService: RequestService,
|
||||||
|
public dialog: MatDialog
|
||||||
) {
|
) {
|
||||||
this.route.params.subscribe((params) => this.updateTagId(params['id']));
|
this.route.params.subscribe((params) => this.updateTagId(params['id']));
|
||||||
}
|
}
|
||||||
@ -60,4 +63,27 @@ export class TagComponent {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addAlias(): void {
|
||||||
|
let dialogRef = this.dialog.open(CreateComponent, {
|
||||||
|
panelClass: 'bg-zinc-900',
|
||||||
|
maxHeight: '400px',
|
||||||
|
width: '600px',
|
||||||
|
});
|
||||||
|
|
||||||
|
dialogRef.afterClosed().subscribe((result) => {
|
||||||
|
if (result === undefined) return;
|
||||||
|
|
||||||
|
this.requestService.post(
|
||||||
|
'tag/add-alias',
|
||||||
|
{
|
||||||
|
tagId: this.tagId,
|
||||||
|
description: result,
|
||||||
|
},
|
||||||
|
(response: any) => {
|
||||||
|
this.readDetails();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import { TagComponent } from './tag.component';
|
|||||||
import { ListComponent } from './list/list.component';
|
import { ListComponent } from './list/list.component';
|
||||||
import { SharedModule } from 'src/app/shared/shared.module';
|
import { SharedModule } from 'src/app/shared/shared.module';
|
||||||
import { RouterModule, Routes } from '@angular/router';
|
import { RouterModule, Routes } from '@angular/router';
|
||||||
|
import { CreateComponent } from './create/create.component';
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{ path: 'list', component: ListComponent },
|
{ path: 'list', component: ListComponent },
|
||||||
@ -11,7 +12,7 @@ const routes: Routes = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [TagComponent, ListComponent],
|
declarations: [TagComponent, ListComponent, CreateComponent],
|
||||||
imports: [CommonModule, SharedModule, RouterModule.forChild(routes)],
|
imports: [CommonModule, SharedModule, RouterModule.forChild(routes)],
|
||||||
})
|
})
|
||||||
export class TagModule {}
|
export class TagModule {}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user