Skip to content

Commit

Permalink
refactor(renaming): rename some modules
Browse files Browse the repository at this point in the history
  • Loading branch information
cbourget authored and mbarbeau committed Feb 20, 2019
1 parent 9f4d86d commit d214d32
Show file tree
Hide file tree
Showing 15 changed files with 78 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
<mat-card-content>
See the <a href="https://github.com/infra-geo-ouverte/igo2-lib/tree/master/demo/src/app/common/dynamic-component">code of this example</a>
</mat-card-content>

<igo-dynamic-outlet
[component]="component"
[inputs]="inputs">
</igo-dynamic-outlet>

<button mat-flat-button color="primary" (click)="toggleComponent()">Toggle Component</button>
</mat-card>

<igo-dynamic-outlet
[component]="component"
[inputs]="inputs">
</igo-dynamic-outlet>

<button mat-flat-button color="primary" (click)="toggleComponent()">Toggle Component</button>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NgModule } from '@angular/core';
import { MatButtonModule, MatCardModule } from '@angular/material';

import { IgoLibDynamicComponentModule } from '@igo2/common';
import { IgoDynamicComponentModule } from '@igo2/common';

import {
AppSalutationComponent,
Expand All @@ -20,7 +20,7 @@ import { AppDynamicComponentRoutingModule } from './dynamic-component-routing.mo
AppDynamicComponentRoutingModule,
MatButtonModule,
MatCardModule,
IgoLibDynamicComponentModule
IgoDynamicComponentModule
],
exports: [AppDynamicComponentComponent],
entryComponents: [
Expand Down
10 changes: 5 additions & 5 deletions demo/src/app/common/entity-table/entity-table.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<mat-card-content>
See the <a href="https://github.com/infra-geo-ouverte/igo2-lib/tree/master/demo/src/app/common/entity-table">code of this example</a>
</mat-card-content>
</mat-card>

<igo-entity-table
[store]="store"
[template]="template">
</igo-entity-table>
<igo-entity-table
[store]="store"
[template]="template">
</igo-entity-table>
</mat-card>
4 changes: 2 additions & 2 deletions demo/src/app/common/entity-table/entity-table.module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NgModule } from '@angular/core';
import { MatCardModule } from '@angular/material';

import { IgoLibEntityTableModule } from '@igo2/common';
import { IgoEntityTableModule } from '@igo2/common';

import { AppEntityTableComponent } from './entity-table.component';
import { AppEntityTableRoutingModule } from './entity-table-routing.module';
Expand All @@ -11,7 +11,7 @@ import { AppEntityTableRoutingModule } from './entity-table-routing.module';
imports: [
AppEntityTableRoutingModule,
MatCardModule,
IgoLibEntityTableModule
IgoEntityTableModule
],
exports: [AppEntityTableComponent]
})
Expand Down
55 changes: 31 additions & 24 deletions demo/src/app/common/form/form.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,37 @@
<mat-card-content>
See the <a href="https://github.com/infra-geo-ouverte/igo2-lib/tree/master/demo/src/app/common/form">code of this example</a>
</mat-card-content>
</mat-card>

<igo-form
*ngIf="form$ | async as form"
[form]="form"
[formData]="data$ | async"
(submitForm)="onSubmit($event)">
<igo-form
*ngIf="form$ | async as form"
[form]="form"
[formData]="data$ | async"
(submitForm)="onSubmit($event)">

<igo-form-group [group]="form.groups[0]"></igo-form-group>
<igo-form-group [group]="form.groups[0]"></igo-form-group>

<div formButtons>
<button
mat-button
type="button"
color="primary"
(click)="fillForm()">
Fill Form
</button>
<button
mat-flat-button
type="submit"
color="primary"
[disabled]="submitDisabled">
Submit
</button>
</div>
</igo-form>
<div formButtons>
<button
mat-stroked-button
type="button"
color="primary"
(click)="fillForm()">
Fill Form
</button>
<button
mat-stroked-button
type="button"
color="primary"
(click)="clearForm()">
Clear Form
</button>
<button
mat-flat-button
type="submit"
color="primary"
[disabled]="submitDisabled">
Submit
</button>
</div>
</igo-form>
</mat-card>
4 changes: 4 additions & 0 deletions demo/src/app/common/form/form.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ export class AppFormComponent implements OnInit, OnDestroy {
});
}

clearForm() {
this.form$.value.control.reset();
}

onSubmit(data: {[key: string]: any}) {
alert(JSON.stringify(data));
}
Expand Down
4 changes: 2 additions & 2 deletions demo/src/app/common/form/form.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MatButtonModule, MatCardModule } from '@angular/material';

import { IgoLibFormModule } from '@igo2/common';
import { IgoFormModule } from '@igo2/common';

