-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Screen to Search/Filter Metadata (#401)
* Adding new services classes for jobCodes and namedReferences * Renaming package and services name classes. Extending new abstract class from the existing one. * refactoring JobCode classes and package. Adding CRUD requests * Adding Enum for MetadataType, Optimizing Imports * Adding implementation for delete method in Abstract service * Adding new services classes for jobCodes and namedReferences * Renaming package and services name classes. Extending new abstract class from the existing one. * refactoring JobCode classes and package. Adding CRUD requests * Adding Enum for MetadataType, Optimizing Imports * updating openapi.yaml to match endpoint definition. * Correcting Routepath and refactoring web methods * Refactoring entry points in navigation bar
- Loading branch information
1 parent
049a200
commit 54948e1
Showing
63 changed files
with
1,391 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../form/form-field-search-select/jobcode/form-field-jobcode-search-select.utilities.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...c/app/form/form-field-search-select/jobcode/form-field-jobcode-search-select.utilities.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { ApiJobCode } from "./job-codes/Jobcode" | ||
import { ApiNamedReference } from "./named-references/NamedReference" | ||
|
||
export class PaginatedMetadata { | ||
totalCount = 0 | ||
metadata: ApiJobCode[]|ApiNamedReference[] = [] | ||
constructor(metadata: ApiJobCode[]|ApiNamedReference[], totalCount: number) { | ||
this.metadata = metadata | ||
this.totalCount = totalCount | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { TestBed } from "@angular/core/testing" | ||
import { Router } from "@angular/router" | ||
import { HttpClientTestingModule } from "@angular/common/http/testing" | ||
import { Location } from "@angular/common" | ||
import { AbstractDataService } from "./abstract-data.service" | ||
import { EnvironmentService } from "../core/environment.service" | ||
import { AppConfig } from "../app.config" | ||
import { AuthService } from "../auth/auth-service" | ||
import { AuthServiceStub, RouterStub } from "@test/resource/mock-stubs" | ||
|
||
describe("AbstractAdminService", () => { | ||
let testService: AbstractDataService | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [HttpClientTestingModule], | ||
providers: [ | ||
EnvironmentService, | ||
AppConfig, | ||
AbstractDataService, | ||
Location, | ||
{ provide: AuthService, useClass: AuthServiceStub }, | ||
{ provide: Router, useClass: RouterStub } | ||
]}) | ||
testService = TestBed.inject(AbstractDataService) | ||
}) | ||
|
||
it("should be created", () => { | ||
expect(testService).toBeTruthy() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Location } from "@angular/common" | ||
import { HttpClient, HttpResponse } from "@angular/common/http" | ||
import { Injectable } from "@angular/core" | ||
import { Router } from "@angular/router" | ||
import { Observable } from "rxjs" | ||
import { share } from "rxjs/operators" | ||
import { AbstractService, ApiGetParams } from "../abstract.service" | ||
import { AuthService } from "../auth/auth-service" | ||
|
||
@Injectable({ providedIn: "root" }) | ||
export abstract class AbstractDataService extends AbstractService { | ||
|
||
protected constructor(httpClient: HttpClient, authService: AuthService, router: Router, location: Location) { | ||
super(httpClient, authService, router, location) | ||
} | ||
|
||
/** | ||
* Perform a patch request. | ||
* | ||
* const {body, headers, status, type, url} = response | ||
* | ||
* @param path The relative path to the endpoint | ||
* @param headers Json blob defining headers | ||
* @param params Json blob defining path params | ||
* @param body Json blob defining the changes to be applied to the object | ||
*/ | ||
patch<T>({path, headers, params, body}: ApiGetParams): Observable<HttpResponse<T>> { | ||
const observable = this.httpClient.patch<T>(this.buildUrl(path + "/update"), body, { | ||
headers: this.wrapHeaders(headers), | ||
params, | ||
observe: "response"}).pipe(share()) | ||
observable | ||
.subscribe(() => {}, (err) => { this.redirectToLogin(err) }) | ||
return observable | ||
} | ||
|
||
} |
83 changes: 83 additions & 0 deletions
83
ui/src/app/metadata/detail/metadata-list/metadata-list.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
|
||
<div class="l-stickyBar"> | ||
|
||
<div class="l-container t-padding-large t-padding-top"> | ||
|
||
<!-- {{render '@listheading'}}--> | ||
<div class="t-margin-medium t-margin-bottom"> | ||
<form [formGroup]="searchForm" (ngSubmit)="handleDefaultSubmit()"> | ||
<div class="m-text"> | ||
<svg class="m-text-x-icon t-icon" (click)="clearSearch()"> | ||
<use xlink:href="/assets/images/svg-defs.svg#icon-dismiss"></use> | ||
</svg> | ||
<input type="text" placeholder="Search Metadata" [formControl]="searchForm.controls.search"> | ||
<app-metadata-selector [isVisible]="getSelectAllEnabled" [control]="typeControl" [currentSelection]="selectedMetadataType"> | ||
</app-metadata-selector> | ||
</div> | ||
</form> | ||
</div> | ||
<div class="l-container l-container-mobile t-margin-medium t-margin-bottom"> | ||
<h2 *ngIf="title" class="t-type-heading1 t-margin-small t-margin-bottom">{{title}}</h2> | ||
<p class="t-type-bodyLarge t-type-text3"> | ||
{{metadataCountLabel}} | ||
|
||
<span *ngIf="matchingQuery"> | ||
found based on | ||
query: "{{matchingQuery}}" | ||
</span> | ||
<ng-template [ngIf]="totalCount > 0"> | ||
Viewing {{firstRecordNo}}-{{lastRecordNo}}. | ||
</ng-template> | ||
</p> | ||
</div> | ||
|
||
<div class="t-margin-medium t-margin-bottom"> | ||
<app-blocking-loader [observables]="[resultsLoaded]"> | ||
<p class="t-visuallyHidden">Select one or more records in the table, or select all in the table heading, then use the action menu to delete the selected ones.</p> | ||
<app-job-code-table | ||
*ngIf="isJobCodeDataSelected" | ||
[allowSorting]="true" | ||
[items]="getJobCodes()" | ||
[currentSort]="columnSort" | ||
[rowActions]="rowActions()" | ||
[selectAllCount]="getSelectAllCount()" | ||
[selectAllEnabled]="getSelectAllEnabled()" | ||
[clearSelected]="clearSelectedItemsFromTable.asObservable()" | ||
(selectAllSelected)="handleSelectAll($event)" | ||
(rowSelected)="handleNewSelection($event)" | ||
(columnSorted)="handleHeaderColumnSort($event)" | ||
(focusActionBar)="focusActionBar()" | ||
></app-job-code-table> | ||
|
||
<app-named-reference-table | ||
*ngIf="!isJobCodeDataSelected" | ||
[allowSorting]="true" | ||
[items]="getNamedReferences()" | ||
[currentSort]="columnSort" | ||
[rowActions]="rowActions()" | ||
[selectAllCount]="getSelectAllCount()" | ||
[selectAllEnabled]="getSelectAllEnabled()" | ||
[clearSelected]="clearSelectedItemsFromTable.asObservable()" | ||
(selectAllSelected)="handleSelectAll($event)" | ||
(rowSelected)="handleNewSelection($event)" | ||
(columnSorted)="handleHeaderColumnSort($event)" | ||
(focusActionBar)="focusActionBar()" | ||
></app-named-reference-table> | ||
|
||
<app-empty-message *ngIf="emptyResults && !showSearchEmptyMessage"> | ||
<p class="m-emptyMessage-x-message">No Metadata found. Try adjusting your search criteria.</p> | ||
</app-empty-message> | ||
</app-blocking-loader> | ||
</div> | ||
|
||
<app-pagination | ||
[currentPage]="currentPageNo" | ||
[totalPages]="totalPageCount" | ||
(pageClicked)="handlePageClicked($event)" | ||
></app-pagination> | ||
|
||
</div> | ||
|
||
</div> | ||
|
||
|
Oops, something went wrong.