Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Screen to Search/Filter Metadata #401

Merged
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
4b640f1
Adding new services classes for jobCodes and namedReferences
jchavez137 Apr 21, 2023
de7f154
Renaming package and services name classes. Extending new abstract cl…
jchavez137 Apr 25, 2023
575ca75
refactoring JobCode classes and package. Adding CRUD requests
jchavez137 Apr 27, 2023
aea06f0
reverting false positives in refactoring package name
jchavez137 Apr 27, 2023
ed62214
Adding Enum for MetadataType, Optimizing Imports
jchavez137 May 2, 2023
95cea5e
Adding implementation for delete method in Abstract service
jchavez137 May 2, 2023
176ff53
Correcting indentation and refactoring name for Enum
jchavez137 May 3, 2023
b8d1265
Adding new services classes for jobCodes and namedReferences
jchavez137 Apr 21, 2023
de1cdcc
Renaming package and services name classes. Extending new abstract cl…
jchavez137 Apr 25, 2023
079599a
refactoring JobCode classes and package. Adding CRUD requests
jchavez137 Apr 27, 2023
8dc0bce
reverting false positives in refactoring package name
jchavez137 Apr 27, 2023
45150e4
Adding Enum for MetadataType, Optimizing Imports
jchavez137 May 2, 2023
45d891e
Correcting indentation and refactoring name for Enum
jchavez137 May 3, 2023
b17fe43
updating openapi.yaml to match endpoint definition.
jchavez137 May 4, 2023
777b692
Correcting Routepath and refactoring web methods
jchavez137 May 4, 2023
b8cb4ba
updating openapi.yaml for patch request.
jchavez137 May 4, 2023
26e386d
Correcting Patch request structure
jchavez137 May 4, 2023
34907c5
Correcting Method verb
jchavez137 May 4, 2023
baf9e3b
Refactoring entry points in navigation bar
jchavez137 May 9, 2023
5f53026
Implementing table components
jchavez137 May 11, 2023
e535d91
Implementing table components
jchavez137 May 11, 2023
aecbcf9
Renaming list component for Metadata
jchavez137 May 12, 2023
3328137
Implementing table row components
jchavez137 May 12, 2023
63f03d3
Adding metadata type selector
jchavez137 May 13, 2023
3ba4126
changing data type of metadata selection
jchavez137 May 15, 2023
9ff74e0
Adding delete Action to table rows, adding unit tests for bool functions
jchavez137 May 16, 2023
baf8fe3
Polishing code structure and spaces, adding some unit tests
jchavez137 May 16, 2023
526c979
Polishing code structure and spaces, adding some unit tests
jchavez137 May 16, 2023
3a83e2f
Reverting openapi.yaml
jchavez137 May 18, 2023
7cd4b77
Reverting openapi.yaml
jchavez137 May 18, 2023
7cd98c7
bumping budget in angular.json, and adding MatMenuModule in header spec
jchavez137 May 18, 2023
f3df1ef
refactoring Metadata-selector files to be in detail folder, Removing …
jchavez137 May 18, 2023
c120160
Disabling delete action access for other all users
jchavez137 May 18, 2023
3841d6f
Adding AuthService to providers array in metadata-list.component.spec.ts
jchavez137 May 18, 2023
32f69e9
removing wrong rebase edits
jchavez137 May 18, 2023
26e8485
removing wrong rebase edits
jchavez137 May 18, 2023
edabc5d
removing wrong rebase edits
jchavez137 May 18, 2023
dd3596a
removing wrong rebase edits
jchavez137 May 18, 2023
1e974e7
correcting imports indent
jchavez137 May 18, 2023
7d27ba4
Correcting format in imports, adding metadata option to mobile view, …
jchavez137 May 19, 2023
59afd48
Moving Mat dependency to dev dependencies
jchavez137 May 22, 2023
c4c025a
correcting imports order
jchavez137 May 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ui/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
}
],
"styles": [
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
"node_modules/@concentricsky/wgu-design-system-patternlibrary/dist/css/screen.css",
"src/styles.scss"
],
Expand All @@ -79,7 +80,7 @@
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
"maximumError": "1.2mb"
},
{
"type": "anyComponentStyle",
Expand Down Expand Up @@ -132,6 +133,7 @@
"src/assets"
],
"styles": [
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
"src/styles.scss"
],
"scripts": [],
Expand Down
65 changes: 65 additions & 0 deletions ui/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 ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
"private": true,
"dependencies": {
"@angular/animations": "~12.2.17",
"@angular/cdk": "~12.2.13",
"@angular/common": "~12.2.17",
"@angular/compiler": "~12.2.17",
"@angular/core": "~12.2.17",
"@angular/forms": "~12.2.17",
"@angular/material": "~12.2.13",
"@angular/platform-browser": "~12.2.17",
"@angular/platform-browser-dynamic": "~12.2.17",
"@angular/router": "~12.2.17",
Expand Down Expand Up @@ -63,4 +65,4 @@
"tslint": "~6.1.0",
"typescript": "~4.3.5"
}
}
}
6 changes: 6 additions & 0 deletions ui/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {BatchImportComponent} from "./richskill/import/batch-import.component"
import { ActionByRoles, ButtonAction } from "./auth/auth-roles"
import {MyWorkspaceComponent} from "./my-workspace/my-workspace.component"
import {ConvertToCollectionComponent} from "./my-workspace/convert-to-collection/convert-to-collection.component"
import { MetadataListComponent } from "./metadata/detail/metadata-list/metadata-list.component"


