Skip to content

Commit

Permalink
Merge pull request #389 from NickPhura/ACRFD-14
Browse files Browse the repository at this point in the history
ACRFD-14: project list page + tests, update search component + tests.
  • Loading branch information
NickPhura authored Sep 13, 2019
2 parents bc49c13 + f0d5b57 commit 495fcaa
Show file tree
Hide file tree
Showing 67 changed files with 4,072 additions and 1,996 deletions.
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# See https://git-scm.com/docs/gitignore for more about ignoring files.

# compiled output
/dist
/tmp
/out-tsc

# dependencies
/node_modules
node_modules

# IDEs and editors
/.idea
Expand All @@ -19,10 +19,7 @@

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
/.sass-cache
Expand Down
6 changes: 3 additions & 3 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"root": "",
"sourceRoot": "src",
"projectType": "application",
"targets": {
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
Expand Down Expand Up @@ -107,7 +107,7 @@
"root": "e2e",
"sourceRoot": "e2e",
"projectType": "application",
"targets": {
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
Expand Down Expand Up @@ -137,4 +137,4 @@
"prefix": "app"
}
}
}
}
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"start": "ng serve -o --base-href /admin/ --deploy-url /admin/",
"build": "npm run lint && ng build --prod --deploy-url /admin/ --base-href /admin/",
"postinstall": "ng build --prod --deploy-url /admin/ --base-href /admin/",
"test": "echo Test suite should be run with `npm run tests` or npm `run tests-ci`",
"test": "echo Test suite should be run with `npm run tests` or `npm run tests-ci`",
"tests": "ng test",
"tests-ci": "ng test --watch=false",
"e2e": "ng e2e",
Expand Down Expand Up @@ -38,7 +38,9 @@
"@types/leaflet": "1.4.4",
"bootstrap": "4.3.1",
"core-js": "2.6.8",
"file-saver": "2.0.2",
"hammerjs": "2.0.8",
"json2csv": "4.5.1",
"keycloak-angular": "3.0.3",
"leaflet": "1.5.1",
"linkify-it": "2.1.0",
Expand All @@ -59,8 +61,10 @@
"@angular/cli": "6.2.9",
"@angular/compiler": "6.1.10",
"@angular/compiler-cli": "6.1.10",
"@types/arcgis-js-api": "4.12.0",
"@types/arcgis-js-api": "4.11.0",
"@types/file-saver": "2.0.1",
"@types/jasmine": "3.3.13",
"@types/json2csv": "4.5.0",
"@types/linkify-it": "2.1.0",
"@types/lodash": "4.14.136",
"@types/node": "10.14.7",
Expand All @@ -84,5 +88,5 @@
"tslint": "5.18.0",
"tslint-config-prettier": "1.18.0",
"typescript": "2.9.2"
}
}
}
5 changes: 5 additions & 0 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { AdministrationComponent } from './administration/administration.compone
import { UsersComponent } from './administration/users/users.component';

import { CanDeactivateGuard } from 'app/services/can-deactivate-guard.service';
import { ListComponent } from './list/list.component';

