Skip to content

Commit ce6c6bc

Browse files
committed
$'syncing commit from monorepo. PR: 467, Title: FIO-10191: Added support for standalone components'
1 parent 865f42d commit ce6c6bc

25 files changed

Lines changed: 166 additions & 130 deletions
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component } from '@angular/core';
22
import { RouterLinkActive, RouterLink, RouterOutlet } from '@angular/router';
33
@Component({
4-
templateUrl: './auth.component.html',
5-
imports: [RouterLinkActive, RouterLink, RouterOutlet]
4+
templateUrl: './auth.component.html',
5+
imports: [RouterLinkActive, RouterLink, RouterOutlet]
66
})
77
export class FormioAuthComponent {}

projects/angular-formio/auth/src/auth.module.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ import { FormioAuthRoutes } from './auth.routes';
1111
import { extendRouter } from '@formio/angular';
1212

1313
@NgModule({
14-
imports: [
15-
CommonModule,
16-
FormioModule,
17-
RouterModule,
18-
FormioAuthComponent,
19-
FormioAuthLoginComponent,
20-
FormioAuthRegisterComponent,
21-
FormioResetPassComponent
22-
]
14+
imports: [
15+
CommonModule,
16+
FormioModule,
17+
RouterModule,
18+
FormioAuthComponent,
19+
FormioAuthLoginComponent,
20+
FormioAuthRegisterComponent,
21+
FormioResetPassComponent
22+
]
2323
})
2424
export class FormioAuth {
2525
static forRoot(config?: FormioAuthRouteConfig): any {

projects/angular-formio/auth/src/login/login.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { Component } from '@angular/core';
22
import { FormioAuthService } from '../auth.service';
33
import { FormioComponent } from '@formio/angular';
44
@Component({
5-
templateUrl: './login.component.html',
6-
imports: [FormioComponent]
5+
templateUrl: './login.component.html',
6+
imports: [FormioComponent]
77
})
88
export class FormioAuthLoginComponent {
99
public renderOptions: any = {

projects/angular-formio/auth/src/register/register.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { Component } from '@angular/core';
22
import { FormioAuthService } from '../auth.service';
33
import { FormioComponent } from '@formio/angular';
44
@Component({
5-
templateUrl: './register.component.html',
6-
imports: [FormioComponent]
5+
templateUrl: './register.component.html',
6+
imports: [FormioComponent]
77
})
88
export class FormioAuthRegisterComponent {
99
public renderOptions: any = {

projects/angular-formio/auth/src/resetpass/resetpass.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { Component } from '@angular/core';
22
import { FormioAuthService } from '../auth.service';
33
import { FormioComponent } from '@formio/angular';
44
@Component({
5-
templateUrl: './resetpass.component.html',
6-
imports: [FormioComponent]
5+
templateUrl: './resetpass.component.html',
6+
imports: [FormioComponent]
77
})
88
export class FormioResetPassComponent {
99
constructor(public service: FormioAuthService) {}

projects/angular-formio/embed/src/builder.component.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import {Component, ElementRef, Input, ViewChild, Output, EventEmitter, AfterViewInit, OnDestroy} from '@angular/core';
1+
import { Component, ElementRef, Input, ViewChild, Output, EventEmitter, AfterViewInit } from '@angular/core';
22
import {Form, FormBuilder, Webform} from '@formio/js';
33
import WebformBuilder from '@formio/js/lib/cjs/WebformBuilder';
44

55
@Component({
66
selector: 'formio-builder',
77
template: '<div #formio></div>'
88
})
9-
export class FormioBuilder implements AfterViewInit, OnDestroy {
9+
export class FormioBuilder implements AfterViewInit {
1010
@ViewChild('formio') element: ElementRef;
1111
@Input() form?: Form['options'] | null;
1212
@Input() options?: FormBuilder['options'] = {};
@@ -65,8 +65,4 @@ export class FormioBuilder implements AfterViewInit, OnDestroy {
6565
this.ready.emit(this.instance);
6666
}).catch((err) => this.error.emit(err));
6767
}
68-
69-
ngOnDestroy(): void {
70-
this.instance.destroy(true);
71-
}
7268
}

projects/angular-formio/embed/src/embed.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ import { FormioAppService } from "./app.service";
1818
FormioAppService
1919
]
2020
})
21-
export class FormioEmbedModule {}
21+
export class FormioEmbedModule {}

projects/angular-formio/grid/src/GridBodyComponent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class GridBodyComponent {
5555
this.skip = 0;
5656
this.loading = false;
5757
this.service.setRows(this.rows);
58-
58+
5959
return this.rows;
6060
}
6161

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,34 @@
11
<ng-template>
2-
<tbody *ngIf="rows">
3-
<tr *ngFor="let form of rows">
4-
<td>
5-
<div class="row">
6-
<div class="col-sm-9">
7-
<a routerLink="{{form._id}}/view" (click)="onRowSelect($event, form)" class="text-decoration-none"><h5>{{ form.title }}</h5></a>
8-
<div class="form-updated small text-muted">
9-
Updated {{ form.modified | timeSince }} ago
2+
@if (rows) {
3+
<tbody>
4+
@for (form of rows; track form._id) {
5+
<tr>
6+
<td>
7+
<div class="row">
8+
<div class="col-sm-9">
9+
<a routerLink="{{form._id}}/view" (click)="onRowSelect($event, form)" class="text-decoration-none"><h5>{{ form.title }}</h5></a>
10+
<div class="form-updated small text-muted">
11+
Updated {{ form.modified | timeSince }} ago
12+
</div>
13+
</div>
14+
<div class="col-sm-3 d-flex justify-content-end align-items-center">
15+
@if (actionAllowed('formView')) {
16+
<button #create class="btn btn-outline-secondary btn-sm form-btn form-btn-use" (click)="onRowAction($event, form, 'view')"><span class="fa fa-pencil bi bi-pencil"></span></button>&nbsp;
17+
}
18+
@if (actionAllowed('formSubmission')) {
19+
<button #view class="btn btn-outline-secondary btn-sm form-btn" (click)="onRowAction($event, form, 'submission')"><span class="fa fa-list-alt bi bi-table"></span></button>&nbsp;
20+
}
21+
@if (actionAllowed('formEdit')) {
22+
<button #edit class="btn btn-outline-secondary btn-sm form-btn" (click)="onRowAction($event, form, 'edit')"><span class="fa fa-edit bi bi-pencil-square"></span></button>&nbsp;
23+
}
24+
@if (actionAllowed('formDelete')) {
25+
<button #delete class="btn btn-secondary btn-sm form-btn form-btn-delete" (click)="onRowAction($event, form, 'delete')" title="Delete form"><span class="fa fa-trash bi bi-trash"></span></button>
26+
}
27+
</div>
1028
</div>
11-
</div>
12-
<div class="col-sm-3 d-flex justify-content-end align-items-center">
13-
<button #create *ngIf="actionAllowed('formView')" class="btn btn-outline-secondary btn-sm form-btn form-btn-use" (click)="onRowAction($event, form, 'view')"><span class="fa fa-pencil bi bi-pencil"></span></button>&nbsp;
14-
<button #view *ngIf="actionAllowed('formSubmission')" class="btn btn-outline-secondary btn-sm form-btn" (click)="onRowAction($event, form, 'submission')"><span class="fa fa-list-alt bi bi-table"></span></button>&nbsp;
15-
<button #edit *ngIf="actionAllowed('formEdit')" class="btn btn-outline-secondary btn-sm form-btn" (click)="onRowAction($event, form, 'edit')"><span class="fa fa-edit bi bi-pencil-square"></span></button>&nbsp;
16-
<button #delete *ngIf="actionAllowed('formDelete')" class="btn btn-secondary btn-sm form-btn form-btn-delete" (click)="onRowAction($event, form, 'delete')" title="Delete form"><span class="fa fa-trash bi bi-trash"></span></button>
17-
</div>
18-
</div>
19-
</td>
20-
</tr>
21-
</tbody>
29+
</td>
30+
</tr>
31+
}
32+
</tbody>
33+
}
2234
</ng-template>

projects/angular-formio/grid/src/form/FormGridBody.component.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ import { Component, ElementRef, OnDestroy, ViewChild, ViewChildren } from '@angu
22
import { GridBodyComponent } from '../GridBodyComponent';
33
import { FormioPromiseService } from '@formio/angular';
44
import { Tooltip } from 'bootstrap';
5-
import { NgIf, NgFor } from '@angular/common';
65
import { RouterLink } from '@angular/router';
76
import { TimeSince } from './time-since.pipe';
87
@Component({
9-
selector: 'form-grid-body',
10-
styleUrls: ['./FormGridBody.component.scss'],
11-
templateUrl: './FormGridBody.component.html',
12-
imports: [NgIf, NgFor, RouterLink, TimeSince]
8+
selector: 'form-grid-body',
9+
styleUrls: ['./FormGridBody.component.scss'],
10+
templateUrl: './FormGridBody.component.html',
11+
imports: [RouterLink, TimeSince]
1312
})
1413
export class FormGridBodyComponent extends GridBodyComponent implements OnDestroy {
1514
@ViewChildren('create') createBtns: ElementRef[];

0 commit comments

Comments
 (0)