const routes: Routes = [
Expand Down Expand Up @@ -181,6 +182,11 @@ const routes: Routes = [
roles: ActionByRoles.get(ButtonAction.MyWorkspace)
}
},
{
path: "metadata",
component: MetadataListComponent,
canActivate: [AuthGuard],
},
/* PUBLIC VIEWS */
{path: "skills/:uuid", component: RichSkillPublicComponent},
{path: "collections/:uuid", component: CollectionPublicComponent},
Expand Down
22 changes: 19 additions & 3 deletions ui/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import {HeaderComponent} from "./navigation/header.component"
import {FooterComponent} from "./navigation/footer.component"
import {SkillCollectionsDisplayComponent} from "./richskill/form/skill-collections-display.component"
import {ToastComponent} from "./toast/toast.component"
import {PillComponent} from "./core/pill/pill.component";
import {PillGroupComponent} from "./core/pill/group/pill-group.component";
import {PillComponent} from "./core/pill/pill.component"
import {PillGroupComponent} from "./core/pill/group/pill-group.component"
import {AuthService} from "./auth/auth-service"
import {AuthGuard} from "./auth/auth.guard"
import {CommoncontrolsComponent} from "./navigation/commoncontrols.component"
Expand Down Expand Up @@ -110,6 +110,14 @@ import { OsmtFormModule } from "./form/osmt-form.module"
import { ConvertToCollectionComponent } from "./my-workspace/convert-to-collection/convert-to-collection.component"
import { SizePaginationComponent } from "./table/skills-library-table/size-pagination/size-pagination.component"
import {OsmtTableModule} from "./table/osmt-table.module"
import { NoopAnimationsModule } from "@angular/platform-browser/animations"
import { MatMenuModule } from "@angular/material/menu"
import { MetadataListComponent } from "./metadata/detail/metadata-list/metadata-list.component"
import { JobCodeListRowComponent } from "./metadata/job-codes/job-code-list-row/job-code-list-row.component"
import { JobCodeTableComponent } from "./metadata/job-codes/job-code-table/job-code-table.component"
import { NamedReferenceListRowComponent } from "./metadata/named-references/named-reference-list-row/named-reference-list-row.component"
import { NamedReferenceTableComponent } from "./metadata/named-references/named-reference-table/named-reference-table.component"
import { MetadataSelectorComponent } from "./metadata/detail/metadata-selector/metadata-selector.component"

