From 4347f2668b4d3eb44fe060ecf2d9dc4e759621b2 Mon Sep 17 00:00:00 2001 From: abarhub Date: Sun, 19 Jun 2022 13:22:52 +0200 Subject: [PATCH] reformatage du code --- src/app/app-routing.module.ts | 7 ++-- src/app/app.component.html | 4 --- src/app/app.component.spec.ts | 6 ++-- src/app/app.component.ts | 2 -- src/app/app.module.ts | 35 ++++++++++--------- src/app/game-state/game-state.component.html | 11 ++++-- src/app/game-state/game-state.component.scss | 4 +-- .../game-state/game-state.component.spec.ts | 8 ++--- src/app/grid/grid.component.html | 19 +++++----- src/app/grid/grid.component.scss | 1 + src/app/grid/grid.component.spec.ts | 8 ++--- .../theme-manager.component.spec.ts | 2 +- .../theme-manager/theme-manager.component.ts | 1 - 13 files changed, 53 insertions(+), 55 deletions(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index d425c6f..dcfd49a 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,5 +1,5 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import {NgModule} from '@angular/core'; +import {RouterModule, Routes} from '@angular/router'; const routes: Routes = []; @@ -7,4 +7,5 @@ const routes: Routes = []; imports: [RouterModule.forRoot(routes)], exports: [RouterModule] }) -export class AppRoutingModule { } +export class AppRoutingModule { +} diff --git a/src/app/app.component.html b/src/app/app.component.html index 22fa547..055b1d3 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -31,8 +31,4 @@

Tic Tac Toe

- - - - diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index b7af888..890255d 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -1,6 +1,6 @@ -import { TestBed } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; -import { AppComponent } from './app.component'; +import {TestBed} from '@angular/core/testing'; +import {RouterTestingModule} from '@angular/router/testing'; +import {AppComponent} from './app.component'; import {Store, StoreModule} from '@ngrx/store'; describe('AppComponent', () => { diff --git a/src/app/app.component.ts b/src/app/app.component.ts index ddd2ead..a04cc81 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -5,8 +5,6 @@ import {nouveauJeaux, selectionneCase} from './store/jeux.actions'; import {Observable} from 'rxjs'; import {AppState} from './store/app.state'; import {CaseModel} from './model/case.model'; -import {FormBuilder, FormGroup} from '@angular/forms'; -import {ThemeModel} from './model/theme.model'; @Component({ selector: 'app-root', diff --git a/src/app/app.module.ts b/src/app/app.module.ts index f675e23..5873992 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,15 +1,15 @@ -import { BrowserModule } from '@angular/platform-browser'; -import { NgModule } from '@angular/core'; +import {BrowserModule} from '@angular/platform-browser'; +import {NgModule} from '@angular/core'; -import { AppRoutingModule } from './app-routing.module'; -import { AppComponent } from './app.component'; -import { StoreModule } from '@ngrx/store'; +import {AppRoutingModule} from './app-routing.module'; +import {AppComponent} from './app.component'; +import {StoreModule} from '@ngrx/store'; import {jeuxReducer} from './store/jeux.reducer'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; -import { GridComponent } from './grid/grid.component'; -import { GameStateComponent } from './game-state/game-state.component'; +import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; +import {GridComponent} from './grid/grid.component'; +import {GameStateComponent} from './game-state/game-state.component'; import {ReactiveFormsModule} from '@angular/forms'; -import { ThemeManagerComponent } from './theme-manager/theme-manager.component'; +import {ThemeManagerComponent} from './theme-manager/theme-manager.component'; @NgModule({ declarations: [ @@ -18,14 +18,15 @@ import { ThemeManagerComponent } from './theme-manager/theme-manager.component'; GameStateComponent, ThemeManagerComponent ], - imports: [ - BrowserModule, - AppRoutingModule, - StoreModule.forRoot({jeux: jeuxReducer}, {}), - NgbModule, - ReactiveFormsModule - ], + imports: [ + BrowserModule, + AppRoutingModule, + StoreModule.forRoot({jeux: jeuxReducer}, {}), + NgbModule, + ReactiveFormsModule + ], providers: [], bootstrap: [AppComponent] }) -export class AppModule { } +export class AppModule { +} diff --git a/src/app/game-state/game-state.component.html b/src/app/game-state/game-state.component.html index e13be76..60693eb 100644 --- a/src/app/game-state/game-state.component.html +++ b/src/app/game-state/game-state.component.html @@ -1,7 +1,12 @@ -
-
Joueur 1 ({{joueursConstantes.JOUEUR1_AFFICHAGE}})
-
Joueur 2 ({{joueursConstantes.JOUEUR2_AFFICHAGE}})
+
Joueur 1 ({{joueursConstantes.JOUEUR1_AFFICHAGE}}) +
+
Joueur 2 ({{joueursConstantes.JOUEUR2_AFFICHAGE}}) +
diff --git a/src/app/game-state/game-state.component.scss b/src/app/game-state/game-state.component.scss index 9210ab1..d87d1c4 100644 --- a/src/app/game-state/game-state.component.scss +++ b/src/app/game-state/game-state.component.scss @@ -1,5 +1,3 @@ - - $couleur-formes2: var(--secondary-color); .joueurSelectionne { @@ -13,6 +11,6 @@ $couleur-formes2: var(--secondary-color); } .joueur { - border: 1px ; + border: 1px; border-color: black; } diff --git a/src/app/game-state/game-state.component.spec.ts b/src/app/game-state/game-state.component.spec.ts index 0b29d27..dbc7f49 100644 --- a/src/app/game-state/game-state.component.spec.ts +++ b/src/app/game-state/game-state.component.spec.ts @@ -1,6 +1,6 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; +import {ComponentFixture, TestBed} from '@angular/core/testing'; -import { GameStateComponent } from './game-state.component'; +import {GameStateComponent} from './game-state.component'; import {Store, StoreModule} from '@ngrx/store'; describe('GameStateComponent', () => { @@ -10,10 +10,10 @@ describe('GameStateComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ GameStateComponent ], + declarations: [GameStateComponent], imports: [StoreModule.forRoot({})] }) - .compileComponents(); + .compileComponents(); store = TestBed.inject(Store); }); diff --git a/src/app/grid/grid.component.html b/src/app/grid/grid.component.html index 8e04544..7de132c 100644 --- a/src/app/grid/grid.component.html +++ b/src/app/grid/grid.component.html @@ -1,18 +1,17 @@ - - - - + + + - - - + + + - - - + + +
{{get(0,0)}}{{get(0,1)}}{{get(0,2)}}{{get(0, 0)}}{{get(0, 1)}}{{get(0, 2)}}
{{get(1,0)}}{{get(1,1)}}{{get(1,2)}}{{get(1, 0)}}{{get(1, 1)}}{{get(1, 2)}}
{{get(2,0)}}{{get(2,1)}}{{get(2,2)}}{{get(2, 0)}}{{get(2, 1)}}{{get(2, 2)}}
diff --git a/src/app/grid/grid.component.scss b/src/app/grid/grid.component.scss index a106bfc..83b323d 100644 --- a/src/app/grid/grid.component.scss +++ b/src/app/grid/grid.component.scss @@ -2,6 +2,7 @@ table { width: 12.75rem; height: 12.75rem; + td { width: 1.25rem; height: 1.25rem; diff --git a/src/app/grid/grid.component.spec.ts b/src/app/grid/grid.component.spec.ts index d57be3a..52f4d7e 100644 --- a/src/app/grid/grid.component.spec.ts +++ b/src/app/grid/grid.component.spec.ts @@ -1,6 +1,6 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; +import {ComponentFixture, TestBed} from '@angular/core/testing'; -import { GridComponent } from './grid.component'; +import {GridComponent} from './grid.component'; import {Store, StoreModule} from '@ngrx/store'; describe('GridComponent', () => { @@ -10,10 +10,10 @@ describe('GridComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ GridComponent ], + declarations: [GridComponent], imports: [StoreModule.forRoot({})] }) - .compileComponents(); + .compileComponents(); store = TestBed.inject(Store); }); diff --git a/src/app/theme-manager/theme-manager.component.spec.ts b/src/app/theme-manager/theme-manager.component.spec.ts index 44f3448..d9b3697 100644 --- a/src/app/theme-manager/theme-manager.component.spec.ts +++ b/src/app/theme-manager/theme-manager.component.spec.ts @@ -2,7 +2,7 @@ import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ThemeManagerComponent} from './theme-manager.component'; import {Store, StoreModule} from '@ngrx/store'; -import {FormsModule, ReactiveFormsModule, UntypedFormBuilder} from '@angular/forms'; +import {ReactiveFormsModule, UntypedFormBuilder} from '@angular/forms'; describe('ThemeManagerComponent', () => { let component: ThemeManagerComponent; diff --git a/src/app/theme-manager/theme-manager.component.ts b/src/app/theme-manager/theme-manager.component.ts index dc01a28..e0bc72d 100644 --- a/src/app/theme-manager/theme-manager.component.ts +++ b/src/app/theme-manager/theme-manager.component.ts @@ -1,7 +1,6 @@ import {Component, OnInit} from '@angular/core'; import {UntypedFormBuilder, UntypedFormGroup} from '@angular/forms'; import {ThemeModel} from '../model/theme.model'; -import {Store} from '@ngrx/store'; @Component({ selector: 'app-theme-manager',