Skip to content

Commit

Permalink
Adding some new tools and enhancements from project work
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsully83 committed Feb 21, 2019
1 parent ad693d2 commit af15015
Show file tree
Hide file tree
Showing 40 changed files with 797 additions and 178 deletions.
61 changes: 35 additions & 26 deletions .angular-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,47 @@
"project": {
"name": "platform-extension-starter"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": ["assets", "favicon.ico", "static"],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "platform",
"styles": ["styles.scss"],
"stylePreprocessorOptions": {
"includePaths": ["../node_modules/hint.css/src", "../node_modules/novo-elements"]
},
"scripts": ["../node_modules/post-robot/dist/post-robot.min.js"],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts",
"staging": "environments/environment.staging.ts"
}
"apps": [{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico",
"static"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "platform",
"styles": [
"styles.scss"
],
"stylePreprocessorOptions": {
"includePaths": [
"../node_modules/hint.css/src",
"../node_modules/novo-elements"
]
},
"scripts": [
"../node_modules/post-robot/dist/post-robot.min.js"
],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts",
"staging": "environments/environment.staging.ts",
"local": "environments/environment.local.ts"
}
],
}],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"lint": [{
"project": "src/tsconfig.app.json"
},
{
Expand Down
12 changes: 12 additions & 0 deletions extension-starter-test.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/dist" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
15 changes: 5 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,14 @@
"scripts": {
"ng": "ng",
"start": "ng serve",
"start:aot": "ng serve --aot",
"start:local": "ng serve --env=local",
"build": "ng build --aot --prod",
"build:staging": "ng build --aot --env=staging",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"precommit": "lint-staged"
"e2e": "ng e2e"
},
"private": true,
"lint-staged": {
"*.ts": [
"tslint"
]
},
"dependencies": {
"@angular/animations": "5.2.0",
"@angular/common": "5.2.0",
Expand All @@ -31,12 +25,13 @@
"@angular/router": "5.2.0",
"core-js": "^2.4.1",
"hint.css": "^2.5.0",
"novo-elements": "2.17.0",
"novo-elements": "2.13.0",
"sha.js": "2.4.11",
"rxjs": "5.5.6",
"zone.js": "0.8.19"
},
"devDependencies": {
"@angular/cli": "1.7.4",
"@angular/cli": "1.6.5",
"@angular/compiler-cli": "^5.2.0",
"@angular/language-service": "^5.2.0",
"@types/jasmine": "~2.8.3",
Expand Down
1 change: 0 additions & 1 deletion src/app/app.component.html

This file was deleted.

10 changes: 6 additions & 4 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// NG
// NG2
import { Component } from '@angular/core';
// Vendor
// APP

@Component({
selector: 'platform-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
template: `
<router-outlet></router-outlet>
`
})
export class AppComponent {}
export class AppComponent {
}
24 changes: 8 additions & 16 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,28 @@ import { Routes, RouterModule } from '@angular/router';
import { NovoElementsModule } from 'novo-elements';
// APP
import { AppComponent } from './app.component';
import { AppBridgeService } from './service/app-bridge.service';
import {HttpClientModule} from '@angular/common/http';
import {AppBridgeService} from './tools/service/app-bridge.service';

const routes: Routes = [
{ path: '', redirectTo: 'sample', pathMatch: 'full' },
{ path: 'sample', loadChildren: './sample/sample.module#SampleModule' },
{ path: '', redirectTo: 'sample', pathMatch: 'full' }
];

@NgModule({
declarations: [
// Main Entry Component
AppComponent,
// Modals/Popovers
AppComponent
],
imports: [
// NG
BrowserModule,
RouterModule.forRoot(routes),
// Vendor
NovoElementsModule,
// APP
HttpClientModule,
NovoElementsModule
],
providers: [
AppBridgeService,
// Vendor Overrides
// APP
AppBridgeService
],
bootstrap: [
// Main Entry Component
AppComponent,
// Modals/Popovers
AppComponent
],
})
export class AppModule {}
14 changes: 0 additions & 14 deletions src/app/sample/sample.component.html

This file was deleted.

Empty file.
26 changes: 0 additions & 26 deletions src/app/sample/sample.component.spec.ts

This file was deleted.

33 changes: 0 additions & 33 deletions src/app/sample/sample.component.ts

This file was deleted.

34 changes: 0 additions & 34 deletions src/app/sample/sample.module.ts

This file was deleted.

24 changes: 24 additions & 0 deletions src/app/tools/modal/modal.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import {NovoElementProviders, NovoElementsModule} from 'novo-elements';

import {StandardModalComponent} from './standard/standard-modal.component';

@NgModule({
imports: [
CommonModule,
NovoElementsModule,
NovoElementProviders.forChild()
],
declarations: [
StandardModalComponent
],
entryComponents: [
StandardModalComponent
],
exports: [
StandardModalComponent
]
})
export class ModalModule { }
32 changes: 32 additions & 0 deletions src/app/tools/modal/modal.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import {NovoModalParams} from 'novo-elements';
import {ModalParams} from 'novo-elements/elements/modal/Modal';

export class StandardModalParams implements CustomModalParams {

public message: string;
public isConfirm: boolean = false;
public onClose: (result: boolean) => void = () => {};

constructor(message: string, isConfirm: boolean = false, onClose: (result: boolean) => void = () => {}) {
this.message = message;
this.isConfirm = isConfirm;
this.onClose = onClose;
}

static fromNovo(params: NovoModalParams): StandardModalParams {
return new StandardModalParams(
params['message'],
params['isConfirm'],
params['onClose']
);
}

}

export interface CustomModalParams extends ModalParams {

message: string;
isConfirm: boolean;
onClose: (result: boolean) => void;

}
6 changes: 6 additions & 0 deletions src/app/tools/modal/standard/standard-modal.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<novo-notification type="warning">
<h1>{{ modalParams.message }}</h1>
<button *ngIf="modalParams.isConfirm" theme="standard" (click)="close()">Cancel</button>
<button *ngIf="modalParams.isConfirm" theme="primary" icon="check" (click)="yes()">Yes</button>
<button *ngIf="!modalParams.isConfirm" theme="primary" icon="check" (click)="yes()">OK</button>
</novo-notification>
File renamed without changes.
25 changes: 25 additions & 0 deletions src/app/tools/modal/standard/standard-modal.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import {StandardModalComponent} from './standard-modal.component';

describe('StandardModalComponent', () => {
let component: StandardModalComponent;
let fixture: ComponentFixture<StandardModalComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ StandardModalComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(StandardModalComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Loading

0 comments on commit af15015

Please sign in to comment.