Skip to content

Commit 647534e

Browse files
committed
Updating starterkit with latest resources.
1 parent 1f6f2a5 commit 647534e

18 files changed

+789
-727
lines changed

angular.json

+3-5
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
"src/favicon.ico"
2323
],
2424
"styles": [
25-
"src/styles.scss",
26-
"node_modules/font-awesome/scss/font-awesome.scss"
25+
"src/styles.scss"
2726
],
2827
"scripts": []
2928
},
@@ -73,8 +72,7 @@
7372
"tsConfig": "src/tsconfig.spec.json",
7473
"scripts": [],
7574
"styles": [
76-
"src/styles.scss",
77-
"node_modules/font-awesome/scss/font-awesome.scss"
75+
"src/styles.scss"
7876
],
7977
"assets": [
8078
"src/assets",
@@ -132,4 +130,4 @@
132130
"prefix": "app"
133131
}
134132
}
135-
}
133+
}

package-lock.json

+676-652
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+22-22
Original file line numberDiff line numberDiff line change
@@ -12,44 +12,44 @@
1212
},
1313
"private": true,
1414
"dependencies": {
15-
"@angular/animations": "^6.1.1",
16-
"@angular/common": "^6.1.1",
17-
"@angular/compiler": "^6.1.1",
18-
"@angular/core": "^6.1.1",
19-
"@angular/forms": "^6.1.1",
20-
"@angular/http": "^6.1.1",
21-
"@angular/platform-browser": "^6.1.1",
22-
"@angular/platform-browser-dynamic": "^6.1.1",
23-
"@angular/router": "^6.1.1",
24-
"angular-formio": "^2.1.0",
15+
"@angular/animations": "^6.1.6",
16+
"@angular/common": "^6.1.6",
17+
"@angular/compiler": "^6.1.6",
18+
"@angular/core": "^6.1.6",
19+
"@angular/forms": "^6.1.6",
20+
"@angular/http": "^6.1.6",
21+
"@angular/platform-browser": "^6.1.6",
22+
"@angular/platform-browser-dynamic": "^6.1.6",
23+
"@angular/router": "^6.1.6",
24+
"angular-formio": "^3.1.1",
2525
"bootstrap": "^4.1.3",
2626
"bootswatch": "^4.1.3",
2727
"core-js": "^2.5.7",
2828
"font-awesome": "^4.7.0",
29-
"formiojs": "^3.1.3",
29+
"formiojs": "^3.4.5",
3030
"lodash": "^4.17.10",
31-
"rxjs": "^6.2.2",
31+
"rxjs": "^6.3.1",
3232
"zone.js": "^0.8.26"
3333
},
3434
"devDependencies": {
35-
"@angular-devkit/build-angular": "^0.7.2",
36-
"@angular/cli": "^6.1.2",
37-
"@angular/compiler-cli": "^6.1.1",
38-
"@angular/language-service": "^6.1.1",
35+
"@angular-devkit/build-angular": "^0.7.5",
36+
"@angular/cli": "^6.1.5",
37+
"@angular/compiler-cli": "^6.1.6",
38+
"@angular/language-service": "^6.1.6",
3939
"@types/jasmine": "^2.8.8",
4040
"@types/jasminewd2": "~2.0.2",
41-
"@types/node": "^10.5.6",
42-
"codelyzer": "^4.4.2",
43-
"jasmine-core": "^3.1.0",
41+
"@types/node": "^10.9.4",
42+
"codelyzer": "^4.4.4",
43+
"jasmine-core": "^3.2.1",
4444
"jasmine-spec-reporter": "^4.2.1",
4545
"karma": "^2.0.5",
4646
"karma-chrome-launcher": "^2.2.0",
4747
"karma-cli": "~1.0.1",
48-
"karma-coverage-istanbul-reporter": "^2.0.1",
48+
"karma-coverage-istanbul-reporter": "^2.0.3",
4949
"karma-jasmine": "^1.1.2",
50-
"karma-jasmine-html-reporter": "^1.2.0",
50+
"karma-jasmine-html-reporter": "^1.3.1",
5151
"protractor": "^5.4.0",
52-
"ts-node": "^7.0.0",
52+
"ts-node": "^7.0.1",
5353
"tslint": "^5.11.0",
5454
"typescript": "^2.9.2"
5555
}

src/app/app.component.sass

Whitespace-only changes.

src/app/app.component.scss

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

src/app/app.component.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
import { Component } from '@angular/core';
22
import { Router } from '@angular/router';
3+
import { FormioResources } from 'angular-formio/resource';
34
import { FormioAuthService } from 'angular-formio/auth';
45

