diff --git a/front-end/studio/src/app/app-routing.module.ts b/front-end/studio/src/app/app-routing.module.ts index ddee3aec7..20c0b006b 100644 --- a/front-end/studio/src/app/app-routing.module.ts +++ b/front-end/studio/src/app/app-routing.module.ts @@ -32,77 +32,77 @@ import {ApiAcceptPageComponent} from './pages/apis/{apiId}/collaboration/accept/ import {ApiEditorPageComponent, ApiEditorPageGuard} from './pages/apis/{apiId}/editor/api-editor.page'; const routes: Routes = [ - { - path: '', - component: DashboardPageComponent, - canActivate: [ AuthenticationCanActivateGuard ] - }, - { - path: "settings", - component: SettingsPageComponent, - canActivate: [ AuthenticationCanActivateGuard ] - }, - { - path: "settings/profile", - component: ProfilePageComponent, - canActivate: [ AuthenticationCanActivateGuard ] - }, - { - path: "settings/accounts", - component: LinkedAccountsPageComponent, - canActivate: [ AuthenticationCanActivateGuard ] - }, - { - path: "settings/accounts/:accountType/created", - component: CreatedLinkedAccountPageComponent, - canActivate: [ AuthenticationCanActivateGuard ] - }, - { - path: "apis", - component: ApisPageComponent, - canActivate: [ AuthenticationCanActivateGuard ] - }, - { - path: "apis/create", - component: CreateApiPageComponent, - canActivate: [ AuthenticationCanActivateGuard ] - }, - { - path: "apis/import", - component: ImportApiPageComponent, - canActivate: [ AuthenticationCanActivateGuard ] - }, - { - path: "apis/:apiId", - component: ApiDetailPageComponent, - canActivate: [ AuthenticationCanActivateGuard ] - }, - { - path: "apis/:apiId/collaboration", - component: ApiCollaborationPageComponent, - canActivate: [ AuthenticationCanActivateGuard ] - }, - { - path: "apis/:apiId/collaboration/accept/:inviteId", - component: ApiAcceptPageComponent, - canActivate: [ AuthenticationCanActivateGuard ] - }, - { - path: "apis/:apiId/editor", - component: ApiEditorPageComponent, - canActivate: [ AuthenticationCanActivateGuard ] - }, + { + path: '', + component: DashboardPageComponent, + canActivate: [AuthenticationCanActivateGuard] + }, + { + path: "settings", + component: SettingsPageComponent, + canActivate: [AuthenticationCanActivateGuard] + }, + { + path: "settings/profile", + component: ProfilePageComponent, + canActivate: [AuthenticationCanActivateGuard] + }, + { + path: "settings/accounts", + component: LinkedAccountsPageComponent, + canActivate: [AuthenticationCanActivateGuard] + }, + { + path: "settings/accounts/:accountType/created", + component: CreatedLinkedAccountPageComponent, + canActivate: [AuthenticationCanActivateGuard] + }, + { + path: "apis", + component: ApisPageComponent, + canActivate: [AuthenticationCanActivateGuard] + }, + { + path: "apis/create", + component: CreateApiPageComponent, + canActivate: [AuthenticationCanActivateGuard] + }, + { + path: "apis/import", + component: ImportApiPageComponent, + canActivate: [AuthenticationCanActivateGuard] + }, + { + path: "apis/:apiId", + component: ApiDetailPageComponent, + canActivate: [AuthenticationCanActivateGuard] + }, + { + path: "apis/:apiId/collaboration", + component: ApiCollaborationPageComponent, + canActivate: [AuthenticationCanActivateGuard] + }, + { + path: "apis/:apiId/collaboration/accept/:inviteId", + component: ApiAcceptPageComponent, + canActivate: [AuthenticationCanActivateGuard] + }, + { + path: "apis/:apiId/editor", + component: ApiEditorPageComponent, + canActivate: [AuthenticationCanActivateGuard] + }, ]; @NgModule({ - imports: [ - RouterModule.forRoot(routes) - ], - exports: [ - RouterModule - ], - declarations: [] + imports: [ + RouterModule.forRoot(routes) + ], + exports: [ + RouterModule + ], + declarations: [] }) export class AppRoutingModule { } diff --git a/front-end/studio/src/app/app.component.ts b/front-end/studio/src/app/app.component.ts index b2fb47f80..cd5b1224b 100644 --- a/front-end/studio/src/app/app.component.ts +++ b/front-end/studio/src/app/app.component.ts @@ -15,33 +15,33 @@ * limitations under the License. */ -import { Component } from '@angular/core'; +import {Component} from '@angular/core'; import {IAuthenticationService} from './services/auth.service'; @Component({ - moduleId: module.id, - selector: "apicurio-studio", - templateUrl: "app.component.html", - styleUrls: [ "app.component.css" ] + moduleId: module.id, + selector: "apicurio-studio", + templateUrl: "app.component.html", + styleUrls: ["app.component.css"] }) export class AppComponent { - public routerOutletWrapperId: string; - public routerOutletWrapperClass: string; + public routerOutletWrapperId: string; + public routerOutletWrapperClass: string; - constructor(public authService: IAuthenticationService) { - this.routerOutletWrapperId = "api-page-body"; - this.routerOutletWrapperClass = ""; - - authService.isAuthenticated().subscribe(authed => { - if (authed) { + constructor(public authService: IAuthenticationService) { this.routerOutletWrapperId = "api-page-body"; this.routerOutletWrapperClass = ""; - } else { - this.routerOutletWrapperId = "login-form"; - this.routerOutletWrapperClass = "login-pf"; - } - }); - } + + authService.isAuthenticated().subscribe(authed => { + if (authed) { + this.routerOutletWrapperId = "api-page-body"; + this.routerOutletWrapperClass = ""; + } else { + this.routerOutletWrapperId = "login-form"; + this.routerOutletWrapperClass = "login-pf"; + } + }); + } } diff --git a/front-end/studio/src/app/app.module.ts b/front-end/studio/src/app/app.module.ts index 11c12d5ff..4c0fad0f9 100644 --- a/front-end/studio/src/app/app.module.ts +++ b/front-end/studio/src/app/app.module.ts @@ -94,38 +94,41 @@ import {AddPathDialogComponent} from './pages/apis/{apiId}/editor/_components/di import {AddResponseDialogComponent} from './pages/apis/{apiId}/editor/_components/dialogs/add-response.component'; import {AddFormDataParamDialogComponent} from './pages/apis/{apiId}/editor/_components/dialogs/add-formData-param.component'; import {AddDefinitionDialogComponent} from './pages/apis/{apiId}/editor/_components/dialogs/add-definition.component'; -import {Main20FormComponent, Main30FormComponent} from './pages/apis/{apiId}/editor/_components/forms/main-form.component'; +import { + Main20FormComponent, + Main30FormComponent +} from './pages/apis/{apiId}/editor/_components/forms/main-form.component'; import {AddMediaTypeDialogComponent} from './pages/apis/{apiId}/editor/_components/dialogs/add-media-type.component'; @NgModule({ - imports: [ - BrowserModule, FormsModule, HttpClientModule, AppRoutingModule, ModalModule.forRoot(), BsDropdownModule.forRoot(), - AceEditorModule - ], - declarations: [ - AppComponent, DashboardPageComponent, BreadcrumbsComponent, BreadcrumbComponent, PageErrorComponent, - VerticalNavComponent, NavHeaderComponent, ConfirmDeleteDialogComponent, CopyUrlDialogComponent, - TextAreaAutosize, DivAutoHeight, TextBoxAutosize, NotFoundPageComponent, SettingsNavComponent, - CreatedLinkedAccountPageComponent, LinkedAccountsPageComponent, ProfilePageComponent, SettingsPageComponent, - ApisPageComponent, CreateApiPageComponent, ImportApiPageComponent, ImportApiFormComponent, CreateApiFormComponent, - ApisListComponent, ApisCardsComponent, DropDownComponent, ActivityItemComponent, ApiCollaborationPageComponent, - ApiAcceptPageComponent, ApiDetailPageComponent, ValidationIconComponent, ServerUrlComponent, SearchComponent, - SchemaTypeComponent, ResponseItemComponent, PathItemComponent, InlineTextAreaComponent, InlineTextEditorComponent, - ContextHelpComponent, SetLicenseDialogComponent, SetContactDialogComponent, SecurityScheme30DialogComponent, - SecurityScheme20DialogComponent, EditorDisconnectedDialogComponent, ClonePathDialogComponent, CloneDefinitionDialogComponent, - AddTagDialogComponent, AddServerDialogComponent, AddSchemaPropertyDialogComponent, ResponseRow30Component, ResponseRowComponent, - ParamRowComponent, ContentComponent, PropertyRowComponent, ServersSectionComponent, ProblemFormComponent, PathFormComponent, - OperationFormComponent, Operation30FormComponent, DefinitionItemComponent, DefinitionFormComponent, EditorMasterComponent, - ApiEditorPageComponent, ApiEditorComponent, AddQueryParamDialogComponent, AddPathDialogComponent, AddResponseDialogComponent, - AddFormDataParamDialogComponent, AddDefinitionDialogComponent, AddMediaTypeDialogComponent, Main20FormComponent, - Main30FormComponent - ], - providers: [ - ApisServiceProvider, LinkedAccountsServiceProvider, AuthenticationServiceProvider, ConfigService, - AuthenticationCanActivateGuard - ], - bootstrap: [AppComponent] + imports: [ + BrowserModule, FormsModule, HttpClientModule, AppRoutingModule, ModalModule.forRoot(), BsDropdownModule.forRoot(), + AceEditorModule + ], + declarations: [ + AppComponent, DashboardPageComponent, BreadcrumbsComponent, BreadcrumbComponent, PageErrorComponent, + VerticalNavComponent, NavHeaderComponent, ConfirmDeleteDialogComponent, CopyUrlDialogComponent, + TextAreaAutosize, DivAutoHeight, TextBoxAutosize, NotFoundPageComponent, SettingsNavComponent, + CreatedLinkedAccountPageComponent, LinkedAccountsPageComponent, ProfilePageComponent, SettingsPageComponent, + ApisPageComponent, CreateApiPageComponent, ImportApiPageComponent, ImportApiFormComponent, CreateApiFormComponent, + ApisListComponent, ApisCardsComponent, DropDownComponent, ActivityItemComponent, ApiCollaborationPageComponent, + ApiAcceptPageComponent, ApiDetailPageComponent, ValidationIconComponent, ServerUrlComponent, SearchComponent, + SchemaTypeComponent, ResponseItemComponent, PathItemComponent, InlineTextAreaComponent, InlineTextEditorComponent, + ContextHelpComponent, SetLicenseDialogComponent, SetContactDialogComponent, SecurityScheme30DialogComponent, + SecurityScheme20DialogComponent, EditorDisconnectedDialogComponent, ClonePathDialogComponent, CloneDefinitionDialogComponent, + AddTagDialogComponent, AddServerDialogComponent, AddSchemaPropertyDialogComponent, ResponseRow30Component, ResponseRowComponent, + ParamRowComponent, ContentComponent, PropertyRowComponent, ServersSectionComponent, ProblemFormComponent, PathFormComponent, + OperationFormComponent, Operation30FormComponent, DefinitionItemComponent, DefinitionFormComponent, EditorMasterComponent, + ApiEditorPageComponent, ApiEditorComponent, AddQueryParamDialogComponent, AddPathDialogComponent, AddResponseDialogComponent, + AddFormDataParamDialogComponent, AddDefinitionDialogComponent, AddMediaTypeDialogComponent, Main20FormComponent, + Main30FormComponent + ], + providers: [ + ApisServiceProvider, LinkedAccountsServiceProvider, AuthenticationServiceProvider, ConfigService, + AuthenticationCanActivateGuard + ], + bootstrap: [AppComponent] }) export class AppModule { } diff --git a/front-end/studio/src/index.html b/front-end/studio/src/index.html index 47cd66916..d42aa8726 100644 --- a/front-end/studio/src/index.html +++ b/front-end/studio/src/index.html @@ -1,28 +1,113 @@
- -