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

Feature web UI for lookup records #2249

Merged
merged 31 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
11ae9cc
Add web ui for internal lookup records intial commit
alejandro-bulgaris-qcif Jun 7, 2024
0b4e11d
Dashboard component intial refactor
alejandro-bulgaris-qcif Jun 11, 2024
1a3a75f
Dashboard component template inital changes
alejandro-bulgaris-qcif Jun 11, 2024
cfb875d
Add filter method initial implementation to dashboard component
alejandro-bulgaris-qcif Jun 13, 2024
1e91fee
Update angular tests for dashboard component
alejandro-bulgaris-qcif Jun 13, 2024
86e44f2
Add intial implementation of date range filters to dashboard component
alejandro-bulgaris-qcif Jun 13, 2024
02e7b2e
Improve text filter implementation in dashboard component and remove …
alejandro-bulgaris-qcif Jun 14, 2024
c1b429d
Change initialise text filters only for standard dashboard
alejandro-bulgaris-qcif Jun 14, 2024
cf96414
Make init first text filter more robust in dashboard component
alejandro-bulgaris-qcif Jun 14, 2024
1eacd99
Initial implementation of infer schema and generate form methods in f…
alejandro-bulgaris-qcif Jun 18, 2024
23fa3ec
Fix dashboard component angular test
alejandro-bulgaris-qcif Jun 18, 2024
349e372
Refactor workflow steps service and intial refactor of forms service
alejandro-bulgaris-qcif Jun 19, 2024
beb36d7
Refactor get form method in record controller to promisify logic flow
alejandro-bulgaris-qcif Jun 20, 2024
88f5212
More refactoring to promisify getForm method in record controller
alejandro-bulgaris-qcif Jun 21, 2024
acd14a7
Refactor to simplify redundant code in getForm method in record contr…
alejandro-bulgaris-qcif Jun 21, 2024
0d13524
Update forms service unit test
alejandro-bulgaris-qcif Jun 21, 2024
4f9a7b1
Update references of renamed method getFormByStartingWorkflowStep and…
alejandro-bulgaris-qcif Jun 21, 2024
7f01055
Add support for array fields in autogenerated forms
alejandro-bulgaris-qcif Jun 24, 2024
290704b
Fix dashboard component filter input box showing in empty workflow steps
alejandro-bulgaris-qcif Jun 24, 2024
82cf890
Merge branch 'develop' into feature/web-ui-for-lookup-records
alejandro-bulgaris-qcif Jun 24, 2024
7db7efc
Reinstate workflow steps populated for all dashboard types
alejandro-bulgaris-qcif Jun 24, 2024
97e16d1
Improve dashboard app habdling of filter input box
alejandro-bulgaris-qcif Jun 25, 2024
91aca99
Fix filter input not setting ngmodel properly
alejandro-bulgaris-qcif Jun 25, 2024
0e55a36
Fix mocha unit tests for new form service method getform
alejandro-bulgaris-qcif Jun 25, 2024
028f083
Fix one more mocha unit test in forms service
alejandro-bulgaris-qcif Jun 25, 2024
3ddae5a
Make generate form from schema method more robust in forms service
alejandro-bulgaris-qcif Jun 25, 2024
f5b3150
Add basic metadata comparison method before update to legacy harvest …
alejandro-bulgaris-qcif Jun 26, 2024
b088fdd
Add agenda queue indexes on init
alejandro-bulgaris-qcif Jun 26, 2024
7a8aa43
Move indexes creation after agenda start on init method in agenda que…
alejandro-bulgaris-qcif Jun 26, 2024
8e31a5f
Improve forms service unit tests
alejandro-bulgaris-qcif Jun 26, 2024
88812dc
Refactor new get form methond in forms service to be promise based an…
alejandro-bulgaris-qcif Jun 27, 2024
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
Original file line number Diff line number Diff line change
@@ -1,12 +1,32 @@
<div *ngIf="isReady">
<ng-container>
<div *ngFor="let workflowStep of workflowSteps">
<h2 *ngIf="workflowSteps.length > 1 && (dashboardTypeSelected == 'standard' || dashboardTypeSelected == 'consolidated')" [innerHTML]="'dashboard-heading' | i18next: {stage: workflowStep.config.workflow.stageLabel, recordTypeName: typeLabel}">
</h2>
<h2 *ngIf="workflowSteps.length == 1 && (dashboardTypeSelected == 'standard' || dashboardTypeSelected == 'consolidated')" [innerHTML]="'dashboard-heading-one-step' | i18next: {recordTypeName: typeLabel}">
</h2>
<div class="d-flex flex-row">
<div *ngIf="workflowSteps.length > 1 && (dashboardTypeSelected == 'standard' || dashboardTypeSelected == 'consolidated')" class="col-md-4">
<h2>{{ 'dashboard-heading' | i18next: {stage: workflowStep.config.workflow.stageLabel, recordTypeName: typeLabel} }}</h2>
</div>
<div *ngIf="workflowSteps.length == 1 && !hideWorkflowStepTitle && (dashboardTypeSelected == 'standard' || dashboardTypeSelected == 'consolidated')" class="col-md-4">
<h2>{{ 'dashboard-heading-one-step' | i18next: {recordTypeName: typeLabel} }}</h2>
</div>
<ng-container *ngIf="dashboardTypeSelected == 'standard' && (records[workflowStep.config.workflow.stage].totalItems > 0 || (records[workflowStep.config.workflow.stage].totalItems <= 0 && getFilterSearchDisplayed(workflowStep.config.workflow.stage)))">
<div class="col-md-8">
<div class="d-flex flex-row mt-4">
<button class="btn btn-primary dropdown-toggle" type='button' data-bs-toggle="dropdown" aria-expanded="false" >Filter by {{ filterFieldName }}</button>
<ul class="dropdown-menu">
<li *ngFor="let filter of getTextFilters()"><a class="dropdown-item" href="#" (click)="setFilterField(filter, $event)">Filter by {{ filter.name }}</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#" (click)="resetFilterAndSearch(workflowStep.config.workflow.stage, $event)">{{ 'record-search-reset' | i18next }}</a></li>
</ul>
<input type="text" class="form-control" [(ngModel)]="filterSearchString[workflowStep.config.workflow.stage]" placeholder="{{ 'record-search-basic-search-placeholder' | i18next}}" (keyup.enter)="filterChanged(workflowStep.config.workflow.stage)" aria-describedby="basic-search-addon" autofocus>
<button class="btn btn-primary" type='button' aria-expanded="false" [disabled]="getIsSearching(workflowStep.config.workflow.stage) || getFilterSearchString(workflowStep.config.workflow.stage) == ''" (click)="filterChanged(workflowStep.config.workflow.stage)">{{ 'record-search-basic-search' | i18next }}</button>
</div>
</div>
<div class="col-md-4"></div>
</ng-container>
</div>
<div *ngIf="records[workflowStep.config.workflow.stage] != null">
<div *ngIf="records[workflowStep.config.workflow.stage].totalItems <= 0" class="padding-bottom-10" [innerHTML]="'no-records' | i18next: {stage: workflowStep.config.workflow.stageLabel.toLowerCase(), recordTypeName: typeLabel.toLowerCase()}">
<div *ngIf="records[workflowStep.config.workflow.stage].totalItems <= 0" class="padding-bottom-10" >
{{ 'no-records' | i18next: {stage: workflowStep.config.workflow.stageLabel.toLowerCase(), recordTypeName: typeLabel.toLowerCase()} }}
</div>
<div *ngIf="records[workflowStep.config.workflow.stage].totalItems > 0">
<table class="table">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,25 @@ let recordDataStandard = {
dashboardType:
{
formatRules: {
filterBy: [],
filterWorkflowStepsBy: [],
filterBy: [],
filterWorkflowStepsBy: [],
queryFilters: {
rdmp: [
{
filterType: 'text',
filterFields: [
{
name: 'Title',
path: 'metadata.title'
}
]
}
]
},
sortBy: 'metaMetadata.lastSaveDate:-1',
groupBy: '',
sortGroupBy: [],
groupBy: '',
sortGroupBy: [],
hideWorkflowStepTitleForRecordType: []
}
},
step: [{
Expand Down Expand Up @@ -134,8 +148,7 @@ describe('DashboardComponent standard', () => {
const fixture = TestBed.createComponent(DashboardComponent);
const dashboardComponent = fixture.componentInstance;
await dashboardComponent.initView('rdmp');
expect(dashboardComponent.workflowSteps.length).toBeGreaterThan(0);
expect(dashboardComponent.defaultTableConfig.length).toBeGreaterThan(0);
expect(dashboardComponent.defaultRowConfig.length).toBeGreaterThan(0);
expect(dashboardComponent.dashboardTypeSelected).toEqual('standard');
await dashboardComponent.initStep('draft','draft','rdmp','',1);
let planTable = dashboardComponent.evaluatePlanTableColumns({}, {}, {}, 'draft', recordDataStandard['records']);
Expand All @@ -152,12 +165,26 @@ let recordDataWorkspace = {
dashboardType:
{
formatRules: {
filterBy: [],
filterBy: [],
recordTypeFilterBy: 'existing-locations',
filterWorkflowStepsBy: [ 'existing-locations-draft'],
filterWorkflowStepsBy: [ 'existing-locations-draft'],
queryFilters: {
rdmp: [
{
filterType: 'text',
filterFields: [
{
name: 'Title',
path: 'metadata.title'
}
]
}
]
},
sortBy: 'metaMetadata.lastSaveDate:-1',
groupBy: '',
sortGroupBy: [],
groupBy: '',
sortGroupBy: [],
hideWorkflowStepTitleForRecordType: []
}
},
step: [{
Expand Down Expand Up @@ -277,8 +304,7 @@ describe('DashboardComponent workspace', () => {
const dashboardComponent = fixture.componentInstance;
dashboardComponent.dashboardTypeSelected = 'workspace';
await dashboardComponent.initView('workspace');
expect(dashboardComponent.workflowSteps.length).toBeGreaterThan(0);
expect(dashboardComponent.defaultTableConfig.length).toBeGreaterThan(0);
expect(dashboardComponent.defaultRowConfig.length).toBeGreaterThan(0);
expect(dashboardComponent.dashboardTypeSelected).toEqual('workspace');
await dashboardComponent.initStep('','existing-locations-draft','','workspace',1);
let planTable = dashboardComponent.evaluatePlanTableColumns({}, {}, {}, 'existing-locations-draft', recordDataWorkspace['records']);
Expand All @@ -295,11 +321,25 @@ let recordDataConsolidated = {
dashboardType:
{
formatRules: {
filterBy: [],
filterWorkflowStepsBy: ['consolidated'],
filterBy: [],
filterWorkflowStepsBy: ['consolidated'],
queryFilters: {
rdmp: [
{
filterType: 'text',
filterFields: [
{
name: 'Title',
path: 'metadata.title'
}
]
}
]
},
sortBy: '',
groupBy: 'groupedByRecordType',
sortGroupBy: [{ rowLevel: 0, compareFieldValue: 'rdmp' }],
groupBy: 'groupedByRecordType',
sortGroupBy: [{ rowLevel: 0, compareFieldValue: 'rdmp' }],
hideWorkflowStepTitleForRecordType: []
}
},
step: [{
Expand Down Expand Up @@ -478,7 +518,7 @@ describe('DashboardComponent consolidated group by record type', () => {
dashboardComponent.dashboardTypeSelected = 'consolidated';
await dashboardComponent.initView('consolidated');
expect(dashboardComponent.workflowSteps.length).toBeGreaterThan(0);
expect(dashboardComponent.defaultTableConfig.length).toBeGreaterThan(0);
expect(dashboardComponent.defaultRowConfig.length).toBeGreaterThan(0);
expect(dashboardComponent.dashboardTypeSelected).toEqual('consolidated');
await dashboardComponent.initStep('','consolidated','rdmp','',1);
let groupedRecords = recordDataConsolidated['groupedRecords'];
Expand All @@ -505,11 +545,25 @@ let recordDataConsolidatedRelationships = {
dashboardType:
{
formatRules: {
filterBy: [],
filterWorkflowStepsBy: ['consolidated'],
filterBy: [],
filterWorkflowStepsBy: ['consolidated'],
queryFilters: {
rdmp: [
{
filterType: 'text',
filterFields: [
{
name: 'Title',
path: 'metadata.title'
}
]
}
]
},
sortBy: '',
groupBy: 'groupedByRelationships',
sortGroupBy: [{ rowLevel: 0, compareFieldValue: 'rdmp' }],
groupBy: 'groupedByRelationships',
sortGroupBy: [{ rowLevel: 0, compareFieldValue: 'rdmp' }],
hideWorkflowStepTitleForRecordType: []
}
},
step: [{
Expand Down Expand Up @@ -705,7 +759,7 @@ describe('DashboardComponent consolidated group by relationships', () => {
dashboardComponent.dashboardTypeSelected = 'consolidated';
await dashboardComponent.initView('consolidated');
expect(dashboardComponent.workflowSteps.length).toBeGreaterThan(0);
expect(dashboardComponent.defaultTableConfig.length).toBeGreaterThan(0);
expect(dashboardComponent.defaultRowConfig.length).toBeGreaterThan(0);
expect(dashboardComponent.dashboardTypeSelected).toEqual('consolidated');
await dashboardComponent.initStep('','consolidated','rdmp','',1);
let groupedRecords = recordDataConsolidatedRelationships['groupedRecords'];
Expand Down
Loading
Loading