Skip to content

Commit

Permalink
feat(view): make it works for #123
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed May 14, 2020
1 parent 3c82e6f commit 0caf33a
Show file tree
Hide file tree
Showing 19 changed files with 28 additions and 24 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"@angular/router": "~9.0.3",
"@angular/service-worker": "~9.0.3",
"@ledge-framework/render": "^0.6.3",
"@ledge-framework/view": "^0.5.0",
"@ngx-pwa/local-storage": "^9.0.2",
"@ngx-starter-kit/ngx-utils": "^0.0.8",
"@ngx-translate/core": "^12.1.2",
Expand Down
2 changes: 2 additions & 0 deletions projects/ledge-view/src/lib/custom-material.module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { NgModule } from '@angular/core';
import { MatIconModule } from '@angular/material/icon';
import { MatSidenavModule } from '@angular/material/sidenav';

const modules = [
MatSidenavModule,
MatIconModule
];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { LedgeMarkdownRenderComponent } from './ledge-markdown-render.component';
import { SharedModule } from '../../shared.module';
import { RouterTestingModule } from '@angular/router/testing';

describe('MarkdownRenderComponent', () => {
Expand All @@ -10,7 +9,7 @@ describe('MarkdownRenderComponent', () => {

beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [SharedModule, RouterTestingModule],
imports: [RouterTestingModule],
declarations: [LedgeMarkdownRenderComponent],
}).compileComponents();
}));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import '~@angular/material/theming';
@import '../../../../styles/behavior';
@import '../../../../styles/color';
@import '../../../../../node_modules/@angular/material/theming';
@import '../../../../../src/styles/behavior';
@import '../../../../../src/styles/color';

