Skip to content

Commit

Permalink
Merge branch 'master' into new-services
Browse files Browse the repository at this point in the history
  • Loading branch information
Allcharles committed May 5, 2020
2 parents c75ba90 + cd4768a commit 75f5290
Show file tree
Hide file tree
Showing 28 changed files with 1,094 additions and 22 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
".vscode",
".tsling.json"
],
"explorer.compactFolders": false
"explorer.compactFolders": false,
"prettier.semi": false
}
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,7 @@ $ npm run test:all

#### Code Coverage

On the completion of the unit tests, the system will automatically generate a code coverage report. To open this, run the following command:

```bash
$ npm run code-coverage
```
On the completion of the unit tests, the system will automatically generate a code coverage report. You can view the report here: `./coverage/workbench-client/index.html`

## To build

Expand All @@ -109,6 +105,16 @@ $ npm run build

Move the generated files from the `/dist` directory to the required location.

## Build Statistics

When adding a library to the repository, you may wish to view its cost on the system. You can view the build size using the following command:

```typescript
$ npm run stats
```

This will allow you to compare the bundle size impacts before and after the update by switching between checked out commits/branches.

## Common Problems

Check our Wiki pages for help with common problems and using systems custom to our application.
Expand Down
6 changes: 6 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
"assets": ["src/favicon.ico", "src/assets", "src/manifest.json"],
"styles": [
"src/styles.scss",
"node_modules/primeng/resources/themes/nova-light/theme.css",
"node_modules/primeng/resources/primeng.min.css",
"node_modules/primeicons/primeicons.css",
"node_modules/snazzy-info-window/dist/snazzy-info-window.css"
],
"scripts": [],
Expand Down Expand Up @@ -131,6 +134,9 @@
"assets": ["src/assets", "src/manifest.json"],
"styles": [
"src/styles.scss",
"node_modules/primeng/resources/themes/nova-light/theme.css",
"node_modules/primeng/resources/primeng.min.css",
"node_modules/primeicons/primeicons.css",
"node_modules/snazzy-info-window/dist/snazzy-info-window.css"
],
"scripts": []
Expand Down
3 changes: 2 additions & 1 deletion baw-client.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
},
"peacock.color": "#2b7489",
"angularKarmaTestExplorer.debugMode": true,
"explorer.compactFolders": false
"explorer.compactFolders": false,
"prettier.semi": false
},
"extensions": {
"recommendations": [
Expand Down
53 changes: 48 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"version": "3.0.0",
"scripts": {
"build": "ng build --prod",
"code-coverage": "npm test -- --watch=false && http-server -c-1 -o -p 9875 ./coverage/workbench-client",
"e2e": "ng e2e",
"int:extract": "ng xi18n --output-path src/locale",
"lint": "ng lint",
Expand Down Expand Up @@ -47,12 +46,15 @@
"@ngx-loading-bar/http-client": "^4.2.0",
"@swimlane/ngx-datatable": "^16.0.3",
"bootstrap": "^4.4.1",
"filesize": "^6.1.0",
"full-icu": "^1.3.1",
"humanize-duration": "^3.22.0",
"immutable": "^4.0.0-rc.12",
"lodash": "^4.17.15",
"luxon": "^1.23.0",
"ngx-toastr": "^12.0.1",
"primeicons": "^2.0.0",
"primeng": "^9.0.5",
"rxjs": "^6.5.5",
"snazzy-info-window": "^1.1.1",
"tslib": "^1.11.1",
Expand Down
14 changes: 7 additions & 7 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
AgmCoreModule,
LazyMapsAPILoaderConfigLiteral,
LAZY_MAPS_API_CONFIG
LAZY_MAPS_API_CONFIG,
} from "@agm/core";
import { AgmSnazzyInfoWindowModule } from "@agm/snazzy-info-window";
import { HttpClientModule } from "@angular/common/http";
Expand All @@ -23,7 +23,7 @@ import { ErrorModule } from "./component/error/error.module";
import { HomeModule } from "./component/home/home.module";
import {
MyAccountModule,
ProfileModule
ProfileModule,
} from "./component/profile/profile.module";
import { ProjectsModule } from "./component/projects/projects.module";
import { ReportProblemsModule } from "./component/report-problem/report-problem.module";
Expand All @@ -44,7 +44,7 @@ export const appLibraryImports = [
AgmSnazzyInfoWindowModule,
FormlyModule.forRoot(formlyRoot),
FormlyBootstrapModule,
ToastrModule.forRoot(toastrRoot)
ToastrModule.forRoot(toastrRoot),
];

export const appImports = [
Expand All @@ -62,7 +62,7 @@ export const appImports = [
StatisticsModule,
// these last two must be last!
HomeModule,
ErrorModule
ErrorModule,
];

/**
Expand All @@ -84,14 +84,14 @@ export class GoogleMapsConfig implements LazyMapsAPILoaderConfigLiteral {
AppRoutingModule,
HttpClientModule,
...appLibraryImports,
...appImports
...appImports,
],
providers: [
...providers,
{ provide: LAZY_MAPS_API_CONFIG, useClass: GoogleMapsConfig }
{ provide: LAZY_MAPS_API_CONFIG, useClass: GoogleMapsConfig },
],
bootstrap: [AppComponent],
entryComponents: [PermissionsShieldComponent],
exports: []
exports: [],
})
export class AppModule {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<h4>{{ project.name }}</h4>

<ngx-datatable
#table
bawDatatableDefaults
[columnMode]="ColumnMode.force"
[columns]="columns"
[rows]="rows"
[count]="totalModels"
[offset]="pageNumber"
(page)="setPage($event)"
(sort)="onSort($event)"
>
<ngx-datatable-column
name="Id"
width="80"
maxWidth="80"
></ngx-datatable-column>
<ngx-datatable-column name="Name"></ngx-datatable-column>
<ngx-datatable-column name="Actions" [sortable]="false">
<ng-template let-value="value" ngx-datatable-cell-template>
<a
class="btn btn-sm btn-primary mr-1"
[routerLink]="[detailsPath(value)]"
>
Details
</a>
<a class="btn btn-sm btn-primary mr-1" [routerLink]="[playPath(value)]">
Play
</a>
<a class="btn btn-sm btn-primary" [routerLink]="[visualizePath(value)]">
Visualize
</a>
</ng-template>
</ngx-datatable-column>
</ngx-datatable>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { async, ComponentFixture, TestBed } from "@angular/core/testing";
import { HarvestCompleteComponent } from "./harvest-complete.component";

xdescribe("HarvestCompleteComponent", () => {
let component: HarvestCompleteComponent;
let fixture: ComponentFixture<HarvestCompleteComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [HarvestCompleteComponent],
}).compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(HarvestCompleteComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it("should create", () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { Component, Input, OnInit } from "@angular/core";
import { PagedTableTemplate } from "src/app/helpers/tableTemplate/pagedTableTemplate";
import { Project } from "src/app/models/Project";
import { Site } from "src/app/models/Site";
import { ApiErrorDetails } from "src/app/services/baw-api/api.interceptor.service";
import { SitesService } from "src/app/services/baw-api/sites.service";

@Component({
selector: "app-project-harvest-complete",
templateUrl: "./harvest-complete.component.html",
})
export class HarvestCompleteComponent extends PagedTableTemplate<TableRow, Site>
implements OnInit {
@Input() project: Project;
public sites: Site[];
public error: ApiErrorDetails;

constructor(api: SitesService) {
super(api, (sites) =>
sites.map((site) => ({
id: site.id,
name: site.name,
actions: site,
}))
);
}

ngOnInit(): void {
this.columns = [{ name: "Id" }, { name: "Name" }, { name: "Actions" }];
this.sortKeys = {
id: "id",
name: "name",
};

this.getPageData(this.project);
}

public detailsPath(site: Site) {
return site.getViewUrl(this.project);
}

public playPath(site: Site) {
return "/broken_link";
}

public visualizePath(site: Site) {
return "/broken_link";
}
}

interface TableRow {
id: number;
name: string;
actions: Site;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<div class="pb-3">
<p-treeTable [value]="files">
<ng-template pTemplate="header">
<tr>
<th>Name</th>
<th>Project</th>
<th>Site</th>
<th>Point</th>
<th class="status">Status</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-rowNode let-rowData="rowData">
<tr>
<td>
<div class="clearfix">
<p-treeTableToggler
*ngIf="rowNode.node.children"
[rowNode]="rowNode"
></p-treeTableToggler>
{{ rowData.name }}
</div>
</td>
<td>
<app-pill-list
[numPills]="3"
[text]="getText(rowData.projects)"
></app-pill-list>
</td>
<td>
<app-pill-list
[numPills]="3"
[text]="getText(rowData.sites)"
></app-pill-list>
</td>
<td>
<app-pill-list
[numPills]="3"
[text]="getText(rowData.points)"
></app-pill-list>
</td>
<td>
<app-indicator [status]="rowData.status"></app-indicator>
</td>
</tr>
</ng-template>
</p-treeTable>
</div>
Loading

0 comments on commit 75f5290

Please sign in to comment.