Skip to content

Commit

Permalink
[#5470] Redesign the router for realtime
Browse files Browse the repository at this point in the history
  • Loading branch information
binDongKim authored and denzelsN committed Apr 22, 2019
1 parent f53656e commit 712e604
Show file tree
Hide file tree
Showing 7 changed files with 219 additions and 103 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,9 @@ export class ScatterChartContainerComponent implements OnInit, OnDestroy {
} else {
this.urlRouteManagerService.openPage([
UrlPath.SCATTER_FULL_SCREEN_MODE,
UrlPathId.REAL_TIME,
this.newUrlStateNotificationService.getPathValue(UrlPathId.APPLICATION).getUrlStr(),
UrlPathId.REAL_TIME
this.selectedAgent
]);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,91 @@ import { AgentInspectorContentsContainerComponent } from 'app/core/components/ag
import { EmptyInspectorContentsContainerComponent } from 'app/core/components/empty-inspector-contents/empty-inspector-contents-container.component';
import { UrlRedirectorComponent } from 'app/shared/components/url-redirector/url-redirector.component';
import { InspectorPageComponent } from './inspector-page.component';
import { ServerTimeResolverService } from 'app/shared/services';

export const routing: Routes = [
{
path: '',
component: InspectorPageComponent,
children: [
{
path: ':' + UrlPathId.APPLICATION + '/:' + UrlPathId.PERIOD + '/:' + UrlPathId.END_TIME + '/:' + UrlPathId.AGENT_ID,
data: {
showRealTimeButton: false,
enableRealTimeMode: false
},
component: AgentInspectorContentsContainerComponent
},
{
path: ':' + UrlPathId.APPLICATION + '/:' + UrlPathId.PERIOD + '/:' + UrlPathId.END_TIME,
data: {
showRealTimeButton: false,
enableRealTimeMode: false
},
component: ApplicationInspectorContentsContainerComponent
},
{
path: ':' + UrlPathId.APPLICATION + '/:' + UrlPathId.PERIOD,
data: {
path: UrlPath.INSPECTOR
},
component: UrlRedirectorComponent
path: UrlPath.REAL_TIME,
children: [
{
path: '',
pathMatch: 'full',
redirectTo: '/' + UrlPath.INSPECTOR
},
{
path: ':' + UrlPathId.APPLICATION,
resolve: {
serverTime: ServerTimeResolverService
},
data: {
showRealTimeButton: true,
enableRealTimeMode: true
},
children: [
{
path: '',
pathMatch: 'full',
component: ApplicationInspectorContentsContainerComponent
},
{
path: ':' + UrlPathId.AGENT_ID,
component: AgentInspectorContentsContainerComponent
}
]
}
]
},
{
path: ':' + UrlPathId.APPLICATION,
data: {
path: UrlPath.INSPECTOR
},
component: UrlRedirectorComponent
children: [
{
path: '',
pathMatch: 'full',
data: {
path: UrlPath.INSPECTOR
},
component: UrlRedirectorComponent
},
{
path: ':' + UrlPathId.PERIOD,
children: [
{
path: '',
pathMatch: 'full',
data: {
path: UrlPath.INSPECTOR
},
component: UrlRedirectorComponent
},
{
path: ':' + UrlPathId.END_TIME,
data: {
showRealTimeButton: true,
enableRealTimeMode: false
},
children: [
{
path: '',
pathMatch: 'full',
component: ApplicationInspectorContentsContainerComponent
},
{
path: ':' + UrlPathId.AGENT_ID,
component: AgentInspectorContentsContainerComponent
}
]
}
]
}
]
},
{
path: '',
pathMatch: 'full',
component: EmptyInspectorContentsContainerComponent
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,76 @@ export const routing: Routes = [
component: MainPageComponent,
children: [
{
path: ':' + UrlPathId.APPLICATION + '/:' + UrlPathId.PERIOD + '/:' + UrlPathId.END_TIME,
data: {
showRealTimeButton: true,
enableRealTimeMode: false
},
component: MainContentsContainerComponent
path: UrlPath.REAL_TIME,
children: [
{
path: '',
pathMatch: 'full',
redirectTo: '/' + UrlPath.MAIN
},
{
path: ':' + UrlPathId.APPLICATION,
resolve: {
serverTime: ServerTimeResolverService
},
data: {
showRealTimeButton: true,
enableRealTimeMode: true
},
component: MainContentsContainerComponent
}
]
},
// ! URL 순서 바꾸면서 사용자들이 기존의 url로 접근했을때 redirect해주려고 임시로 추가해둠.
{
path: ':' + UrlPathId.APPLICATION + '/:' + UrlPath.REAL_TIME,
resolve: {
serverTime: ServerTimeResolverService
},
data: {
showRealTimeButton: true,
enableRealTimeMode: true
},
component: MainContentsContainerComponent
},
{
path: ':' + UrlPathId.APPLICATION + '/:' + UrlPathId.PERIOD,
data: {
path: UrlPath.MAIN
},
component: UrlRedirectorComponent
path: ':' + UrlPathId.APPLICATION + '/' + UrlPathId.REAL_TIME,
pathMatch: 'full',
redirectTo: '/' + UrlPath.MAIN + '/' + UrlPath.REAL_TIME + '/:' + UrlPathId.APPLICATION
},
{
path: ':' + UrlPathId.APPLICATION,
data: {
path: UrlPath.MAIN
},
component: UrlRedirectorComponent
children: [
// {
// path: UrlPath.REAL_TIME,
// pathMatch: 'full',
// redirectTo: '/' + UrlPath.MAIN + '/' + UrlPath.REAL_TIME + '/:' + UrlPathId.APPLICATION
// },
{
path: '',
pathMatch: 'full',
data: {
path: UrlPath.MAIN
},
component: UrlRedirectorComponent
},
{
path: ':' + UrlPathId.PERIOD,
children: [
{
path: '',
pathMatch: 'full',
data: {
path: UrlPath.MAIN
},
component: UrlRedirectorComponent
},
{
path: ':' + UrlPathId.END_TIME,
data: {
showRealTimeButton: true,
enableRealTimeMode: false
},
component: MainContentsContainerComponent
}
]
}
]
},
{
path: '',
data: {
showRealTimeButton: false,
enableRealTimeMode: false
},
pathMatch: 'full',
component: EmptyContentsComponent
}
]
}
];

Original file line number Diff line number Diff line change
Expand Up @@ -12,50 +12,90 @@ export const routing: Routes = [
component: ScatterFullScreenModePageComponent,
children: [
{
path: ':' + UrlPathId.APPLICATION + '/:' + UrlPathId.PERIOD + '/:' + UrlPathId.END_TIME + '/:' + UrlPathId.AGENT_ID,
data: {
showRealTimeButton: true,
enableRealTimeMode: false
},
component: ScatterChartForFullScreenModeContainerComponent
path: UrlPath.REAL_TIME,
children: [
{
path: '',
pathMatch: 'full',
redirectTo: '/' + UrlPath.MAIN
},
{
path: ':' + UrlPathId.APPLICATION,
resolve: {
serverTime: ServerTimeResolverService
},
data: {
showRealTimeButton: true,
enableRealTimeMode: true
},
children: [
{
path: '',
pathMatch: 'full',
component: ScatterChartForFullScreenModeContainerComponent
},
{
path: ':' + UrlPathId.AGENT_ID,
component: ScatterChartForFullScreenModeContainerComponent
}
]
}
]
},
// ! URL 순서 바꾸면서 사용자들이 기존의 url로 접근했을때 redirect해주려고 임시로 추가해둠.
{
path: ':' + UrlPathId.APPLICATION + '/' + UrlPathId.REAL_TIME,
resolve: {
serverTime: ServerTimeResolverService
},
data: {
showRealTimeButton: true,
enableRealTimeMode: true
},
component: ScatterChartForFullScreenModeContainerComponent
},
{
path: ':' + UrlPathId.APPLICATION + '/:' + UrlPathId.PERIOD + '/:' + UrlPathId.END_TIME,
data: {
showRealTimeButton: true,
enableRealTimeMode: false
},
component: ScatterChartForFullScreenModeContainerComponent
},
{
path: ':' + UrlPathId.APPLICATION + '/:' + UrlPathId.PERIOD,
data: {
path: UrlPath.SCATTER_FULL_SCREEN_MODE
},
component: UrlRedirectorComponent
pathMatch: 'full',
redirectTo: '/' + UrlPath.SCATTER_FULL_SCREEN_MODE + '/' + UrlPath.REAL_TIME + '/:' + UrlPathId.APPLICATION,
},
{
path: ':' + UrlPathId.APPLICATION,
data: {
path: UrlPath.SCATTER_FULL_SCREEN_MODE
},
component: UrlRedirectorComponent
children: [
{
path: '',
pathMatch: 'full',
data: {
path: UrlPath.SCATTER_FULL_SCREEN_MODE
},
component: UrlRedirectorComponent
},
{
path: ':' + UrlPathId.PERIOD,
children: [
{
path: '',
pathMatch: 'full',
data: {
path: UrlPath.SCATTER_FULL_SCREEN_MODE
},
component: UrlRedirectorComponent
},
{
path: ':' + UrlPathId.END_TIME,
data: {
showRealTimeButton: true,
enableRealTimeMode: false
},
children: [
{
path: '',
pathMatch: 'full',
component: ScatterChartForFullScreenModeContainerComponent
},
{
path: ':' + UrlPathId.AGENT_ID,
component: ScatterChartForFullScreenModeContainerComponent
}
]
}
]
}
]
},
{
path: '',
redirectTo: `/${UrlPath.MAIN}`,
pathMatch: 'full'
pathMatch: 'full',
redirectTo: '/' + UrlPath.MAIN
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { WebAppSettingDataService, UrlRouteManagerService } from 'app/shared/ser
template: ''
})
export class UrlRedirectorComponent {

constructor(
private activatedRoute: ActivatedRoute,
private webAppSettingDataService: WebAppSettingDataService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,7 @@ export class NewUrlStateNotificationService {
return this.innerRouteData['serverTime'];
}
hasValue(...names: string[]): boolean {
return names.reduce((previous: boolean, name: string) => {
return previous && (this.urlState[name].curr === null ? false : true);
}, true);
return names.every((name: string) => this.urlState[name].curr !== null);
}
getStartPath(): string {
return this.startPath || UrlPath.MAIN;
Expand Down
Loading

0 comments on commit 712e604

Please sign in to comment.