Skip to content

Commit

Permalink
Merge pull request #235 from Apicurio/front-end-ui-nxt
Browse files Browse the repository at this point in the history
Replaced the UI with a new @angular/cli based one
  • Loading branch information
EricWittmann authored Feb 21, 2018
2 parents 5f8b64d + c4c6f1b commit 0cf2ff5
Show file tree
Hide file tree
Showing 246 changed files with 28,743 additions and 10 deletions.
2 changes: 1 addition & 1 deletion front-end/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<packaging>pom</packaging>
<name>apicurio-studio-fe</name>
<modules>
<module>app</module>
<module>studio</module>
<module>servlet</module>
</modules>
</project>
2 changes: 1 addition & 1 deletion front-end/servlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>apicurio-studio-fe-app</artifactId>
<artifactId>apicurio-studio-fe-studio</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
Expand Down
37 changes: 37 additions & 0 deletions front-end/studio/.angular-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "studio"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"keycloak.json",
"keycloak.js",
"version.js",
"config.js"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"tsconfig": "tsconfig.app.json",
"prefix": "app",
"styles": [
"styles.css"
],
"scripts": [],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"defaults": {
"styleExt": "css",
"component": {}
}
}
47 changes: 47 additions & 0 deletions front-end/studio/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

/deploy-prod.sh
/serve.sh
/node

# compiled output
/dist
/dist-server
/tmp
/out-tsc

# dependencies
/node_modules

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
testem.log
/typings

# e2e
/e2e/*.js
/e2e/*.map

# System Files
.DS_Store
Thumbs.db
16 changes: 16 additions & 0 deletions front-end/studio/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Apicurio Studio

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.6.8.

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically
reload if you change any of the source files.

To run on a different port, try `ng serve --port 8888` for example. And if you want AOT enabled,
you can run `ng serve --aot --port 8888`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
Use the `-prod` flag for a production build.
43 changes: 43 additions & 0 deletions front-end/studio/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "apicurio-design-studio",
"version": "1.0.0",
"description": "A web application to help design restful APIs.",
"author": "Eric Wittmann",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/apicurio/apicurio-studio"
},
"scripts": {
"ng": "ng",
"start": "ng serve --port 8888 --aot",
"build": "ng build -prod"
},
"private": true,
"dependencies": {
"@angular/animations": "^5.2.0",
"@angular/common": "^5.2.0",
"@angular/compiler": "^5.2.0",
"@angular/core": "^5.2.0",
"@angular/forms": "^5.2.0",
"@angular/platform-browser": "^5.2.0",
"@angular/platform-browser-dynamic": "^5.2.0",
"@angular/router": "^5.2.0",
"oai-ts-core": "0.2.9",
"oai-ts-commands": "0.2.18",
"core-js": "^2.4.1",
"ngx-bootstrap": "2.0.2",
"ng2-ace-editor": "0.3.4",
"yamljs": "0.3.0",
"rxjs": "^5.5.6",
"zone.js": "^0.8.19"
},
"devDependencies": {
"@angular/cli": "1.6.8",
"@angular/compiler-cli": "^5.2.0",
"@angular/language-service": "^5.2.0",
"@types/node": "~6.0.60",
"ts-node": "~4.1.0",
"typescript": "~2.5.3"
}
}
84 changes: 84 additions & 0 deletions front-end/studio/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.apicurio</groupId>
<artifactId>apicurio-studio-fe</artifactId>
<version>0.2.3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>apicurio-studio-fe-studio</artifactId>
<packaging>jar</packaging>
<name>apicurio-studio-fe-studio</name>

<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<!-- Install Node and Yarn -->
<execution>
<id>install node and yarn</id>
<goals>
<goal>install-node-and-yarn</goal>
</goals>
<configuration>
<nodeVersion>v6.11.2</nodeVersion>
<yarnVersion>v1.3.2</yarnVersion>
</configuration>
</execution>
<!-- Install npm/yarn dependencies -->
<execution>
<id>yarn install</id>
<goals>
<goal>yarn</goal>
</goals>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<!-- Build the app -->
<execution>
<id>ng build</id>
<goals>
<goal>yarn</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>build</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-dist</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<resources>
<resource>
<directory>${basedir}/dist</directory>
<filtering>false</filtering>
<excludes>
<exclude>config.js</exclude>
<exclude>keycloak.js</exclude>
<exclude>keycloak.json</exclude>
<exclude>version.js</exclude>
</excludes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
3 changes: 3 additions & 0 deletions front-end/studio/src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
keycloak.*
config.js

108 changes: 108 additions & 0 deletions front-end/studio/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/**
* @license
* Copyright 2018 JBoss Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {DashboardPageComponent} from './pages/dashboard/dashboard.page';
import {AuthenticationCanActivateGuard} from './guards/auth.guard';
import {SettingsPageComponent} from './pages/settings/settings';
import {ProfilePageComponent} from './pages/settings/profile/profile.page';
import {LinkedAccountsPageComponent} from './pages/settings/accounts/accounts.page';
import {CreatedLinkedAccountPageComponent} from './pages/settings/accounts/{accountType}/created/created.page';
import {ApisPageComponent} from './pages/apis/apis.page';
import {CreateApiPageComponent} from './pages/apis/create/create.page';
import {ImportApiPageComponent} from './pages/apis/import/import.page';
import {ApiDetailPageComponent} from './pages/apis/{apiId}/api-detail.page';
import {ApiCollaborationPageComponent} from './pages/apis/{apiId}/collaboration/api-collaboration.page';
import {ApiAcceptPageComponent} from './pages/apis/{apiId}/collaboration/accept/api-accept.page';
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 ]
},
];


@NgModule({
imports: [
RouterModule.forRoot(routes)
],
exports: [
RouterModule
],
declarations: []
})
export class AppRoutingModule {
}
3 changes: 3 additions & 0 deletions front-end/studio/src/app/app.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.studio-component {
color: inherit;
}
7 changes: 7 additions & 0 deletions front-end/studio/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div>
<nav-header *ngIf="authService.isAuthenticated() | async"></nav-header>
<vertical-nav *ngIf="authService.isAuthenticated() | async"></vertical-nav>
<div id="{{ routerOutletWrapperId }}" class="{{ routerOutletWrapperClass }}">
<router-outlet></router-outlet>
</div>
</div>
Loading

0 comments on commit 0cf2ff5

Please sign in to comment.