add navigation and fetching of sports
This commit is contained in:
@@ -4,6 +4,6 @@ h1 {
|
|||||||
|
|
||||||
.app {
|
.app {
|
||||||
font-family: Arial, Helvetica, sans-serif;
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
max-width: 500px;
|
/* max-width: 500px; */
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,13 @@ import { ApplicationConfig, provideBrowserGlobalErrorListeners, provideZoneChang
|
|||||||
import { provideRouter } from '@angular/router';
|
import { provideRouter } from '@angular/router';
|
||||||
|
|
||||||
import { routes } from './app.routes';
|
import { routes } from './app.routes';
|
||||||
|
import { provideHttpClient } from '@angular/common/http';
|
||||||
|
|
||||||
export const appConfig: ApplicationConfig = {
|
export const appConfig: ApplicationConfig = {
|
||||||
providers: [
|
providers: [
|
||||||
provideBrowserGlobalErrorListeners(),
|
provideBrowserGlobalErrorListeners(),
|
||||||
provideZoneChangeDetection({ eventCoalescing: true }),
|
provideZoneChangeDetection({ eventCoalescing: true }),
|
||||||
provideRouter(routes)
|
provideRouter(routes),
|
||||||
|
provideHttpClient(),
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,14 +1,21 @@
|
|||||||
import { Routes } from '@angular/router';
|
import { Routes } from '@angular/router';
|
||||||
import { KontorComponent } from './kontor/kontor.component';
|
import { KontorComponent } from './kontor/kontor.component';
|
||||||
import { Login } from './common/login/login';
|
import { Login } from './common/login/login';
|
||||||
import { ComicsListComponent } from './comic/comics/comics-list.component';
|
|
||||||
import { PublisherListComponent } from './comic/publisher/publisher-list.component';
|
|
||||||
import { ArtistListComponent } from './comic/artist/artist-list.component';
|
|
||||||
import { ComicOverviewComponent } from './comic/comic-overview/comic-overview.component';
|
import { ComicOverviewComponent } from './comic/comic-overview/comic-overview.component';
|
||||||
import { MediaOverviewComponent } from './media/media-overview/media-overview.component';
|
import { MediaOverviewComponent } from './media/media-overview/media-overview.component';
|
||||||
import { MediaFilesListComponent } from './media/media-files-list/media-files-list.component';
|
import { ArtistListComponent } from './comic/artist/artist-list/artist-list.component';
|
||||||
import { MediaActorsListComponent } from './media/media-actors-list/media-actors-list.component';
|
import { ComicListComponent } from './comic/comic/comic-list/comic-list.component';
|
||||||
import { MediaVideosListComponent } from './media/media-videos-list/media-videos-list.component';
|
import { MediaFileListComponent } from './media/media-file/media-file-list/media-file-list.component';
|
||||||
|
import { MediaActorListComponent } from './media/media-actor/media-actor-list/media-actor-list.component';
|
||||||
|
import { MediaVideoListComponent } from './media/media-video/media-video-list/media-video-list.component';
|
||||||
|
import { PublisherListComponent } from './comic/publisher/publisher-list/publisher-list.component';
|
||||||
|
import { TyscMenuComponent } from './tysc/tysc-menu/tysc-menu.component';
|
||||||
|
import { TeamListComponent } from './tysc/team/team-list/team-list.component';
|
||||||
|
import { VendorListComponent } from './tysc/vendor/vendor-list/vendor-list.component';
|
||||||
|
import { CardsetListComponent } from './tysc/cardset/cardset-list/cardset-list.component';
|
||||||
|
import { PositionListComponent } from './tysc/position/position-list/position-list.component';
|
||||||
|
import { PlayerListComponent } from './tysc/player/player-list/player-list.component';
|
||||||
|
import { SportListComponent } from './tysc/sport/sport-list/sport-list.component';
|
||||||
|
|
||||||
export const routes: Routes = [
|
export const routes: Routes = [
|
||||||
{ path: '', component: KontorComponent, },
|
{ path: '', component: KontorComponent, },
|
||||||
@@ -16,19 +23,30 @@ export const routes: Routes = [
|
|||||||
{
|
{
|
||||||
path: 'comic', component: ComicOverviewComponent,
|
path: 'comic', component: ComicOverviewComponent,
|
||||||
children: [
|
children: [
|
||||||
{ path: '', component: ComicsListComponent},
|
{ path: '', component: ComicListComponent},
|
||||||
{ path: 'comics', component: ComicsListComponent},
|
{ path: 'comics', component: ComicListComponent},
|
||||||
{ path: 'publisher', component: PublisherListComponent},
|
{ path: 'publisher', component: PublisherListComponent},
|
||||||
{ path: 'artist', component: ArtistListComponent},
|
{ path: 'artist', component: ArtistListComponent},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'tysc', component: TyscMenuComponent,
|
||||||
|
children: [
|
||||||
|
{ path: '', component: SportListComponent},
|
||||||
|
{ path: 'team', component: TeamListComponent},
|
||||||
|
{ path: 'player', component: PlayerListComponent},
|
||||||
|
{ path: 'position', component: PositionListComponent},
|
||||||
|
{ path: 'cardset', component: CardsetListComponent},
|
||||||
|
{ path: 'vendor', component: VendorListComponent},
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'media', component: MediaOverviewComponent,
|
path: 'media', component: MediaOverviewComponent,
|
||||||
children: [
|
children: [
|
||||||
{ path: '', component: MediaFilesListComponent},
|
{ path: '', component: MediaFileListComponent},
|
||||||
{ path: 'mediafiles', component: MediaFilesListComponent},
|
{ path: 'mediafiles', component: MediaFileListComponent},
|
||||||
{ path: 'mediaactors', component: MediaActorsListComponent},
|
{ path: 'mediaactors', component: MediaActorListComponent},
|
||||||
{ path: 'mediavideos', component: MediaVideosListComponent},
|
{ path: 'mediavideos', component: MediaVideoListComponent},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
<p>artist works!</p>
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<p>artist-list works!</p>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { ArtistListComponent } from './artist-list.component';
|
||||||
|
|
||||||
|
describe('ArtistListComponent', () => {
|
||||||
|
let component: ArtistListComponent;
|
||||||
|
let fixture: ComponentFixture<ArtistListComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [ArtistListComponent]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(ArtistListComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'kontor-artist-list',
|
selector: 'app-artist-list',
|
||||||
imports: [],
|
imports: [],
|
||||||
templateUrl: './artist-list.component.html',
|
templateUrl: './artist-list.component.html',
|
||||||
styleUrl: './artist-list.component.css'
|
styleUrl: './artist-list.component.css'
|
||||||
@@ -1,10 +1,16 @@
|
|||||||
<p>comic-overview works!</p>
|
<!-- <p>comic-overview works!</p>
|
||||||
<div>
|
<div class="subnav">
|
||||||
<ul>
|
<ul>
|
||||||
<li><a routerLink="/comic/comics">Comics</a></li>
|
<li><a routerLink="/comic/comics" routerLinkActive>Comics</a></li>
|
||||||
<li><a routerLink="/comic/publisher">Publisher</a></li>
|
<li><a routerLink="/comic/publisher">Publisher</a></li>
|
||||||
<li><a routerLink="/comic/artist">Artists</a></li>
|
<li><a routerLink="/comic/artist">Artists</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<h4>Child Routes Result</h4>
|
<h4>Child Routes Result</h4>
|
||||||
<router-outlet></router-outlet>
|
<router-outlet></router-outlet>
|
||||||
|
</div> -->
|
||||||
|
<div class="subnav">
|
||||||
|
<a routerLink="/comic/comics" routerLinkActive="active">Comics</a>
|
||||||
|
<a routerLink="/comic/publisher" routerLinkActive="active">Publisher</a>
|
||||||
|
<a routerLink="/comic/artist" routerLinkActive="active">Artists</a>
|
||||||
</div>
|
</div>
|
||||||
|
<router-outlet></router-outlet>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { RouterLink, RouterOutlet } from '@angular/router';
|
import { RouterLink, RouterOutlet, RouterLinkActive } from '@angular/router';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-comic-overview',
|
selector: 'app-comic-overview',
|
||||||
imports: [RouterLink, RouterOutlet],
|
imports: [RouterLink, RouterOutlet, RouterLinkActive],
|
||||||
templateUrl: './comic-overview.component.html',
|
templateUrl: './comic-overview.component.html',
|
||||||
styleUrl: './comic-overview.component.css'
|
styleUrl: './comic-overview.component.css'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
<p>comic-list works!</p>
|
||||||
+6
-6
@@ -1,18 +1,18 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { ComicsListComponent } from './comics-list.component';
|
import { ComicListComponent } from './comic-list.component';
|
||||||
|
|
||||||
describe('Comics', () => {
|
describe('ComicListComponent', () => {
|
||||||
let component: ComicsListComponent;
|
let component: ComicListComponent;
|
||||||
let fixture: ComponentFixture<ComicsListComponent>;
|
let fixture: ComponentFixture<ComicListComponent>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [ComicsListComponent]
|
imports: [ComicListComponent]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
fixture = TestBed.createComponent(ComicsListComponent);
|
fixture = TestBed.createComponent(ComicListComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-comic-list',
|
||||||
|
imports: [],
|
||||||
|
templateUrl: './comic-list.component.html',
|
||||||
|
styleUrl: './comic-list.component.css'
|
||||||
|
})
|
||||||
|
export class ComicListComponent {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1 +0,0 @@
|
|||||||
<p>comics works!</p>
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import { Component } from '@angular/core';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'kontor-comics-list',
|
|
||||||
imports: [],
|
|
||||||
templateUrl: './comics-list.component.html',
|
|
||||||
styleUrl: './comics-list.component.css'
|
|
||||||
})
|
|
||||||
export class ComicsListComponent {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<p>publisher works!</p>
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<p>publisher-list works!</p>
|
||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { PublisherListComponent } from './publisher-list.component';
|
||||||
|
|
||||||
|
describe('PublisherListComponent', () => {
|
||||||
|
let component: PublisherListComponent;
|
||||||
|
let fixture: ComponentFixture<PublisherListComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [PublisherListComponent]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(PublisherListComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'kontor-publisher-list',
|
selector: 'app-publisher-list',
|
||||||
imports: [],
|
imports: [],
|
||||||
templateUrl: './publisher-list.component.html',
|
templateUrl: './publisher-list.component.html',
|
||||||
styleUrl: './publisher-list.component.css'
|
styleUrl: './publisher-list.component.css'
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
/* Footer */
|
||||||
|
a {
|
||||||
|
padding: 20px;
|
||||||
|
text-align: center;
|
||||||
|
background: #ddd;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<footer>
|
<div>
|
||||||
<a href="{{ footerUrl }}">{{ footerLink }}</a>
|
<a href="{{ footerUrl }}">{{ footerLink }}</a>
|
||||||
</footer>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
/* Header/Blog Title */
|
||||||
|
.header {
|
||||||
|
padding: 30px;
|
||||||
|
text-align: center;
|
||||||
|
background-color: lightblue;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header h1 {
|
||||||
|
font-size: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,19 @@
|
|||||||
<header>
|
<header class="header">
|
||||||
<section>
|
<section>
|
||||||
<h1>{{ title() }}</h1>
|
<h1>{{ title() }}</h1>
|
||||||
</section>
|
</section>
|
||||||
<nav>
|
<!-- <nav>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a routerLink="/">Kontor</a></li>
|
<li><a routerLink="/">Kontor</a></li>
|
||||||
<li><a routerLink="/comic">Comics</a></li>
|
<li><a routerLink="/comic">Comics</a></li>
|
||||||
<li><a routerLink="/tysc">TradeYourSportsCards</a></li>
|
<li><a routerLink="/tysc">TradeYourSportsCards</a></li>
|
||||||
<li><a routerLink="/media">Media</a></li>
|
<li><a routerLink="/media">Media</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav> -->
|
||||||
</header>
|
</header>
|
||||||
|
<div class="topnav">
|
||||||
|
<a routerLink="/" routerLinkActive="active">Kontor</a>
|
||||||
|
<a routerLink="/comic" routerLinkActive="active">Comics</a>
|
||||||
|
<a routerLink="/tysc" routerLinkActive="active">TradeYourSportsCards</a>
|
||||||
|
<a routerLink="/media" routerLinkActive="active">Media</a>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { Component, signal } from '@angular/core';
|
import { Component, signal } from '@angular/core';
|
||||||
import { RouterLink } from '@angular/router';
|
import { RouterLink, RouterLinkActive } from '@angular/router';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'kontor-header',
|
selector: 'kontor-header',
|
||||||
imports: [RouterLink],
|
imports: [RouterLink, RouterLinkActive],
|
||||||
templateUrl: './header.component.html',
|
templateUrl: './header.component.html',
|
||||||
styleUrl: './header.component.css'
|
styleUrl: './header.component.css'
|
||||||
})
|
})
|
||||||
|
|||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
<p>media-actor-list works!</p>
|
||||||
+6
-6
@@ -1,18 +1,18 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { MediaFilesListComponent } from './media-files-list.component';
|
import { MediaActorListComponent } from './media-actor-list.component';
|
||||||
|
|
||||||
describe('MediaFilesList', () => {
|
describe('MediaActorListComponent', () => {
|
||||||
let component: MediaFilesListComponent;
|
let component: MediaActorListComponent;
|
||||||
let fixture: ComponentFixture<MediaFilesListComponent>;
|
let fixture: ComponentFixture<MediaActorListComponent>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [MediaFilesListComponent]
|
imports: [MediaActorListComponent]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
fixture = TestBed.createComponent(MediaFilesListComponent);
|
fixture = TestBed.createComponent(MediaActorListComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-media-actor-list',
|
||||||
|
imports: [],
|
||||||
|
templateUrl: './media-actor-list.component.html',
|
||||||
|
styleUrl: './media-actor-list.component.css'
|
||||||
|
})
|
||||||
|
export class MediaActorListComponent {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1 +0,0 @@
|
|||||||
<p>media-actors-list works!</p>
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import { Component } from '@angular/core';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'app-media-actors-list',
|
|
||||||
imports: [],
|
|
||||||
templateUrl: './media-actors-list.component.html',
|
|
||||||
styleUrl: './media-actors-list.component.css'
|
|
||||||
})
|
|
||||||
export class MediaActorsListComponent {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<p>media-file-list works!</p>
|
||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { MediaFileListComponent } from './media-file-list.component';
|
||||||
|
|
||||||
|
describe('MediaFileListComponent', () => {
|
||||||
|
let component: MediaFileListComponent;
|
||||||
|
let fixture: ComponentFixture<MediaFileListComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [MediaFileListComponent]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(MediaFileListComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-media-file-list',
|
||||||
|
imports: [],
|
||||||
|
templateUrl: './media-file-list.component.html',
|
||||||
|
styleUrl: './media-file-list.component.css'
|
||||||
|
})
|
||||||
|
export class MediaFileListComponent {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1 +0,0 @@
|
|||||||
<p>media-files-list works!</p>
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import { Component } from '@angular/core';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'app-media-files-list',
|
|
||||||
imports: [],
|
|
||||||
templateUrl: './media-files-list.component.html',
|
|
||||||
styleUrl: './media-files-list.component.css'
|
|
||||||
})
|
|
||||||
export class MediaFilesListComponent {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<p>media-overview works!</p>
|
<!-- <p>media-overview works!</p>
|
||||||
<div>
|
<div>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a routerLink="/media/mediafiles">MediaFiles</a></li>
|
<li><a routerLink="/media/mediafiles">MediaFiles</a></li>
|
||||||
@@ -7,4 +7,10 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<h4>Child Routes Result</h4>
|
<h4>Child Routes Result</h4>
|
||||||
<router-outlet></router-outlet>
|
<router-outlet></router-outlet>
|
||||||
|
</div> -->
|
||||||
|
<div class="subnav">
|
||||||
|
<a routerLink="/media/mediafiles" routerLinkActive="active">MediaFiles</a>
|
||||||
|
<a routerLink="/media/mediaactors" routerLinkActive="active">MediaActors</a>
|
||||||
|
<a routerLink="/media/mediavideos" routerLinkActive="active">MediaVideos</a>
|
||||||
</div>
|
</div>
|
||||||
|
<router-outlet></router-outlet>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { RouterLink, RouterOutlet } from '@angular/router';
|
import { RouterLink, RouterOutlet, RouterLinkActive } from '@angular/router';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'kontor-media-overview',
|
selector: 'kontor-media-overview',
|
||||||
imports: [RouterOutlet, RouterLink],
|
imports: [RouterOutlet, RouterLink, RouterLinkActive],
|
||||||
templateUrl: './media-overview.component.html',
|
templateUrl: './media-overview.component.html',
|
||||||
styleUrl: './media-overview.component.css'
|
styleUrl: './media-overview.component.css'
|
||||||
})
|
})
|
||||||
|
|||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
<p>media-video-list works!</p>
|
||||||
+6
-6
@@ -1,18 +1,18 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { MediaActorsListComponent } from './media-actors-list.component';
|
import { MediaVideoListComponent } from './media-video-list.component';
|
||||||
|
|
||||||
describe('MediaActorsList', () => {
|
describe('MediaVideoListComponent', () => {
|
||||||
let component: MediaActorsListComponent;
|
let component: MediaVideoListComponent;
|
||||||
let fixture: ComponentFixture<MediaActorsListComponent>;
|
let fixture: ComponentFixture<MediaVideoListComponent>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [MediaActorsListComponent]
|
imports: [MediaVideoListComponent]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
fixture = TestBed.createComponent(MediaActorsListComponent);
|
fixture = TestBed.createComponent(MediaVideoListComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-media-video-list',
|
||||||
|
imports: [],
|
||||||
|
templateUrl: './media-video-list.component.html',
|
||||||
|
styleUrl: './media-video-list.component.css'
|
||||||
|
})
|
||||||
|
export class MediaVideoListComponent {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1 +0,0 @@
|
|||||||
<p>media-videos-list works!</p>
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
||||||
|
|
||||||
import { MediaVideosListComponent } from './media-videos-list.component';
|
|
||||||
|
|
||||||
describe('MediaVideosList', () => {
|
|
||||||
let component: MediaVideosListComponent;
|
|
||||||
let fixture: ComponentFixture<MediaVideosListComponent>;
|
|
||||||
|
|
||||||
beforeEach(async () => {
|
|
||||||
await TestBed.configureTestingModule({
|
|
||||||
imports: [MediaVideosListComponent]
|
|
||||||
})
|
|
||||||
.compileComponents();
|
|
||||||
|
|
||||||
fixture = TestBed.createComponent(MediaVideosListComponent);
|
|
||||||
component = fixture.componentInstance;
|
|
||||||
fixture.detectChanges();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should create', () => {
|
|
||||||
expect(component).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import { Component } from '@angular/core';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'app-media-videos-list',
|
|
||||||
imports: [],
|
|
||||||
templateUrl: './media-videos-list.component.html',
|
|
||||||
styleUrl: './media-videos-list.component.css'
|
|
||||||
})
|
|
||||||
export class MediaVideosListComponent {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import { Injectable, signal } from "@angular/core";
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class ErrorService {
|
||||||
|
private _error = signal('');
|
||||||
|
|
||||||
|
error = this._error.asReadonly();
|
||||||
|
|
||||||
|
showError(message: string) {
|
||||||
|
console.log(message);
|
||||||
|
this._error.set(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
clearError() {
|
||||||
|
this._error.set('');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<p>cardset-list works!</p>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { CardsetListComponent } from './cardset-list.component';
|
||||||
|
|
||||||
|
describe('CardsetListComponent', () => {
|
||||||
|
let component: CardsetListComponent;
|
||||||
|
let fixture: ComponentFixture<CardsetListComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [CardsetListComponent]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(CardsetListComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-cardset-list',
|
||||||
|
imports: [],
|
||||||
|
templateUrl: './cardset-list.component.html',
|
||||||
|
styleUrl: './cardset-list.component.css'
|
||||||
|
})
|
||||||
|
export class CardsetListComponent {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<p>player-list works!</p>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { PlayerListComponent } from './player-list.component';
|
||||||
|
|
||||||
|
describe('PlayerListComponent', () => {
|
||||||
|
let component: PlayerListComponent;
|
||||||
|
let fixture: ComponentFixture<PlayerListComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [PlayerListComponent]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(PlayerListComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-player-list',
|
||||||
|
imports: [],
|
||||||
|
templateUrl: './player-list.component.html',
|
||||||
|
styleUrl: './player-list.component.css'
|
||||||
|
})
|
||||||
|
export class PlayerListComponent {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<p>position-list works!</p>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { PositionListComponent } from './position-list.component';
|
||||||
|
|
||||||
|
describe('PositionListComponent', () => {
|
||||||
|
let component: PositionListComponent;
|
||||||
|
let fixture: ComponentFixture<PositionListComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [PositionListComponent]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(PositionListComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-position-list',
|
||||||
|
imports: [],
|
||||||
|
templateUrl: './position-list.component.html',
|
||||||
|
styleUrl: './position-list.component.css'
|
||||||
|
})
|
||||||
|
export class PositionListComponent {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<p>sport-list works!</p>
|
||||||
|
<ul>
|
||||||
|
@for (sport of sports(); track sport.id) {
|
||||||
|
<li>
|
||||||
|
<h3>{{ sport.name }}</h3>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { SportListComponent } from './sport-list.component';
|
||||||
|
|
||||||
|
describe('SportListComponent', () => {
|
||||||
|
let component: SportListComponent;
|
||||||
|
let fixture: ComponentFixture<SportListComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [SportListComponent]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(SportListComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
import { Component, DestroyRef, inject, OnInit, signal } from '@angular/core';
|
||||||
|
import { Sport } from '../sport.model';
|
||||||
|
import { SportService } from '../sport.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-sport-list',
|
||||||
|
imports: [],
|
||||||
|
templateUrl: './sport-list.component.html',
|
||||||
|
styleUrl: './sport-list.component.css'
|
||||||
|
})
|
||||||
|
export class SportListComponent implements OnInit {
|
||||||
|
sports = signal<Sport[] | undefined>(undefined);
|
||||||
|
isFetching = signal(false);
|
||||||
|
error = signal('');
|
||||||
|
private sportService = inject(SportService);
|
||||||
|
private destroyRef = inject(DestroyRef);
|
||||||
|
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.isFetching.set(true);
|
||||||
|
const subscription = this.sportService.loadSports().subscribe({
|
||||||
|
next: (sports) => {
|
||||||
|
this.sports.set(sports);
|
||||||
|
},
|
||||||
|
error: (error: Error) => {
|
||||||
|
this.error.set(error.message);
|
||||||
|
},
|
||||||
|
complete: () => {
|
||||||
|
this.isFetching.set(false);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
this.destroyRef.onDestroy(() => {
|
||||||
|
subscription.unsubscribe();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<p>sport-selector works!</p>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { SportSelectorComponent } from './sport-selector.component';
|
||||||
|
|
||||||
|
describe('SportSelectorComponent', () => {
|
||||||
|
let component: SportSelectorComponent;
|
||||||
|
let fixture: ComponentFixture<SportSelectorComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [SportSelectorComponent]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(SportSelectorComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-sport-selector',
|
||||||
|
imports: [],
|
||||||
|
templateUrl: './sport-selector.component.html',
|
||||||
|
styleUrl: './sport-selector.component.css'
|
||||||
|
})
|
||||||
|
export class SportSelectorComponent {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
export interface Sport {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import { HttpClient } from "@angular/common/http";
|
||||||
|
import { inject, Injectable, signal } from "@angular/core";
|
||||||
|
import { Sport } from "./sport.model";
|
||||||
|
import { catchError, map, throwError } from "rxjs";
|
||||||
|
import { ErrorService } from "../../shared/error.service";
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root',
|
||||||
|
})
|
||||||
|
export class SportService {
|
||||||
|
private errorService = inject(ErrorService);
|
||||||
|
private httpClient = inject(HttpClient);
|
||||||
|
private sports = signal<Sport[]>([]);
|
||||||
|
|
||||||
|
loadedSports = this.sports.asReadonly();
|
||||||
|
|
||||||
|
loadSports() {
|
||||||
|
return this.fetchSports('http://127.0.0.1:8800/api/tysc/sports', 'Someting went wrong fetching sports. Please try again later-');
|
||||||
|
}
|
||||||
|
|
||||||
|
private fetchSports(url: string, errorMessage: string) {
|
||||||
|
return this.httpClient.get<Sport[]>(url).pipe(
|
||||||
|
map((resData) => resData),
|
||||||
|
catchError((error) => {
|
||||||
|
console.log(error);
|
||||||
|
return throwError(() => new Error(errorMessage));
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<p>team-list works!</p>
|
||||||
+6
-6
@@ -1,18 +1,18 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { Publisher } from './publisher-list.component';
|
import { TeamListComponent } from './team-list.component';
|
||||||
|
|
||||||
describe('Publisher', () => {
|
describe('TeamListComponent', () => {
|
||||||
let component: Publisher;
|
let component: TeamListComponent;
|
||||||
let fixture: ComponentFixture<Publisher>;
|
let fixture: ComponentFixture<TeamListComponent>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [Publisher]
|
imports: [TeamListComponent]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
fixture = TestBed.createComponent(Publisher);
|
fixture = TestBed.createComponent(TeamListComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-team-list',
|
||||||
|
imports: [],
|
||||||
|
templateUrl: './team-list.component.html',
|
||||||
|
styleUrl: './team-list.component.css'
|
||||||
|
})
|
||||||
|
export class TeamListComponent {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<div class="subnav">
|
||||||
|
<a routerLink="/tysc/team" routerLinkActive="active">Team</a>
|
||||||
|
<a routerLink="/tysc/player" routerLinkActive="active">Player</a>
|
||||||
|
<a routerLink="/tysc/position" routerLinkActive="active">Position</a>
|
||||||
|
<a routerLink="/tysc/cadset" routerLinkActive="active">CardSets</a>
|
||||||
|
<a routerLink="/tysc/vendor" routerLinkActive="active">Vendor</a>
|
||||||
|
</div>
|
||||||
|
<router-outlet></router-outlet>
|
||||||
+6
-6
@@ -1,18 +1,18 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { Artist } from './artist-list.component';
|
import { TyscMenuComponent } from './tysc-menu.component';
|
||||||
|
|
||||||
describe('Artist', () => {
|
describe('TyscMenuComponent', () => {
|
||||||
let component: Artist;
|
let component: TyscMenuComponent;
|
||||||
let fixture: ComponentFixture<Artist>;
|
let fixture: ComponentFixture<TyscMenuComponent>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [Artist]
|
imports: [TyscMenuComponent]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
fixture = TestBed.createComponent(Artist);
|
fixture = TestBed.createComponent(TyscMenuComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-tysc-menu',
|
||||||
|
imports: [RouterLink, RouterLinkActive, RouterOutlet],
|
||||||
|
templateUrl: './tysc-menu.component.html',
|
||||||
|
styleUrl: './tysc-menu.component.css'
|
||||||
|
})
|
||||||
|
export class TyscMenuComponent {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<p>vendor-list works!</p>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { VendorListComponent } from './vendor-list.component';
|
||||||
|
|
||||||
|
describe('VendorListComponent', () => {
|
||||||
|
let component: VendorListComponent;
|
||||||
|
let fixture: ComponentFixture<VendorListComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [VendorListComponent]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(VendorListComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-vendor-list',
|
||||||
|
imports: [],
|
||||||
|
templateUrl: './vendor-list.component.html',
|
||||||
|
styleUrl: './vendor-list.component.css'
|
||||||
|
})
|
||||||
|
export class VendorListComponent {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>KontorAngular</title>
|
<title>Kontor</title>
|
||||||
<base href="/">
|
<base href="/">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||||
|
|||||||
@@ -1 +1,69 @@
|
|||||||
/* You can add global styles to this file, and also import other style files */
|
/* You can add global styles to this file, and also import other style files */
|
||||||
|
* {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: Arial;
|
||||||
|
padding: 0px;
|
||||||
|
background: lightgrey;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Style the top navigation bar */
|
||||||
|
.topnav {
|
||||||
|
overflow: hidden;
|
||||||
|
background-color: darkgrey;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Style the topnav links */
|
||||||
|
.topnav a {
|
||||||
|
float: left;
|
||||||
|
display: block;
|
||||||
|
color: #f2f2f2;
|
||||||
|
text-align: center;
|
||||||
|
padding: 14px 16px;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Change color on hover */
|
||||||
|
.topnav a:hover {
|
||||||
|
background-color: #ddd;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subnav {
|
||||||
|
overflow: hidden;
|
||||||
|
background-color: grey;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subnav a {
|
||||||
|
float: left;
|
||||||
|
display: block;
|
||||||
|
color: #f2f2f2;
|
||||||
|
text-align: center;
|
||||||
|
padding: 14px 16px;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
display: inline-block;
|
||||||
|
color: white;
|
||||||
|
background-color: dodgerblue;
|
||||||
|
text-align: center;
|
||||||
|
padding: 10px;
|
||||||
|
text-decoration: none;
|
||||||
|
border-radius: 10px;
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Change the color of links on mouse-over */
|
||||||
|
a:hover {
|
||||||
|
background-color: royalblue;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Add a color to the active/current link */
|
||||||
|
a.active {
|
||||||
|
background-color: royalblue;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ from contextlib import asynccontextmanager
|
|||||||
|
|
||||||
from fastapi import FastAPI
|
from fastapi import FastAPI
|
||||||
from fastapi.staticfiles import StaticFiles
|
from fastapi.staticfiles import StaticFiles
|
||||||
|
from fastapi.middleware.cors import CORSMiddleware
|
||||||
|
|
||||||
from src.apis.base import api_router
|
from src.apis.base import api_router
|
||||||
from src.core.log_conf import LOGGING_CONFIG, logger
|
from src.core.log_conf import LOGGING_CONFIG, logger
|
||||||
@@ -27,6 +28,15 @@ def include_router(app: FastAPI):
|
|||||||
def configure_static(app: FastAPI):
|
def configure_static(app: FastAPI):
|
||||||
app.mount("/static", StaticFiles(directory="src/static"), name="static")
|
app.mount("/static", StaticFiles(directory="src/static"), name="static")
|
||||||
|
|
||||||
|
def add_middle_ware(app: FastAPI):
|
||||||
|
app.add_middleware(
|
||||||
|
CORSMiddleware,
|
||||||
|
allow_origins=['*'],
|
||||||
|
allow_credentials=True,
|
||||||
|
allow_methods=['*'],
|
||||||
|
allow_headers=['*'],
|
||||||
|
)
|
||||||
|
|
||||||
def create_tables():
|
def create_tables():
|
||||||
Base.metadata.create_all(bind=engine)
|
Base.metadata.create_all(bind=engine)
|
||||||
|
|
||||||
@@ -35,6 +45,7 @@ def start_application(log):
|
|||||||
app = FastAPI(title=settings.PROJECT_NAME, version=settings.PROJECT_VERSION, lifespan=lifespan)
|
app = FastAPI(title=settings.PROJECT_NAME, version=settings.PROJECT_VERSION, lifespan=lifespan)
|
||||||
include_router(app)
|
include_router(app)
|
||||||
configure_static(app)
|
configure_static(app)
|
||||||
|
add_middle_ware(app)
|
||||||
create_tables()
|
create_tables()
|
||||||
return app
|
return app
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user