export function initializeApp(
appConfig: AppConfig,
Expand Down Expand Up @@ -229,6 +237,12 @@ export function initializeApp(
CollectionPipe,
ConvertToCollectionComponent,
SizePaginationComponent,
MetadataListComponent,
JobCodeListRowComponent,
JobCodeTableComponent,
NamedReferenceListRowComponent,
NamedReferenceTableComponent,
MetadataSelectorComponent,
],
imports: [
NgIdleKeepaliveModule.forRoot(),
Expand All @@ -241,7 +255,9 @@ export function initializeApp(
OsmtCoreModule,
OsmtFormModule,
FormsModule,
OsmtTableModule
OsmtTableModule,
NoopAnimationsModule,
MatMenuModule
],
providers: [
EnvironmentService,
Expand Down
6 changes: 4 additions & 2 deletions ui/src/app/auth/auth-roles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export enum ButtonAction {
LibraryExport,
ExportDraftCollection,
DeleteCollection,
MyWorkspace
MyWorkspace,
MetadataAdmin,
}

export const ActionByRoles = new Map<number, string[]>([
Expand All @@ -28,7 +29,8 @@ export const ActionByRoles = new Map<number, string[]>([
[ButtonAction.LibraryExport, [OSMT_ADMIN]],
[ButtonAction.ExportDraftCollection, [OSMT_ADMIN]],
[ButtonAction.DeleteCollection, [OSMT_ADMIN]],
[ButtonAction.MyWorkspace, [OSMT_ADMIN, OSMT_CURATOR]]
[ButtonAction.MyWorkspace, [OSMT_ADMIN, OSMT_CURATOR]],
[ButtonAction.MetadataAdmin, [OSMT_ADMIN]],
])

//TODO migrate AuthServiceWgu & AuthService.hasRole & isEnabledByRoles into a singleton here. HDN Sept 15, 2022
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {EnvironmentService} from "src/app/core/environment.service"
import {ActivatedRouteStubSpec} from "test/util/activated-route-stub.spec"
import {KeywordSearchService} from "../../../richskill/service/keyword-search.service"
import {KeywordSearchServiceStub} from "../../../../../test/resource/mock-stubs"
import {ApiJobCode, IJobCode} from "../../../job-codes/Jobcode"
import { ApiJobCode, IJobCode } from "../../../metadata/job-codes/Jobcode"
import {FormFieldJobCodeSearchMultiSelect} from "./form-field-jobcode-search-multi-select.component"

@Component({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {Component} from "@angular/core"
import {Observable} from "rxjs"
import {map} from "rxjs/operators"
import {KeywordSearchService} from "../../../richskill/service/keyword-search.service"
import {IJobCode} from "../../../job-codes/Jobcode"
import { IJobCode } from "../../../metadata/job-codes/Jobcode"
import {isJobCode} from "./form-field-jobcode-search-select.utilities"
import {areSearchResultsEqual, labelFor, searchResultFromString} from "./form-field-jobcode-search-select.utilities"
import {AbstractFormFieldSearchMultiSelect} from "../abstract-form-field-search-multi-select.component"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {EnvironmentService} from "src/app/core/environment.service"
import {ActivatedRouteStubSpec} from "test/util/activated-route-stub.spec"
import {KeywordSearchService} from "../../../richskill/service/keyword-search.service"
import {KeywordSearchServiceStub} from "../../../../../test/resource/mock-stubs"
import {ApiJobCode, IJobCode} from "../../../job-codes/Jobcode"
import { ApiJobCode, IJobCode } from "../../../metadata/job-codes/Jobcode"
import {FormFieldJobCodeSearchSelect} from "./form-field-jobcode-search-select.component"

@Component({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {Component} from "@angular/core"
import {Observable} from "rxjs"
import {map} from "rxjs/operators"
import {KeywordSearchService} from "../../../richskill/service/keyword-search.service"
import {IJobCode} from "../../../job-codes/Jobcode"
import { IJobCode } from "../../../metadata/job-codes/Jobcode"
import {isJobCode} from "./form-field-jobcode-search-select.utilities"
import {areSearchResultsEqual, labelFor, searchResultFromString} from "./form-field-jobcode-search-select.utilities"
import {AbstractFormFieldSearchSingleSelect} from "../abstract-form-field-search-single-select.component"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// noinspection LocalVariableNamingConventionJS
import {async, ComponentFixture, TestBed} from "@angular/core/testing"
import {IJobCode} from "../../../job-codes/Jobcode"
import { IJobCode } from "../../../metadata/job-codes/Jobcode"
import {createMockJobcode} from "../../../../../test/resource/mock-data"
import {
areSearchResultsEqual,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {IJobCode} from "../../../job-codes/Jobcode"
import { IJobCode } from "../../../metadata/job-codes/Jobcode"

export const areSearchResultsEqual = (result1: IJobCode, result2: IJobCode): boolean => {
if (result1 && result2) {
Expand Down
11 changes: 11 additions & 0 deletions ui/src/app/metadata/PaginatedMetadata.ts
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
}
}
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>


Loading