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/time constraint add delete option #103

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
99496d7
added a reset date functionality
Shayan1375 Jul 17, 2023
38dd45b
added button to deselect all checkboxes at once
Shayan1375 Jul 21, 2023
e575884
reset and update time restriction after eventemitter signal
Shayan1375 Jul 24, 2023
7cbe2ff
Merge branch '95-adjust-ui-to-support-ontology-2.0' into feature/time…
Shayan1375 Sep 8, 2023
849ff1f
improved button disabled behaviour and new placement of button
Shayan1375 Sep 8, 2023
fbeab56
fix: lookup for object timeRestriction
Shayan1375 Sep 8, 2023
4a6adbd
new placement for reset button
Shayan1375 Sep 8, 2023
948b1ea
clean up
Shayan1375 Sep 8, 2023
96ee14a
implemented reset button for quantity
Shayan1375 Sep 11, 2023
f9b4ea9
Merge branch 'feature/reference_criteria_ontology-2.0' into feature/t…
Shayan1375 Sep 11, 2023
ba5cc63
Revert "Merge branch 'feature/reference_criteria_ontology-2.0' into f…
Shayan1375 Sep 11, 2023
4b7e8ec
added a reset date functionality
Shayan1375 Sep 19, 2023
5d68434
added button to deselect all checkboxes at once
Shayan1375 Jul 21, 2023
7959135
reset and update time restriction after eventemitter signal
Shayan1375 Jul 24, 2023
58341ea
improved button disabled behaviour and new placement of button
Shayan1375 Sep 8, 2023
cb276b0
fix: lookup for object timeRestriction
Shayan1375 Sep 8, 2023
9d516c7
new placement for reset button
Shayan1375 Sep 8, 2023
cc82fd1
clean up
Shayan1375 Sep 8, 2023
c6ce97b
implemented reset button for quantity
Shayan1375 Sep 11, 2023
14d2696
Revert "Merge branch 'feature/reference_criteria_ontology-2.0' into f…
Shayan1375 Sep 11, 2023
bb10546
Merge branch 'feature/time-constraint-add-delete-option' of https://g…
Shayan1375 Sep 19, 2023
d276ea9
fix merge conflicts
Shayan1375 Sep 19, 2023
d8a393d
resolving merge conflicts
Shayan1375 Sep 20, 2023
7f92fba
update to develop stack
Shayan1375 Sep 21, 2023
3899999
deselect all reference criteria as well
Shayan1375 Sep 21, 2023
1bfb7ad
reset selected concept after reset
Shayan1375 Sep 21, 2023
038c47e
minor spelling fix
Shayan1375 Sep 25, 2023
f993c67
differentiate between concept and reference
Shayan1375 Sep 25, 2023
a017540
clean up
Shayan1375 Oct 4, 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
5 changes: 1 addition & 4 deletions docker/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@
"TO": "vor {{ to }}",
"NONE": "keine zeitliche Einschränkung"
},
"REFERENCED_CRITERIA": "referenzierte Kriterien:",
"GROUPS": {
"LINKEDGROUPS": "Gruppen sind verbunden",
"SHOW_CONNECTION": "Beziehung anzeigen",
Expand Down Expand Up @@ -149,7 +148,6 @@
"HEADER_FILTER_CONCEPT_OPTIONAL": "Wählen Sie einen oder mehrere zulässige Werte:",
"HEADER_FILTER_CONCEPT_MANDATORY": "Geben Sie einen oder mehrere zulässige Werte an:",
"HEADER_FILTER_CONCEPT_FOR_DISPLAY": "Geben Sie einen oder mehrere zulässige Werte an ({{ label }}):",
"HEADER_FILTER_REFERENCE": "Festgestellte Diagnose",
"CHOOSE_GROUP":"Gruppe auswählen",
"MANDATORY_HINT": "Pflichtfeld",
"UNIT": "Einheit",
Expand Down Expand Up @@ -219,8 +217,7 @@
},
"LEGAL": {
"DISCLOSURE": "Impressum",
"DATAPROTECTION": "Datenschutz",
"CONTACT": "Kontakt"
"DATAPROTECTION": "Datenschutz"
},
"BUTTON": {
"SAVE": "Speichern",
Expand Down
5 changes: 1 addition & 4 deletions docker/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@
"TO": "before {{ to }}",
"NONE": "no time restriction"
},
"REFERENCED_CRITERIA": "referenced criteria:",
"GROUPS": {
"LINKEDGROUPS": "groups are linked",
"SHOW_CONNECTION": "show connection",
Expand Down Expand Up @@ -149,7 +148,6 @@
"HEADER_FILTER_CONCEPT_OPTIONAL": "Choose one or more valid values:",
"HEADER_FILTER_CONCEPT_MANDATORY": "Choose one or more valid values:",
"HEADER_FILTER_CONCEPT_FOR_DISPLAY": "Choose one or more valid values ({{ label }}):",
"HEADER_FILTER_REFERENCE": "observed diagnosis",
"CHOOSE_GROUP":"Choose a group",
"MANDATORY_HINT": "Mandatory field",
"UNIT": "Unit",
Expand Down Expand Up @@ -219,8 +217,7 @@
},
"LEGAL": {
"DISCLOSURE": "Disclosure",
"DATAPROTECTION": "Data Protection",
"CONTACT": "Contact"
"DATAPROTECTION": "Data Protection"
},
"BUTTON": {
"SAVE": "Save",
Expand Down
4 changes: 0 additions & 4 deletions src/app/layout/components/footer/footer.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
<a mat-button href="https://forschen-fuer-gesundheit.de/nutzungsbedingungen.php#datenschutz"
>{{ 'LEGAL.DATAPROTECTION' | translate }}
</a>
<mat-divider [vertical]="true"></mat-divider>
<a mat-button href="mailto:[email protected]"
>{{ 'LEGAL.CONTACT' | translate }}
</a>
</mat-toolbar-row>
<div class="version">Version {{ config.legal.version }}</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export class DisplayCritGroupComponent implements OnInit {
to: $event.container.data,
});
}