.multiple-docs {
min-height: 600px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { BrowserTestingModule } from '@angular/platform-browser/testing';
import { LedgeRenderModule } from '@ledge-framework/render';

import { CustomMaterialModule } from '../../custom-material.module';
import { SharedModule } from '../../shared.module';
import { LedgeMultipleDocsComponent } from './ledge-multiple-docs.component';
import { CustomMaterialModule } from '../custom-material.module';

describe('LedgeMultipleDocsComponent', () => {
let component: LedgeMultipleDocsComponent;
Expand All @@ -16,7 +15,6 @@ describe('LedgeMultipleDocsComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
SharedModule,
RouterTestingModule,
LedgeRenderModule,
CustomMaterialModule,
Expand Down
8 changes: 5 additions & 3 deletions projects/ledge-view/src/lib/ledge-view.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import { LedgeRenderModule } from '@ledge-framework/render';
import { CustomMaterialModule } from './custom-material.module';
import { LedgeMultipleDocsComponent } from './ledge-multiple-docs/ledge-multiple-docs.component';
import { RouterModule } from '@angular/router';


@NgModule({
declarations: [LedgeMarkdownRenderComponent],
declarations: [LedgeMarkdownRenderComponent, LedgeMultipleDocsComponent],
imports: [
CommonModule,
FormsModule,
ReactiveFormsModule,
CustomMaterialModule,
VirtualScrollerModule,
BrowserAnimationsModule,
RouterModule,
LedgeRenderModule
],
exports: [LedgeMarkdownRenderComponent]
exports: [LedgeMarkdownRenderComponent, LedgeMultipleDocsComponent]
})
export class LedgeViewModule { }
2 changes: 2 additions & 0 deletions projects/ledge-view/src/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
* Public API Surface of ledge-view
*/

export * from './lib/ledge-multiple-docs/ledge-multiple-docs.component';
export * from './lib/ledge-markdown-render/ledge-markdown-render.component';
export * from './lib/ledge-view.module';
2 changes: 1 addition & 1 deletion src/app/presentation/case-study/case-study.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { MatDrawerContent } from '@angular/material/sidenav';
import { TranslateService } from '@ngx-translate/core';

import { cases } from './cases';
import { DocRoute } from '../../shared/components/ledge-multiple-docs/doc-route.model';
import { DocRoute } from '../../../../projects/ledge-view/src/lib/ledge-multiple-docs/doc-route.model';

@Component({
selector: 'app-case-study',
Expand Down
2 changes: 1 addition & 1 deletion src/app/presentation/case-study/cases.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DocRoute } from '../../shared/components/ledge-multiple-docs/doc-route.model';
import { DocRoute } from '../../../../projects/ledge-view/src/lib/ledge-multiple-docs/doc-route.model';

export type Cases = Array<DocRoute>;

Expand Down
2 changes: 1 addition & 1 deletion src/app/presentation/checklists/checklists.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ActivatedRoute } from '@angular/router';
import { Title } from '@angular/platform-browser';
import { MatDrawerContent } from '@angular/material/sidenav';

import { DocRoute } from '../../shared/components/ledge-multiple-docs/doc-route.model';
import { DocRoute } from '../../../../projects/ledge-view/src/lib/ledge-multiple-docs/doc-route.model';

export const lists: DocRoute[] = [
{ displayName: '新项目检查清单', source: 'new-project' },
Expand Down
2 changes: 1 addition & 1 deletion src/app/presentation/maturity/maturity.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Title } from '@angular/platform-browser';
import { MatDrawerContent } from '@angular/material/sidenav';
import { ActivatedRoute } from '@angular/router';

import { DocRoute } from '../../shared/components/ledge-multiple-docs/doc-route.model';
import { DocRoute } from '../../../../projects/ledge-view/src/lib/ledge-multiple-docs/doc-route.model';

export const lists: DocRoute[] = [
{ displayName: 'DevOps 成熟度模型', source: 'devops' },
Expand Down
2 changes: 1 addition & 1 deletion src/app/presentation/reporter/reporter.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { MatDrawerContent } from '@angular/material/sidenav';
import { DocRoute } from '../../shared/components/ledge-multiple-docs/doc-route.model';
import { DocRoute } from '../../../../projects/ledge-view/src/lib/ledge-multiple-docs/doc-route.model';
import { ActivatedRoute } from '@angular/router';
import { Cases } from '../case-study/cases';

Expand Down
2 changes: 1 addition & 1 deletion src/app/presentation/skill-tree/skill-tree.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component, OnInit, ViewChild } from '@angular/core';
import { Title } from '@angular/platform-browser';

import { MatDrawerContent } from '@angular/material/sidenav';
import { DocRoute } from '../../shared/components/ledge-multiple-docs/doc-route.model';
import { DocRoute } from '../../../../projects/ledge-view/src/lib/ledge-multiple-docs/doc-route.model';
import { ActivatedRoute } from '@angular/router';
import { Cases } from '../case-study/cases';

Expand Down
2 changes: 1 addition & 1 deletion src/app/presentation/solution/solution.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ActivatedRoute } from '@angular/router';
import { MatDrawerContent } from '@angular/material/sidenav';
import { solutions } from './solutions';
import { TranslateService } from '@ngx-translate/core';
import { DocRoute } from '../../shared/components/ledge-multiple-docs/doc-route.model';
import { DocRoute } from '../../../../projects/ledge-view/src/lib/ledge-multiple-docs/doc-route.model';

@Component({
selector: 'app-solution',
Expand Down
2 changes: 1 addition & 1 deletion src/app/presentation/solution/solutions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DocRoute } from '../../shared/components/ledge-multiple-docs/doc-route.model';
import { DocRoute } from '../../../../projects/ledge-view/src/lib/ledge-multiple-docs/doc-route.model';

export type Solutions = Array<DocRoute>;

Expand Down
10 changes: 5 additions & 5 deletions src/app/shared/shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ import { HttpClient, HttpClientModule } from '@angular/common/http';
import { NgModule, SecurityContext } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { LedgeRenderModule } from '@ledge-framework/render';
import { TranslateModule } from '@ngx-translate/core';
import { MarkdownModule, MarkedOptions } from 'ngx-markdown';
import { LedgeRenderModule } from '@ledge-framework/render';
import { LedgeViewModule } from '@ledge-framework/view';

import { CustomMaterialModule } from './custom-material.module';
import { LedgeMarkdownRenderComponent } from './components/ledge-markdown-render/ledge-markdown-render.component';
import { LedgeMultipleDocsComponent } from './components/ledge-multiple-docs/ledge-multiple-docs.component';

@NgModule({
imports: [
Expand All @@ -20,6 +19,7 @@ import { LedgeMultipleDocsComponent } from './components/ledge-multiple-docs/led
HttpClientModule,
CustomMaterialModule,
LedgeRenderModule,
LedgeViewModule,
TranslateModule,
MarkdownModule.forRoot({
sanitize: SecurityContext.NONE,
Expand All @@ -39,9 +39,9 @@ import { LedgeMultipleDocsComponent } from './components/ledge-multiple-docs/led
},
}),
],
declarations: [LedgeMarkdownRenderComponent, LedgeMultipleDocsComponent],
declarations: [],
providers: [],
exports: [LedgeMarkdownRenderComponent, LedgeMultipleDocsComponent],
exports: [LedgeViewModule],
entryComponents: [],
})
export class SharedModule {}

0 comments on commit 0caf33a

Please sign in to comment.