const routes: Routes = [
{
Expand All @@ -26,6 +27,10 @@ const routes: Routes = [
path: 'not-authorized',
component: NotAuthorizedComponent
},
{
path: 'list',
component: ListComponent
},
{
path: 'search',
component: SearchComponent
Expand Down
7 changes: 6 additions & 1 deletion src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ app-header {
@include flex-direction(column);

position: relative;
margin-top: 68px;
overflow-y: auto;
}

@media (min-width: 768px) {
.app-body {
margin-top: 68px; // pad the top of the page so content isn't covered by the floating header bar.
}
}
4 changes: 3 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { AppRoutingModule } from 'app/app-routing.module';
import { AppComponent } from 'app/app.component';
import { HomeComponent } from 'app/home/home.component';
import { SearchComponent } from 'app/search/search.component';
import { ListComponent } from 'app/list/list.component';
import { LoginComponent } from 'app/login/login.component';
import { ConfirmComponent } from 'app/confirm/confirm.component';
import { HeaderComponent } from 'app/header/header.component';
Expand Down Expand Up @@ -57,7 +58,8 @@ export function kcFactory(keycloakService: KeycloakService) {
AdministrationComponent,
UsersComponent,
AddEditUserComponent,
NotAuthorizedComponent
NotAuthorizedComponent,
ListComponent
],
imports: [
BrowserModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="container">
<div class="title-container">
<div class="title-container__title">
<h1><span class="text-muted">Crown land File: {{application.clFile}} &nbsp;&rsaquo;&nbsp; </span>
<h1><span class="text-muted">Crown land File: {{application.meta.clFile}} &nbsp;&rsaquo;&nbsp; </span>
{{!application._id ? 'Create' : 'Edit'}} Application
</h1>
<span class="title-container__sub text-muted">Disposition Transaction: {{application.tantalisID}}</span>
Expand All @@ -15,27 +15,27 @@ <h1><span class="text-muted">Crown land File: {{application.clFile}} &nbsp;&rsaq
<button class="btn btn-primary ml-1" type="button" title="Submit new application"
*ngIf="!application._id"
(click)="addApplication()"
[disabled]="isSubmitting || application.isRetired">
[disabled]="isSubmitting || application.meta.isRetired">
<i class="spinner rotating" [hidden]="!isSubmitting"></i>
<span>{{isSubmitting ? 'Saving' : 'Save'}}</span>
</button>
<span title="You cannot save a retired application"></span>
</div>
<div class="btn-container">
<button class="btn btn-primary ml-1" type="button" title="Save application"
*ngIf="application._id && application.isPublished === false"
*ngIf="application._id && application.meta.isPublished === false"
(click)="saveApplication()"
[disabled]="isSaving || application.isRetired">
[disabled]="isSaving || application.meta.isRetired">
<i class="spinner rotating" [hidden]="!isSaving"></i>
<span>{{isSaving ? 'Saving' : 'Save'}}</span>
</button>
<span title="You cannot save a retired application"></span>
</div>
<div class="btn-container">
<button class="publish-btn btn btn-primary ml-1" type="button" title="Publish changes"
*ngIf="application._id && application.isPublished === true"
*ngIf="application._id && application.meta.isPublished === true"
(click)="saveApplication()"
[disabled]="isSaving || application.isRetired">
[disabled]="isSaving || application.meta.isRetired">
<i class="spinner rotating" [hidden]="!isSaving"></i>
<span>{{isSaving ? 'Publishing' : 'Publish Changes'}}</span>
</button>
Expand Down Expand Up @@ -98,7 +98,7 @@ <h1><span class="text-muted">Crown land File: {{application.clFile}} &nbsp;&rsaq
<div class="form-group">
<label>Applicant(s)</label>
<div class="applicant-display">
{{application.applicants || 'No Applicant on this File'}}
{{application.meta.applicants || 'No Applicant on this File'}}
</div>
</div>

Expand All @@ -111,33 +111,33 @@ <h1><span class="text-muted">Crown land File: {{application.clFile}} &nbsp;&rsaq
</div>
<div class="form-group mb-0">
<label>Application Documents</label>
<ul class="doc-list mb-3" *ngIf="application.documents?.length > 0">
<li *ngFor="let doc of application.documents">
<ul class="doc-list mb-3" *ngIf="application.meta.documents?.length > 0">
<li *ngFor="let doc of application.meta.documents">
<span class="cell icon">
<i class="material-icons">insert_drive_file</i>
</span>
<span class="cell name" [title]="doc.displayName || ''">
<span class="cell__txt-content">{{doc.documentFileName}}</span>
</span>
<span class="cell actions">
<button class="btn btn-icon" type="button" title="Delete this document" (click)="deleteDocument(doc, application.documents)">
<button class="btn btn-icon" type="button" title="Delete this document" (click)="deleteDocument(doc, application.meta.documents)">
<i class="material-icons">delete</i>
</button>
</span>
</li>
</ul>
<app-file-upload [fileExt]="['jpg', 'jpeg', 'png', 'pdf', 'tiff']" [maxFiles]="0" [maxSize]="10" [showList]="false" [files]="applicationFiles"
(filesChange)="addDocuments($event, application.documents); applicationFiles = []"></app-file-upload>
(filesChange)="addDocuments($event, application.meta.documents); applicationFiles = []"></app-file-upload>
</div>
</fieldset>

<fieldset name="decisionForm" id="appDecision">
<legend class="mb-3">Application Decision Documents</legend>
<div class="mb-4" *ngIf="application.decision">
<div class="mb-4" *ngIf="application.meta.decision">
<div class="form-group">
<label>Decision Documents</label>
<ul class="doc-list mb-3" *ngIf="application.decision.documents?.length > 0">
<li *ngFor="let doc of application.decision.documents">
<ul class="doc-list mb-3" *ngIf="application.meta.decision.meta.documents?.length > 0">
<li *ngFor="let doc of application.meta.decision.meta.documents">
<span class="cell icon">
<i class="material-icons">insert_drive_file</i>
</span>
Expand All @@ -147,24 +147,24 @@ <h1><span class="text-muted">Crown land File: {{application.clFile}} &nbsp;&rsaq
</span>
</span>
<span class="cell actions">
<button class="btn btn-icon" type="button" title="Delete this document" (click)="deleteDocument(doc, application.decision.documents)">
<button class="btn btn-icon" type="button" title="Delete this document" (click)="deleteDocument(doc, application.meta.decision.meta.documents)">
<i class="material-icons">delete</i>
</button>
</span>
</li>
</ul>
<app-file-upload [fileExt]="['jpg', 'jpeg', 'png', 'pdf', 'tiff']" [maxFiles]="0" [maxSize]="10" [showList]="false" [files]="decisionFiles"
(filesChange)="addDocuments($event, application.decision.documents); decisionFiles = []"></app-file-upload>
(filesChange)="addDocuments($event, application.meta.decision.meta.documents); decisionFiles = []"></app-file-upload>
</div>
</div>
<button class="btn content-btn-alt" type="button" title="Add decision documents"
*ngIf="!application.decision"
*ngIf="!application.meta.decision"
(click)="addDecision()">
<i class="material-icons md-20">add</i>
Add Decision Documents
</button>
<button class="btn content-btn-alt danger" type="button" title="Remove the decision documents"
*ngIf="application.decision"
*ngIf="application.meta.decision"
(click)="deleteDecision()">
<i class="material-icons md-20">remove</i>
Remove Decision Documents
Expand Down
Loading

0 comments on commit 495fcaa

Please sign in to comment.