isLastSwitch(i: number): boolean {
let bool = true;
for (let x = i + 1; x < this.critGroup.length; x++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,3 @@
display: block;
margin: 0 auto;
}

.linked-header {
margin-top: 15px;
margin-bottom: 3px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
0 1px 5px 0 rgba(0, 0, 0, 0.12);
}
/*
.crit-box:hover {
border-color: var(--num-color--accent-A200);
border-left-color: var(--num-color--accent-A200);
}
.crit-box:hover .code-part {
background-color: var(--num-color--accent-300);
}
.crit-box:hover .cancel-button-wrapper {
background-color: var(--num-color--accent-300);
}
::ng-deep .crit-box:hover .container {
background-color: var(--num-color--accent-A300);
}*/
.crit-box:hover {
border-color: var(--num-color--accent-A200);
border-left-color: var(--num-color--accent-A200);
}
.crit-box:hover .code-part {
background-color: var(--num-color--accent-300);
}
.crit-box:hover .cancel-button-wrapper {
background-color: var(--num-color--accent-300);
}
::ng-deep .crit-box:hover .container {
background-color: var(--num-color--accent-A300);
}*/
.crit-box:active {
box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14),
0 3px 14px 2px rgba(0, 0, 0, 0.12);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ describe('DisplayLinkedCriterionComponent', () => {
await TestBed.configureTestingModule({
declarations: [DisplayLinkedCriterionComponent],
}).compileComponents();
});

beforeEach(() => {
fixture = TestBed.createComponent(DisplayLinkedCriterionComponent);
component = fixture.componentInstance;
fixture.detectChanges();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ <h4>
[query]="query"
></num-display-entities>
</ng-container>
<num-edit-time-restriction
*ngIf="featureService.useFeatureTimeRestriction()"
[timeRestriction]="criterion.timeRestriction"
></num-edit-time-restriction>
</mat-card-content>
<mat-card-footer>
<div fxLayout="row" fxLayoutAlign="center center">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

/* TODO(mdc-migration): The following rule targets internal classes of card that may no longer apply for the MDC version. */
mat-card {
margin: 1em 0.5em;
Expand Down Expand Up @@ -30,32 +31,7 @@ mat-card-content {
padding: 1em 0;
}
::ng-deep .mdc-menu-surface.mat-mdc-select-panel {
padding: 0 !important;
box-shadow: 0 2px 4px -1px #0003, 0 4px 5px #00000024, 0 1px 10px #0000001f;
padding: 0!important;
box-shadow: 0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f;
background: white;
}
mat-expansion-panel {
margin-top: 1em;
box-shadow: 0px 3px 1px -2px var(--num-color--accent-200),
0px 2px 2px 0px var(--num-color--accent-200), 0px 1px 5px 0px var(--num-color--accent-200) !important;
}
.mat-expansion-panel-header {
height: 48px;
}
.mat-expansion-panel-header-title {
font-size: 16px;
font-weight: normal;
}

::ng-deep .operator-part .mat-form-field-infix {
padding-top: 0.8em !important;
}
::ng-deep .operator-part .mat-select-arrow-wrapper {
transform: none !important;
}
.concept-list {
max-height: 8.1em;
padding: 0.1em;
margin-top: 5px;
overflow-y: auto;
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { CritGroupArranger, CritGroupPosition } from '../../../../controller/Cri
import { ObjectHelper } from '../../../../controller/ObjectHelper';
import { Subscription } from 'rxjs';
import { BackendService } from '../../../../service/backend.service';
import { TimeRestrictionType } from '../../../../model/api/query/timerestriction';
import { TimeRestrictionType, TimeRestriction } from '../../../../model/api/query/timerestriction';
import { TermEntry2CriterionTranslator } from 'src/app/modules/querybuilder/controller/TermEntry2CriterionTranslator';
import { TerminologyCode } from '../../../../model/api/terminology/terminology';

Expand Down Expand Up @@ -109,6 +109,7 @@ export class EditCriterionComponent implements OnInit, OnDestroy, AfterViewCheck
});
}
}

getTermcodeParameters(): string {
const termCode = this.criterion.termCodes[0];
const termCodeVersion = termCode.version ? '&version=' + termCode.version : '';
Expand All @@ -131,7 +132,7 @@ export class EditCriterionComponent implements OnInit, OnDestroy, AfterViewCheck
attrDefs = profile.attributeDefinitions;
}

this.criterion = this.translator.addAttributeAndValueFilterToCrit(
this.criterion = this.translator.translateCrit(
this.criterion,
profile.valueDefinition,
attrDefs
Expand All @@ -148,7 +149,6 @@ export class EditCriterionComponent implements OnInit, OnDestroy, AfterViewCheck
) {
this.initCriterion(profile);
}

if (profile.timeRestrictionAllowed && !this.criterion.timeRestriction) {
this.criterion.timeRestriction = { tvpe: TimeRestrictionType.BETWEEN };
}
Expand Down Expand Up @@ -183,7 +183,6 @@ export class EditCriterionComponent implements OnInit, OnDestroy, AfterViewCheck
}
}
});