import { AppFormComponent } from './form.component';
import { AppFormRoutingModule } from './form-routing.module';
Expand All @@ -14,7 +14,7 @@ import { AppFormRoutingModule } from './form-routing.module';
AppFormRoutingModule,
MatButtonModule,
MatCardModule,
IgoLibFormModule
IgoFormModule
],
exports: [AppFormComponent]
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { IgoLibDynamicOutletModule } from './dynamic-outlet/dynamic-outlet.module';
import { IgoDynamicOutletModule } from './dynamic-outlet/dynamic-outlet.module';
import { DynamicComponentService } from './shared/dynamic-component.service';

@NgModule({
imports: [
CommonModule,
IgoLibDynamicOutletModule
IgoDynamicOutletModule
],
exports: [
IgoLibDynamicOutletModule
IgoDynamicOutletModule
],
providers: [
DynamicComponentService
]
})
export class IgoLibDynamicComponentModule {}
export class IgoDynamicComponentModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ import { DynamicOutletComponent } from './dynamic-outlet.component';
DynamicOutletComponent
]
})
export class IgoLibDynamicOutletModule {}
export class IgoDynamicOutletModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ import { EntityTableComponent } from './entity-table.component';
EntityTableRowDirective
]
})
export class IgoLibEntityTableModule {}
export class IgoEntityTableModule {}
6 changes: 3 additions & 3 deletions projects/common/src/lib/entity/entity.module.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { IgoLibEntityTableModule } from './entity-table/entity-table.module';
import { IgoEntityTableModule } from './entity-table/entity-table.module';

@NgModule({
imports: [
CommonModule
],
exports: [
IgoLibEntityTableModule
IgoEntityTableModule
],
declarations: []
})
export class IgoLibEntityModule {}
export class IgoEntityModule {}
6 changes: 3 additions & 3 deletions projects/common/src/lib/form/form-field/form-field.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
MatSelectModule
} from '@angular/material';

import { IgoLibDynamicOutletModule } from '../../dynamic-component/dynamic-outlet/dynamic-outlet.module';
import { IgoDynamicOutletModule } from '../../dynamic-component/dynamic-outlet/dynamic-outlet.module';

import { FormFieldComponent } from './form-field.component';
import { FormFieldSelectComponent } from './form-field-select.component';
Expand All @@ -26,7 +26,7 @@ import { FormFieldTextComponent } from './form-field-text.component';
MatFormFieldModule,
MatInputModule,
MatSelectModule,
IgoLibDynamicOutletModule
IgoDynamicOutletModule
],
exports: [
FormFieldComponent,
Expand All @@ -39,4 +39,4 @@ import { FormFieldTextComponent } from './form-field-text.component';
FormFieldTextComponent
]
})
export class IgoLibFormFieldModule {}
export class IgoFormFieldModule {}
6 changes: 3 additions & 3 deletions projects/common/src/lib/form/form-group/form-group.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MatFormFieldModule } from '@angular/material';

import { IgoLibFormFieldModule } from '../form-field/form-field.module';
import { IgoFormFieldModule } from '../form-field/form-field.module';
import { FormGroupComponent } from './form-group.component';

/**
Expand All @@ -12,7 +12,7 @@ import { FormGroupComponent } from './form-group.component';
imports: [
CommonModule,
MatFormFieldModule,
IgoLibFormFieldModule
IgoFormFieldModule
],
exports: [
FormGroupComponent
Expand All @@ -21,4 +21,4 @@ import { FormGroupComponent } from './form-group.component';
FormGroupComponent
]
})
export class IgoLibFormGroupModule {}
export class IgoFormGroupModule {}
18 changes: 9 additions & 9 deletions projects/common/src/lib/form/form.module.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { IgoLibFormFormModule } from './form/form.module';
import { IgoLibFormGroupModule } from './form-group/form-group.module';
import { IgoLibFormFieldModule } from './form-field/form-field.module';
import { IgoFormFormModule } from './form/form.module';
import { IgoFormGroupModule } from './form-group/form-group.module';
import { IgoFormFieldModule } from './form-field/form-field.module';
import { FormFieldSelectComponent } from './form-field/form-field-select.component';
import { FormFieldTextComponent } from './form-field/form-field-text.component';
import { FormService } from './shared/form.service';
Expand All @@ -15,13 +15,13 @@ import { FormFieldService } from './shared/form-field.service';
@NgModule({
imports: [
CommonModule,
IgoLibFormGroupModule,
IgoLibFormFieldModule
IgoFormGroupModule,
IgoFormFieldModule
],
exports: [
IgoLibFormFormModule,
IgoLibFormGroupModule,
IgoLibFormFieldModule
IgoFormFormModule,
IgoFormGroupModule,
IgoFormFieldModule
],
declarations: [],
providers: [
Expand All @@ -33,4 +33,4 @@ import { FormFieldService } from './shared/form-field.service';
FormFieldTextComponent
]
})
export class IgoLibFormModule {}
export class IgoFormModule {}
2 changes: 1 addition & 1 deletion projects/common/src/lib/form/form/form.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ import { FormComponent } from './form.component';
FormComponent
]
})
export class IgoLibFormFormModule {}
export class IgoFormFormModule {}

0 comments on commit d214d32

Please sign in to comment.