contract signature ready
This commit is contained in:
@@ -1,44 +1,82 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { Routes, RouterModule } from '@angular/router';
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
import { DraftCardComponent, DraftListComponent, DraftNewComponent } from "./drafts.component";
|
import { DraftsCardComponent, DraftsListComponent, DraftsNewComponent } from "./drafts.component";
|
||||||
|
import { ContractsCardComponent, ContractsListComponent, ContractsNewComponent, ContractsSignatureComponent} from "./contracts.component";
|
||||||
|
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
data: {
|
|
||||||
title: 'Entities',
|
|
||||||
},
|
|
||||||
children: [
|
|
||||||
{ path: '', redirectTo: 'list', pathMatch: 'full' },
|
|
||||||
{
|
|
||||||
path: 'list',
|
|
||||||
component: DraftListComponent,
|
|
||||||
data: {
|
data: {
|
||||||
title: 'List',
|
title: 'Contracts',
|
||||||
},
|
},
|
||||||
},
|
children: [
|
||||||
{
|
{ path: '', redirectTo: 'list', pathMatch: 'full' },
|
||||||
path: 'new',
|
{
|
||||||
component: DraftNewComponent,
|
path: 'list',
|
||||||
data: {
|
component: ContractsListComponent,
|
||||||
title: 'New',
|
data: {
|
||||||
},
|
title: 'List',
|
||||||
},
|
},
|
||||||
{
|
},
|
||||||
path: ':id',
|
{
|
||||||
component: DraftCardComponent,
|
path: 'new',
|
||||||
data: {
|
component: ContractsNewComponent,
|
||||||
title: 'Card',
|
data: {
|
||||||
},
|
title: 'New',
|
||||||
},
|
},
|
||||||
],
|
},
|
||||||
},
|
{
|
||||||
|
path: 'signature/:id',
|
||||||
|
component: ContractsSignatureComponent,
|
||||||
|
data: {
|
||||||
|
title: 'New',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'drafts',
|
||||||
|
data: {
|
||||||
|
title: 'Drafts',
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{ path: '', redirectTo: 'list', pathMatch: 'full' },
|
||||||
|
{
|
||||||
|
path: 'list',
|
||||||
|
component: DraftsListComponent,
|
||||||
|
data: {
|
||||||
|
title: 'List',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'new',
|
||||||
|
component: DraftsNewComponent,
|
||||||
|
data: {
|
||||||
|
title: 'New',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: ':id',
|
||||||
|
component: DraftsCardComponent,
|
||||||
|
data: {
|
||||||
|
title: 'Card',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: ':id',
|
||||||
|
component: ContractsCardComponent,
|
||||||
|
data: {
|
||||||
|
title: 'Card',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [RouterModule.forChild(routes)],
|
imports: [RouterModule.forChild(routes)],
|
||||||
exports: [RouterModule]
|
exports: [RouterModule]
|
||||||
})
|
})
|
||||||
export class ContractsRoutingModule {}
|
export class ContractsRoutingModule {}
|
||||||
|
|||||||
55
front/app/src/app/views/contracts/contracts.component.ts
Normal file
55
front/app/src/app/views/contracts/contracts.component.ts
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
import { Component, Input } from '@angular/core';
|
||||||
|
import { NgbAccordionModule } from "@ng-bootstrap/ng-bootstrap";
|
||||||
|
|
||||||
|
|
||||||
|
export class BaseContractsComponent {
|
||||||
|
protected resource: string = "contract/draft";
|
||||||
|
protected schema: string = "ContractDraft";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
templateUrl: '../base-view/templates/list.template.html'
|
||||||
|
})
|
||||||
|
export class ContractsListComponent extends BaseContractsComponent {
|
||||||
|
columns = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
templateUrl: '../base-view/templates/new.template.html'
|
||||||
|
})
|
||||||
|
export class ContractsNewComponent extends BaseContractsComponent {
|
||||||
|
@Input() value: {} = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
templateUrl: '../base-view/templates/card.template.html'
|
||||||
|
})
|
||||||
|
export class ContractsCardComponent extends BaseContractsComponent{
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
template: `
|
||||||
|
<ngb-accordion #acc="ngbAccordion" activeIds="ngb-panel-0">
|
||||||
|
<ngb-panel>
|
||||||
|
<ng-template ngbPanelTitle>
|
||||||
|
<span>Preview</span>
|
||||||
|
</ng-template>
|
||||||
|
<ng-template ngbPanelContent class="overflow-hidden">
|
||||||
|
<iframe width="100%"
|
||||||
|
src="/api/v1/contract/print/"
|
||||||
|
onload='javascript:(function(o){o.style.height=o.contentWindow.document.body.scrollHeight+"px";o.style.width=o.contentWindow.document.body.scrollWidth+"px";}(this));' style="height:200px;width:100%;border:none;overflow:hidden;"></iframe>
|
||||||
|
</ng-template>
|
||||||
|
</ngb-panel>
|
||||||
|
<ngb-panel>
|
||||||
|
<ng-template ngbPanelTitle>
|
||||||
|
<span>Signature</span>
|
||||||
|
</ng-template>
|
||||||
|
<ng-template ngbPanelContent>
|
||||||
|
|
||||||
|
</ng-template>
|
||||||
|
</ngb-panel>
|
||||||
|
</ngb-accordion>
|
||||||
|
`
|
||||||
|
})
|
||||||
|
export class ContractsSignatureComponent {
|
||||||
|
}
|
||||||
@@ -3,18 +3,22 @@ import { NgModule } from '@angular/core';
|
|||||||
|
|
||||||
import { BaseViewModule } from "../base-view/base-view.module";
|
import { BaseViewModule } from "../base-view/base-view.module";
|
||||||
import { ContractsRoutingModule } from './contracts-routing.module';
|
import { ContractsRoutingModule } from './contracts-routing.module';
|
||||||
import { DraftCardComponent, DraftListComponent, DraftNewComponent, DraftNewFormComponent } from "./drafts.component";
|
import { DraftsCardComponent, DraftsListComponent, DraftsNewComponent, DraftsNewFormComponent } from "./drafts.component";
|
||||||
import { FormlyModule } from "@ngx-formly/core";
|
import { FormlyModule } from "@ngx-formly/core";
|
||||||
import { FormlyBootstrapModule } from "@ngx-formly/bootstrap";
|
import { FormlyBootstrapModule } from "@ngx-formly/bootstrap";
|
||||||
import { ForeignkeyTypeComponent } from "@common/crud/types/foreignkey.type";
|
import { ForeignkeyTypeComponent } from "@common/crud/types/foreignkey.type";
|
||||||
import { CrudService } from "@common/crud/crud.service";
|
import { CrudService } from "@common/crud/crud.service";
|
||||||
|
|
||||||
|
import { ContractsCardComponent, ContractsListComponent, ContractsNewComponent, ContractsSignatureComponent } from "../contracts/contracts.component";
|
||||||
|
import {NgbAccordionModule} from "@ng-bootstrap/ng-bootstrap";
|
||||||
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
BaseViewModule,
|
BaseViewModule,
|
||||||
ContractsRoutingModule,
|
ContractsRoutingModule,
|
||||||
|
NgbAccordionModule,
|
||||||
FormlyModule.forRoot({
|
FormlyModule.forRoot({
|
||||||
types: [
|
types: [
|
||||||
{ name: 'foreign-key', component: ForeignkeyTypeComponent }
|
{ name: 'foreign-key', component: ForeignkeyTypeComponent }
|
||||||
@@ -23,10 +27,14 @@ import { CrudService } from "@common/crud/crud.service";
|
|||||||
FormlyBootstrapModule,
|
FormlyBootstrapModule,
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
DraftListComponent,
|
DraftsListComponent,
|
||||||
DraftNewComponent,
|
DraftsNewComponent,
|
||||||
DraftCardComponent,
|
DraftsCardComponent,
|
||||||
DraftNewFormComponent
|
DraftsNewFormComponent,
|
||||||
|
ContractsListComponent,
|
||||||
|
ContractsNewComponent,
|
||||||
|
ContractsCardComponent,
|
||||||
|
ContractsSignatureComponent
|
||||||
],
|
],
|
||||||
providers: [CrudService]
|
providers: [CrudService]
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { CrudFormlyJsonschemaService } from "@common/crud/crud-formly-jsonschema
|
|||||||
import { CrudService } from "@common/crud/crud.service";
|
import { CrudService } from "@common/crud/crud.service";
|
||||||
|
|
||||||
|
|
||||||
export class BaseEntitiesComponent {
|
export class BaseDraftsComponent {
|
||||||
protected resource: string = "contract/draft";
|
protected resource: string = "contract/draft";
|
||||||
protected schema: string = "ContractDraft";
|
protected schema: string = "ContractDraft";
|
||||||
}
|
}
|
||||||
@@ -13,7 +13,7 @@ export class BaseEntitiesComponent {
|
|||||||
@Component({
|
@Component({
|
||||||
templateUrl: '../base-view/templates/list.template.html'
|
templateUrl: '../base-view/templates/list.template.html'
|
||||||
})
|
})
|
||||||
export class DraftListComponent extends BaseEntitiesComponent {
|
export class DraftsListComponent extends BaseDraftsComponent {
|
||||||
columns = [];
|
columns = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ export class DraftListComponent extends BaseEntitiesComponent {
|
|||||||
selector: 'draft-new-form',
|
selector: 'draft-new-form',
|
||||||
template: `<base-new [resource]="this.resource" [schema]="this.schema" [model]="this.value"></base-new>`
|
template: `<base-new [resource]="this.resource" [schema]="this.schema" [model]="this.value"></base-new>`
|
||||||
})
|
})
|
||||||
export class DraftNewFormComponent extends BaseEntitiesComponent {
|
export class DraftsNewFormComponent extends BaseDraftsComponent {
|
||||||
@Input() value: {} = {};
|
@Input() value: {} = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ export class DraftNewFormComponent extends BaseEntitiesComponent {
|
|||||||
<draft-new-form [value]="this.templateModel"></draft-new-form>
|
<draft-new-form [value]="this.templateModel"></draft-new-form>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
export class DraftNewComponent extends BaseEntitiesComponent implements OnInit {
|
export class DraftsNewComponent extends BaseDraftsComponent implements OnInit {
|
||||||
templateModel: {} = {};
|
templateModel: {} = {};
|
||||||
temaplateFormfields: FormlyFieldConfig[] = [];
|
temaplateFormfields: FormlyFieldConfig[] = [];
|
||||||
temaplateForm: FormGroup = new FormGroup({});
|
temaplateForm: FormGroup = new FormGroup({});
|
||||||
@@ -88,5 +88,5 @@ export class DraftNewComponent extends BaseEntitiesComponent implements OnInit {
|
|||||||
@Component({
|
@Component({
|
||||||
templateUrl: '../base-view/templates/card.template.html'
|
templateUrl: '../base-view/templates/card.template.html'
|
||||||
})
|
})
|
||||||
export class DraftCardComponent extends BaseEntitiesComponent{
|
export class DraftsCardComponent extends BaseDraftsComponent {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import { CommonModule } from '@angular/common';
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
|
|
||||||
import { EntitiesRoutingModule } from './entities-routing.module';
|
import { EntitiesRoutingModule } from './entities-routing.module';
|
||||||
import { EntityCardComponent, EntityListComponent, EntityNewComponent} from "./entities.component";
|
|
||||||
import { BaseViewModule } from "../base-view/base-view.module";
|
import { BaseViewModule } from "../base-view/base-view.module";
|
||||||
|
import { EntityCardComponent, EntityListComponent, EntityNewComponent} from "./entities.component";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user