this.loadAllowedCriteria();
});
}
Expand Down Expand Up @@ -242,6 +241,10 @@ export class EditCriterionComponent implements OnInit, OnDestroy, AfterViewCheck
this.discard.emit();
}

resetTimeRestriction() {
this.criterion.timeRestriction = new TimeRestriction();
}

isActionDisabled(): boolean {
const addibleTemp =
!this.valueFilterComponents ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export class EditSingleCriterionComponent implements OnInit {

doSave(event: { groupId: number }): void {
const index = this.queryModified.groups.findIndex((group) => group.id === event.groupId);

if (index < 0) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
<mat-panel-title>
{{ 'QUERYBUILDER.EDIT.TIMERESTRICTION.TITLE' | translate }}
</mat-panel-title>
<num-button
[type]="'primary'"
(click)="resetDate() && !disableReset; $event.stopPropagation()"
fxLayoutAlign="end"
[isDisabled]="disableReset"
>
{{ 'BUTTON.RESET' | translate }}
</num-button>
</mat-expansion-panel-header>
<div>
<mat-form-field appearance="outline" class="operator-part">
Expand All @@ -33,7 +41,12 @@
<mat-label *ngIf="timeRestriction.tvpe !== timeRestrictionType.BETWEEN">{{
'QUERYBUILDER.EDIT.TIMERESTRICTION.' + timeRestriction.tvpe | translate
}}</mat-label>
<input matInput [matDatepicker]="dateStartPicker" [(ngModel)]="timeRestriction.minDate" />
<input
matInput
[matDatepicker]="dateStartPicker"
[(ngModel)]="timeRestriction.minDate"
(dateChange)="disableReset = false"
/>
<mat-datepicker-toggle matSuffix [for]="dateStartPicker"></mat-datepicker-toggle>
<mat-datepicker #dateStartPicker></mat-datepicker>
</mat-form-field>
Expand All @@ -43,7 +56,12 @@
appearance="outline"
>
<mat-label>{{ 'QUERYBUILDER.EDIT.TIMERESTRICTION.TO' | translate }}</mat-label>
<input matInput [matDatepicker]="dateEndPicker" [(ngModel)]="timeRestriction.maxDate" />
<input
matInput
[matDatepicker]="dateEndPicker"
[(ngModel)]="timeRestriction.maxDate"
(dateChange)="disableReset = false"
/>
<mat-datepicker-toggle matSuffix [for]="dateEndPicker"></mat-datepicker-toggle>
<mat-datepicker #dateEndPicker></mat-datepicker>
</mat-form-field>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AfterViewInit, Component, Input, OnInit } from '@angular/core';
import { AfterViewInit, Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { TimeRestriction, TimeRestrictionType } from '../../../../model/api/query/timerestriction';
import { MAT_DATE_FORMATS } from '@angular/material/core';

Expand All @@ -24,10 +24,15 @@ export class EditTimeRestrictionComponent implements OnInit, AfterViewInit {
@Input()
timeRestriction: TimeRestriction;

@Output()
doResetTimeRestriction = new EventEmitter<boolean>();

timeRestrictionOptions = Object.keys(TimeRestrictionType);
timeRestrictionType: typeof TimeRestrictionType = TimeRestrictionType;
disableAnimation = true;

disableReset = true;

constructor() {}

ngOnInit(): void {}
Expand All @@ -36,5 +41,17 @@ export class EditTimeRestrictionComponent implements OnInit, AfterViewInit {
ngAfterViewInit(): void {
// timeout required to avoid the dreaded 'ExpressionChangedAfterItHasBeenCheckedError'
setTimeout(() => (this.disableAnimation = false));
if ((this.timeRestriction?.minDate || this.timeRestriction?.maxDate) !== undefined) {
this.disableReset = false;
}
}

resetDate() {
if ((this.timeRestriction.minDate || this.timeRestriction.maxDate) !== undefined) {
this.disableReset = false;
this.timeRestriction = new TimeRestriction();
this.doResetTimeRestriction.emit();
}
this.disableReset = true;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div [formGroup]="checkedControlForm" class="checkbox-line">
<mat-checkbox (click)="doSelectConcept()" formControlName="checkedControl">
<!--{{ concept.code }} - -->
<mat-checkbox [(ngModel)]="checked" (click)="doSelectConcept()" formControlName="checkedControl">
<!--{{ concept.code }} - -->
{{ concept.display }}
</mat-checkbox>
</div>
Loading