link Management App
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
<div class="container">
|
||||
<app-title title="Tool List"></app-title>
|
||||
<tool *ngFor="let tool of tools" [name]="tool.name" [url]="tool.url" [userName]="tool.userName" [password]="tool.password"></tool>
|
||||
</div>
|
||||
@@ -0,0 +1,7 @@
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-top: 2rem;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ToolListComponent } from './tool-list.component';
|
||||
|
||||
describe('ToolListComponent', () => {
|
||||
let component: ToolListComponent;
|
||||
let fixture: ComponentFixture<ToolListComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [ToolListComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(ToolListComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
24
src/app/components/pages/tool-list/tool-list.component.ts
Normal file
24
src/app/components/pages/tool-list/tool-list.component.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ToolComponent } from "../../partials/tool/tool.component";
|
||||
import { ToolListService } from '../../../shared/module/tool-list.module';
|
||||
import { Tool } from '../../../shared/model/tool.model';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TitleComponent } from "../../partials/title/title.component";
|
||||
|
||||
@Component({
|
||||
selector: 'app-tool-list',
|
||||
standalone: true,
|
||||
imports: [ToolComponent, CommonModule, TitleComponent],
|
||||
templateUrl: './tool-list.component.html',
|
||||
styleUrl: './tool-list.component.scss'
|
||||
})
|
||||
export class ToolListComponent implements OnInit {
|
||||
tools!: Tool[];
|
||||
|
||||
constructor(private toolListService: ToolListService) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.tools = this.toolListService.getAllTools()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<p>floating-message works!</p>
|
||||
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { FloatingMessageComponent } from './floating-message.component';
|
||||
|
||||
describe('FloatingMessageComponent', () => {
|
||||
let component: FloatingMessageComponent;
|
||||
let fixture: ComponentFixture<FloatingMessageComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [FloatingMessageComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(FloatingMessageComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,12 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-floating-message',
|
||||
standalone: true,
|
||||
imports: [],
|
||||
templateUrl: './floating-message.component.html',
|
||||
styleUrl: './floating-message.component.scss'
|
||||
})
|
||||
export class FloatingMessageComponent {
|
||||
|
||||
}
|
||||
1
src/app/components/partials/title/title.component.html
Normal file
1
src/app/components/partials/title/title.component.html
Normal file
@@ -0,0 +1 @@
|
||||
<h1>{{title}}</h1>
|
||||
3
src/app/components/partials/title/title.component.scss
Normal file
3
src/app/components/partials/title/title.component.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
h1{
|
||||
padding: 2rem;
|
||||
}
|
||||
23
src/app/components/partials/title/title.component.spec.ts
Normal file
23
src/app/components/partials/title/title.component.spec.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { TitleComponent } from './title.component';
|
||||
|
||||
describe('TitleComponent', () => {
|
||||
let component: TitleComponent;
|
||||
let fixture: ComponentFixture<TitleComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [TitleComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(TitleComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
12
src/app/components/partials/title/title.component.ts
Normal file
12
src/app/components/partials/title/title.component.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Component, Input } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-title',
|
||||
standalone: true,
|
||||
imports: [],
|
||||
templateUrl: './title.component.html',
|
||||
styleUrl: './title.component.scss'
|
||||
})
|
||||
export class TitleComponent {
|
||||
@Input() title!: string;
|
||||
}
|
||||
5
src/app/components/partials/tool/tool.component.html
Normal file
5
src/app/components/partials/tool/tool.component.html
Normal file
@@ -0,0 +1,5 @@
|
||||
<div class="container">
|
||||
<div><a [href]="url" target="_blank">{{ name }}</a></div>
|
||||
<div ngxClipboard [cbContent]="userName">{{ userName }}</div>
|
||||
<div ngxClipboard [cbContent]="password">{{ password }}</div>
|
||||
</div>
|
||||
17
src/app/components/partials/tool/tool.component.scss
Normal file
17
src/app/components/partials/tool/tool.component.scss
Normal file
@@ -0,0 +1,17 @@
|
||||
.container {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.container>div {
|
||||
padding: 2rem 20rem 2rem 2rem;
|
||||
border: 1px solid black;
|
||||
opacity: 0.5;
|
||||
text-wrap: nowrap;
|
||||
max-width: 5rem;
|
||||
font-size: 1.5rem;
|
||||
transition: opacity 0.3s ease-in-out;
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
23
src/app/components/partials/tool/tool.component.spec.ts
Normal file
23
src/app/components/partials/tool/tool.component.spec.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ToolComponent } from './tool.component';
|
||||
|
||||
describe('ToolComponent', () => {
|
||||
let component: ToolComponent;
|
||||
let fixture: ComponentFixture<ToolComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [ToolComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(ToolComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
16
src/app/components/partials/tool/tool.component.ts
Normal file
16
src/app/components/partials/tool/tool.component.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { ClipboardModule } from 'ngx-clipboard';
|
||||
|
||||
@Component({
|
||||
selector: 'tool',
|
||||
standalone: true,
|
||||
imports: [ClipboardModule],
|
||||
templateUrl: './tool.component.html',
|
||||
styleUrl: './tool.component.scss'
|
||||
})
|
||||
export class ToolComponent {
|
||||
@Input() name!: string;
|
||||
@Input() url!: string;
|
||||
@Input() userName!: string;
|
||||
@Input() password!: string;
|
||||
}
|
||||
Reference in New Issue
Block a user