Commit a72a7c1b authored by hasan khaddour's avatar hasan khaddour

fix s

parent 295962a5
This diff is collapsed.
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
"start": "ng serve", "start": "ng serve",
"build": "ng build", "build": "ng build",
"watch": "ng build --watch --configuration development", "watch": "ng build --watch --configuration development",
"test": "ng test" "test": "ng test",
"extract-i18n": "ng extract-i18n && xliffmerge --profile xliffmerge.json"
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
...@@ -45,6 +46,8 @@ ...@@ -45,6 +46,8 @@
"karma-coverage": "~2.2.0", "karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0", "karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0", "karma-jasmine-html-reporter": "~2.1.0",
"typescript": "~5.4.2" "ngx-i18nsupport": "^0.17.1",
"typescript": "~5.4.2",
"xliffmerge": "^1.0.0"
} }
} }
...@@ -5,7 +5,7 @@ import { AppRoutingModule } from './app-routing.module'; ...@@ -5,7 +5,7 @@ import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import { LoginComponent } from './pages/login/login.component'; import { LoginComponent } from './pages/login/login.component';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http'; import { HttpClient, HttpClientModule } from '@angular/common/http';
import { ConfigurationService } from './core/services/configuration/configuration.service'; import { ConfigurationService } from './core/services/configuration/configuration.service';
import { CoreModule } from './core/core.module'; import { CoreModule } from './core/core.module';
import { HomeComponent } from './pages/home/home.component'; import { HomeComponent } from './pages/home/home.component';
...@@ -17,7 +17,7 @@ import { HeaderComponent } from './shared/sharedLayout/header/header.component'; ...@@ -17,7 +17,7 @@ import { HeaderComponent } from './shared/sharedLayout/header/header.component';
import { CustomersModule } from './customers/customers.module'; import { CustomersModule } from './customers/customers.module';
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async'; import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
import { PageNotfoundComponent } from './pages/page-notfound/page-notfound.component'; import { PageNotfoundComponent } from './pages/page-notfound/page-notfound.component';
import { LOCALE_ID } from '@angular/core';
@NgModule({ @NgModule({
declarations: [ declarations: [
AppComponent, AppComponent,
...@@ -37,8 +37,12 @@ import { PageNotfoundComponent } from './pages/page-notfound/page-notfound.compo ...@@ -37,8 +37,12 @@ import { PageNotfoundComponent } from './pages/page-notfound/page-notfound.compo
], ],
providers: [ providers: [
provideAnimationsAsync() provideAnimationsAsync(),
{ provide: LOCALE_ID, useValue: 'en' }
], ],
bootstrap: [AppComponent] bootstrap: [AppComponent]
}) })
export class AppModule { } export class AppModule { }
// export function HttpLoaderFactory(http: HttpClient) {
// return new TranslateHttpLoader(http);
// }
import { TestBed } from '@angular/core/testing';
import { CanActivateFn } from '@angular/router';
import { authGuard } from './auth.guard';
describe('authGuard', () => {
const executeGuard: CanActivateFn = (...guardParameters) =>
TestBed.runInInjectionContext(() => authGuard(...guardParameters));
beforeEach(() => {
TestBed.configureTestingModule({});
});
it('should be created', () => {
expect(executeGuard).toBeTruthy();
});
});
...@@ -14,7 +14,7 @@ export class AuthGuard implements CanActivate { ...@@ -14,7 +14,7 @@ export class AuthGuard implements CanActivate {
//this.router.navigate(["/login"]) //this.router.navigate(["/login"])
return true; return true;
// if (this.auth.IsAuthenticated()) { // if (this.auth.isAuthenticated()) {
// return true ; // return true ;
// } else { // } else {
// this.router.navigate(["/login"]) // this.router.navigate(["/login"])
......
...@@ -31,7 +31,7 @@ export class AuthenticationService { ...@@ -31,7 +31,7 @@ export class AuthenticationService {
this.config.getServerUrl()+ "/Authentication/register",registerRequest) this.config.getServerUrl()+ "/Authentication/register",registerRequest)
} }
IsAuthenticated():Boolean{ isAuthenticated():Boolean{
if(this.dataStorage.getItem("token")){ if(this.dataStorage.getItem("token")){
return true ; return true ;
}else{ }else{
......
...@@ -9,4 +9,5 @@ ...@@ -9,4 +9,5 @@
</div> </div>
<section class="section dashboard"> <section class="section dashboard">
workkkk workkkk
<h1 i18n="@@appTitle">My Awesome App</h1>
</section> </section>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment