Skip to content

Commit

Permalink
Standalone migration- Manual step- Remove project module
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsongutidev committed Sep 21, 2023
1 parent fe51847 commit 3081377
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 132 deletions.
18 changes: 18 additions & 0 deletions src/app/app-routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Routes } from '@angular/router';

export const routes: Routes = [
{
path: 'project',
loadChildren: () => import('./project/project-routes').then((m) => m.PROJECT_ROUTES)
},
{
path: 'wip',
loadChildren: () =>
import('./work-in-progress/work-in-progress.module').then((m) => m.WorkInProgressModule)
},
{
path: '',
redirectTo: 'project',
pathMatch: 'full'
}
];
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ProjectComponent } from './project.component';
import { ProjectConst } from './config/const';
import { FullIssueDetailComponent } from './pages/full-issue-detail/full-issue-detail.component';

const routes: Routes = [
export const PROJECT_ROUTES: Routes = [
{
path: '',
component: ProjectComponent,
Expand All @@ -31,9 +31,3 @@ const routes: Routes = [
]
}
];

@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class ProjectRoutingModule {}
28 changes: 23 additions & 5 deletions src/app/project/project.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,31 @@ import { LoginPayload } from '@trungk18/project/auth/loginPayload';
import { SvgDefinitionsComponent } from '../jira-control/svg-definitions/svg-definitions.component';
import { RouterOutlet } from '@angular/router';
import { NavigationComponent } from './components/navigation/navigation/navigation.component';
import { NzDrawerModule } from 'ng-zorro-antd/drawer';
import { NzDropDownModule } from 'ng-zorro-antd/dropdown';
import { NzModalModule } from 'ng-zorro-antd/modal';
import { NzNotificationModule } from 'ng-zorro-antd/notification';
import { NzPopoverModule } from 'ng-zorro-antd/popover';
import { NzSelectModule } from 'ng-zorro-antd/select';
import { NzToolTipModule } from 'ng-zorro-antd/tooltip';

@Component({
selector: 'app-project',
templateUrl: './project.component.html',
styleUrls: ['./project.component.scss'],
standalone: true,
imports: [NavigationComponent, RouterOutlet, SvgDefinitionsComponent]
selector: 'app-project',
templateUrl: './project.component.html',
styleUrls: ['./project.component.scss'],
standalone: true,
imports: [
NavigationComponent,
RouterOutlet,
SvgDefinitionsComponent,
NzToolTipModule,
NzModalModule,
NzDropDownModule,
NzSelectModule,
NzNotificationModule,
NzDrawerModule,
NzPopoverModule
]
})
export class ProjectComponent implements OnInit {
expanded: boolean;
Expand Down
17 changes: 0 additions & 17 deletions src/app/project/project.module.spec.ts

This file was deleted.

75 changes: 0 additions & 75 deletions src/app/project/project.module.ts

This file was deleted.

65 changes: 37 additions & 28 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { enableProdMode, ErrorHandler, APP_INITIALIZER, importProvidersFrom } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import * as Sentry from '@sentry/angular';
import { Integrations } from '@sentry/tracing';

Expand All @@ -10,13 +9,14 @@ import { AkitaNgRouterStoreModule } from '@datorama/akita-ng-router-store';
import { AkitaNgDevtools } from '@datorama/akita-ngdevtools';
import { NzIconModule } from 'ng-zorro-antd/icon';
import { NzSpinModule } from 'ng-zorro-antd/spin';
import { AppRoutingModule } from './app/app-routing.module';
import { withInterceptorsFromDi, provideHttpClient } from '@angular/common/http';
import { ReactiveFormsModule } from '@angular/forms';
import { provideAnimations } from '@angular/platform-browser/animations';
import { BrowserModule, bootstrapApplication } from '@angular/platform-browser';
import { Router } from '@angular/router';
import { Router, provideRouter } from '@angular/router';
import { NG_ENTITY_SERVICE_CONFIG } from '@datorama/akita-ng-entity-service';
import { routes } from '@trungk18/app-routes';
import { NZ_JIRA_ICONS } from '@trungk18/project/config/icons';

const initSentry = () => {
Sentry.init({
Expand All @@ -39,28 +39,37 @@ if (environment.production) {
}

bootstrapApplication(AppComponent, {
providers: [
importProvidersFrom(BrowserModule, ReactiveFormsModule, AppRoutingModule, NzSpinModule, NzIconModule.forRoot([]), environment.production ? [] : AkitaNgDevtools, AkitaNgRouterStoreModule, QuillModule.forRoot()),
{
provide: NG_ENTITY_SERVICE_CONFIG,
useValue: { baseUrl: 'https://jsonplaceholder.typicode.com' }
},
{
provide: ErrorHandler,
useValue: Sentry.createErrorHandler()
},
{
provide: Sentry.TraceService,
deps: [Router],
},
{
provide: APP_INITIALIZER,
useFactory: () => () => { },
deps: [Sentry.TraceService],
multi: true,
},
provideAnimations(),
provideHttpClient(withInterceptorsFromDi())
]
})
.catch((err) => console.error(err));
providers: [
importProvidersFrom(
BrowserModule,
ReactiveFormsModule,
NzSpinModule,
NzIconModule.forRoot([]),
environment.production ? [] : AkitaNgDevtools,
AkitaNgRouterStoreModule,
QuillModule.forRoot(),
NzIconModule.forChild(NZ_JIRA_ICONS)
),
{
provide: NG_ENTITY_SERVICE_CONFIG,
useValue: { baseUrl: 'https://jsonplaceholder.typicode.com' }
},
{
provide: ErrorHandler,
useValue: Sentry.createErrorHandler()
},
{
provide: Sentry.TraceService,
deps: [Router]
},
{
provide: APP_INITIALIZER,
useFactory: () => () => {},
deps: [Sentry.TraceService],
multi: true
},
provideAnimations(),
provideHttpClient(withInterceptorsFromDi()),
provideRouter(routes)
]
}).catch((err) => console.error(err));

0 comments on commit 3081377

Please sign in to comment.