56
@Component({
67
selector: 'app-root',
78
templateUrl: './app.component.html',
8-
styleUrls: ['./app.component.sass']
9+
styleUrls: ['./app.component.scss']
910
})
1011
export class AppComponent {
1112
title = 'app';
1213

13-
constructor(private auth: FormioAuthService, private router: Router) {
14+
constructor(
15+
private auth: FormioAuthService,
16+
private router: Router,
17+
public resources: FormioResources
18+
) {
1419
this.auth.onLogin.subscribe(() => {
1520
this.router.navigate(['/home']);
1621
});

src/app/app.module.ts

+17-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import { BrowserModule } from '@angular/platform-browser';
22
import { NgModule } from '@angular/core';
33
import { RouterModule } from '@angular/router';
44
import { FormioModule, FormioAppConfig } from 'angular-formio';
5-
import { FormioAuthService, FormioAuthConfig } from 'angular-formio/auth';
5+
import { FormManagerModule, FormManagerService, FormManagerConfig } from 'angular-formio/manager';
6+
import { FormioAuth, FormioAuthService, FormioAuthConfig } from 'angular-formio/auth';
67
import { FormioResources } from 'angular-formio/resource';
78
import { AuthConfig, AppConfig } from '../config';
89

@@ -11,9 +12,9 @@ import { HomeComponent } from './home/home.component';
1112
import { HeaderComponent } from './header/header.component';
1213
import { HeroComponent } from './hero/hero.component';
1314

14-
import { AuthModule } from './auth/auth.module';
1515
import { EventModule } from './event/event.module';
16-
import { UserModule } from './user/user.module';
16+
import { EmployeeModule } from './employee/employee.module';
17+
import { LoginComponent } from './auth/login.component';
1718

1819
@NgModule({
1920
declarations: [
@@ -37,21 +38,31 @@ import { UserModule } from './user/user.module';
3738
},
3839
{
3940
path: 'auth',
40-
loadChildren: () => AuthModule
41+
loadChildren: () => FormioAuth.forChild({
42+
login: LoginComponent
43+
})
44+
},
45+
{
46+
path: 'form',
47+
loadChildren: () => FormManagerModule.forChild()
4148
},
4249
{
4350
path: 'event',
4451
loadChildren: () => EventModule
4552
},
4653
{
47-
path: 'user',
48-
loadChildren: () => UserModule
54+
path: 'employee',
55+
loadChildren: () => EmployeeModule
4956
}
5057
])
5158
],
5259
providers: [
5360
FormioResources,
5461
FormioAuthService,
62+
FormManagerService,
63+
{provide: FormManagerConfig, useValue: {
64+
tag: 'common'
65+
}},
5566
{provide: FormioAuthConfig, useValue: AuthConfig},
5667
{provide: FormioAppConfig, useValue: AppConfig}
5768
],

src/app/auth/auth.module.ts

-14
This file was deleted.

src/app/auth/login.component.html

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<div class="alert alert-info">
2+
<p>You can use the following to login.</p>
3+
<ul>
4+
<li><strong>Email:</strong> [email protected]</li>
5+
<li><strong>Password:</strong> testing</li>
6+
</ul>
7+
</div>
8+
<formio [src]="service.loginForm" (submit)="service.onLoginSubmit($event)"></formio>

src/app/auth/login.component.ts

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { Component } from '@angular/core';
2+
import { FormioAuthLoginComponent } from 'angular-formio/auth';
3+
@Component({
4+
templateUrl: './login.component.html'
5+
})
6+
export class LoginComponent extends FormioAuthLoginComponent {}

src/app/user/user.module.ts renamed to src/app/employee/employee.module.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ import {
1818
providers: [
1919
FormioResourceService,
2020
{provide: FormioResourceConfig, useValue: {
21-
name: 'user',
22-
form: 'user'
21+
name: 'employee',
22+
form: 'employee'
2323
}}
2424
]
2525
})
26-
export class UserModule { }
26+
export class EmployeeModule { }

src/app/event/event-resource/event-resource.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<ul class="nav nav-tabs" style="margin-bottom: 20px;">
1+
<ul class="nav nav-tabs" style="margin-bottom: 10px;">
22
<li class="nav-item"><a class="nav-link" routerLink="../"><i class="fa fa-chevron-left"></i></a></li>
33
<li class="nav-item"><a class="nav-link" routerLink="view" routerLinkActive="active">View</a></li>
44
<li class="nav-item"><a class="nav-link" routerLink="participant" routerLinkActive="active">Participants</a></li>

src/app/event/participant/participant-create/participant-create.component.ts

-15
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ export class ParticipantCreateComponent extends FormioResourceCreateComponent im
2525
}
2626

2727
ngOnInit() {
28-
super.ngOnInit();
29-
3028
// Wait for the parent event to be loaded.
3129
this.service.resources['event'].resourceLoaded.then((event) => {
3230

@@ -38,19 +36,6 @@ export class ParticipantCreateComponent extends FormioResourceCreateComponent im
3836
const registerForm = FormioUtils.getComponent(form.components, 'registration', true);
3937
registerForm.src = this.service.formFormio.projectUrl + '/' + event.data.registrationForm;
4038
}
41-
42-
// Wait for the current user to be loaded.
43-
this.auth.userReady.then((user) => {
44-
45-
// Default the user data inside of the registration form.
46-
this.service.resource.data.registration = {data: user.data};
47-
48-
// Tell our form to re-render the submission.
49-
this.service.refresh.emit({
50-
property: 'submission',
51-
value: this.service.resource
52-
});
53-
});
5439
});
5540
});
5641
}

src/app/event/participant/participant.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { ParticipantCreateComponent } from './participant-create/participant-cre
2727
useValue: {
2828
name: 'participant',
2929
form: 'participant',
30-
parents: ['event']
30+
parents: ['event', {field: 'user', resource: 'currentUser'}]
3131
}
3232
}
3333
]

src/app/header/header.component.html

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
<li class="nav-item" routerLinkActive="active">
66
<a class="nav-link" routerLink="home"><i class="fa fa-home"></i></a>
77
</li>
8+
<li class="nav-item" routerLinkActive="form" *ngIf="auth.authenticated">
9+
<a class="nav-link" routerLink="form"><i class="fa fa-wpforms"></i> Forms</a>
10+
</li>
811
<li class="nav-item" routerLinkActive="user" *ngIf="auth.is.administrator">
9-
<a class="nav-link" routerLink="user">Users</a>
12+
<a class="nav-link" routerLink="employee"><i class="fa fa-users"></i> Employees</a>
1013
</li>
1114
<li class="nav-item" routerLinkActive="event" *ngIf="auth.authenticated">
12-
<a class="nav-link" routerLink="event">Events</a>
15+
<a class="nav-link" routerLink="event"><i class="fa fa-calendar"></i> Events</a>
1316
</li>
1417
</ul>
1518
<ul class="nav navbar-nav ml-auto">

src/app/header/header.component.sass

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.fa {font-size: 1.5em; color: #eee;}
1+

src/config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { FormioAppConfig } from 'angular-formio';
22
import { FormioAuthConfig } from 'angular-formio/auth';
33

44
export const AppConfig: FormioAppConfig = {
5-
appUrl: 'https://nnglnkqdvbdjltz.form.io',
5+
appUrl: 'https://example.form.io',
66
apiUrl: 'https://api.form.io',
77
icons: 'fontawesome'
88
};

src/styles.scss

+37-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,41 @@
1-
/*@import "~bootswatch/dist/yeti/_variables.scss";*/
1+
$white: #fff;
2+
$gray-100: #f8f9fa;
3+
$gray-200: #e9ecef;
4+
$gray-300: #dee2e6;
5+
$gray-400: #ced4da;
6+
$gray-500: #adb5bd;
7+
$gray-600: #868e96;
8+
$gray-700: #495057;
9+
$gray-800: #373a3c;
10+
$gray-900: #212529;
11+
$black: #000;
12+
13+
$blue: #2780E3;
14+
$indigo: #6610f2;
15+
$purple: #613d7c;
16+
$pink: #e83e8c;
17+
$red: #FF0039;
18+
$orange: #F2661F;
19+
$yellow: #BED32B;
20+
$green: #3FB618;
21+
$teal: #20c997;
22+
$cyan: #9954BB;
23+
$lightblue: lighten($blue, 20%);
24+
25+
$primary: $blue;
26+
$secondary: $orange;
27+
$success: $green;
28+
$info: $lightblue;
29+
$warning: $yellow;
30+
$danger: $red;
31+
$light: $gray-100;
32+
$dark: $gray-800;
33+
34+
@import "~bootswatch/dist/cosmo/_variables.scss";
235
@import "~bootstrap/scss/bootstrap.scss";
3-
/*@import "~bootswatch/dist/yeti/_bootswatch.scss";*/
36+
@import "~bootswatch/dist/cosmo/_bootswatch.scss";
37+
$fa-font-path: '../node_modules/font-awesome/fonts';
38+
@import '~font-awesome/scss/font-awesome';
439

540
.logo {
641
height: 1.9em;

0 commit comments

Comments
 (0)