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

cascading delete #2041

Merged
merged 65 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
f7ab6ed
add test cases for cascading delete
sleidig Oct 18, 2023
abd5dbb
implement recursive delete of related entities
sleidig Oct 18, 2023
11d1f86
undo for all affected entities
sleidig Oct 19, 2023
0f4c0f6
add entity-schema-field flag for aggregate / composite association ty…
sleidig Oct 20, 2023
11fc6e0
mark some entity types as not hasPII, to exclude them from anonymization
sleidig Oct 20, 2023
6e00719
Update src/app/core/entity/entity-remove.service.spec.ts
sleidig Oct 30, 2023
5eca25f
Merge branch 'master' into anon-3
sleidig Oct 30, 2023
3076004
Update src/app/core/entity/schema/entity-schema-field.ts
sleidig Oct 30, 2023
288720c
make hasPII default "false"
sleidig Oct 30, 2023
58f9920
remove duplicate copy in cascading logic
sleidig Oct 30, 2023
6ae2f4c
reduce un-related changes in this PR
sleidig Oct 30, 2023
0dcf73b
update docs
sleidig Oct 30, 2023
c2dac7b
refactor: split entity-remove service into separate parts and create …
sleidig Oct 31, 2023
3c63872
Merge remote-tracking branch 'origin/master' into anon-3
sleidig Oct 31, 2023
4f49897
tests
sleidig Nov 2, 2023
eb30ff3
fixed tests to correctly check for status of entity
TheSlimvReal Nov 6, 2023
61a81bb
Update src/app/child-dev-project/schools/model/school.ts
sleidig Nov 7, 2023
2053c9f
clarify explanation comment
sleidig Nov 7, 2023
ee9ba6a
feat(*): allow to export only displayed, filtered data (#2059)
brajesh-lab Nov 6, 2023
498387f
feat(*): duplicate records from list views (#2042)
brajesh-lab Nov 6, 2023
e18cb08
refactor: lint check for prettier formatting (#2039)
rudresh Nov 6, 2023
995e85b
Merge branch 'master' into anon-3
sleidig Nov 7, 2023
b629b4d
fix test side-effects
sleidig Nov 7, 2023
2dc7d88
fix cascading tests
sleidig Nov 7, 2023
8a45a8e
simplify undo test setup
sleidig Nov 7, 2023
e651353
popup to warn user if some PII may need manual review
sleidig Nov 7, 2023
1fd139b
fix problems with advance multi-ref cascades
sleidig Nov 7, 2023
641df62
fine tuning from real-life testing
sleidig Nov 7, 2023
5fa37c7
fix prettier
sleidig Nov 7, 2023
c085c24
removed unnecessary overrides
TheSlimvReal Nov 8, 2023
474d3b1
Merge branch 'master' into anon-3
sleidig Nov 10, 2023
d3553d7
fix undo actions
sleidig Nov 10, 2023
5dfbeed
refactor: remove custom implementation for activities-overview
sleidig Nov 10, 2023
86448de
fix(core): subrecord lists update for external changes in real-time
sleidig Nov 10, 2023
71190b6
Merge branch 'subrecord-update-subscr' into anon-3
sleidig Nov 10, 2023
13e9752
progress dialog while (long-running) delete and anonymize actions are…
sleidig Nov 10, 2023
c84bf51
fix(ui): tooltip explaining disabled report calculation button (#2072)
sleidig Nov 13, 2023
025e4fc
fix: panels are only initialized once (#2071)
TheSlimvReal Nov 13, 2023
7f5841b
deps: upgrade multiple dependencies with Snyk (#2070)
sleidig Nov 13, 2023
0fa6b6b
build(deps-dev): bump axios from 1.5.1 to 1.6.1 (#2074)
dependabot[bot] Nov 13, 2023
91999c0
Merge branch 'master' into anon-3
sleidig Nov 14, 2023
fe622d0
fix forceOverwrite implementation return value for putAll
sleidig Nov 14, 2023
1712d11
fix tests
sleidig Nov 14, 2023
1cda158
properly anonymize ASER and Todo entities
sleidig Nov 14, 2023
9dc8ff5
only show one toggle for archived todos
sleidig Nov 14, 2023
c069b3b
don't display "no active entries" button while still loading
sleidig Nov 14, 2023
8848621
exclude archived participants from roll call
sleidig Nov 14, 2023
5e5947c
display indicator if date partially anonymized
sleidig Nov 14, 2023
8b7447f
simplified anon warning text (a little bit)
sleidig Nov 14, 2023
df1ecf2
Merge remote-tracking branch 'origin/master' into anon-3
sleidig Nov 14, 2023
63d4a2b
adapted delete warning text
sleidig Nov 15, 2023
1357bda
Merge branch 'master' into anon-3
sleidig Nov 15, 2023
56c4e41
correct position for code comment
sleidig Nov 19, 2023
3895d38
fix: upgrade keycloak-js from 22.0.4 to 22.0.5 (#2079)
sleidig Nov 16, 2023
7835e87
fix: controls correctly detect edited state (#2076)
TheSlimvReal Nov 16, 2023
843addc
deps: upgrade multiple dependencies with Snyk (#2082)
TheSlimvReal Nov 18, 2023
e7c0225
fix: upgrade @sentry/browser from 7.75.0 to 7.75.1 (#2083)
TheSlimvReal Nov 18, 2023
9f37db6
fix: upgrade flag-icons from 6.11.1 to 6.11.2 (#2084)
TheSlimvReal Nov 19, 2023
4e9f6a3
fix(dashboard): attendance weeks only start from Monday
sleidig Nov 19, 2023
2c3691a
fix: notes have attachments
TheSlimvReal Nov 16, 2023
4d20a42
fix: file attachments can be viewed in edit mode also
sleidig Nov 19, 2023
830bc9d
fix(forms): create new dropdown options from popup config window (#2040)
sadaf895 Nov 19, 2023
42fc02e
fix: new columns correctly trigger input update (#2085)
TheSlimvReal Nov 19, 2023
9bcfbb0
show inactive for anonymized
sleidig Nov 19, 2023
7b39f5d
Merge branch 'master' into anon-3
sleidig Nov 19, 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<ng-container
*ngIf="!(displayAsAnonymized || isPartiallyAnonymized); else anonymized"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit annoying, that both of these properties are necessary. Every component that is also used in templates will have to implement both which is a bit against the idea that they can be used everywhere.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, agreed. I wanted to reuse date-component's template for how month-component is displaying. Unfortunately isPartiallyAnonymized doubling as an @Input just gets overwritten ...

>
{{ value | date: config }}
</ng-container>

<ng-template #anonymized>
{{ value | date: "YYYY" }}
<fa-icon
icon="warning"
matTooltip="This data has been partially anonymized."
i18n-matTooltip
></fa-icon>
</ng-template>
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Component } from "@angular/core";
import { Component, Input } from "@angular/core";
import { ViewDirective } from "../../../entity/default-datatype/view.directive";
import { DynamicComponent } from "../../../config/dynamic-components/dynamic-component.decorator";
import { DatePipe } from "@angular/common";
import { DatePipe, NgIf } from "@angular/common";
import { FontAwesomeModule } from "@fortawesome/angular-fontawesome";
import { MatTooltipModule } from "@angular/material/tooltip";

/**
* This component displays a date attribute using the shortDate format.
Expand All @@ -12,8 +14,13 @@ import { DatePipe } from "@angular/common";
@DynamicComponent("DisplayDate")
@Component({
selector: "app-display-date",
template: `{{ value | date: config }}`,
templateUrl: "./display-date.component.html",
standalone: true,
imports: [DatePipe],
imports: [DatePipe, NgIf, FontAwesomeModule, MatTooltipModule],
})
export class DisplayDateComponent extends ViewDirective<Date, string> {}
export class DisplayDateComponent extends ViewDirective<Date, string> {
@Input() displayAsAnonymized: boolean;

/** formatting string for date pipe */
@Input() config: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
[formControlName]="formControlName"
[matDatepicker]="datepickerComp"
/>

<fa-icon
*ngIf="isPartiallyAnonymized"
matIconSuffix
icon="warning"
matTooltip="This data has been partially anonymized."
i18n-matTooltip
></fa-icon>

<mat-datepicker-toggle
matIconSuffix
[for]="datepickerComp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import { MatInputModule } from "@angular/material/input";
import { ReactiveFormsModule } from "@angular/forms";
import { MatDatepickerModule } from "@angular/material/datepicker";
import { ErrorHintComponent } from "../../../common-components/error-hint/error-hint.component";
import { FontAwesomeModule } from "@fortawesome/angular-fontawesome";
import { MatTooltipModule } from "@angular/material/tooltip";
import { NgIf } from "@angular/common";

@DynamicComponent("EditDate")
@Component({
Expand All @@ -17,6 +20,9 @@ import { ErrorHintComponent } from "../../../common-components/error-hint/error-
ReactiveFormsModule,
MatDatepickerModule,
ErrorHintComponent,
FontAwesomeModule,
MatTooltipModule,
NgIf,
],
standalone: true,
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { Component } from "@angular/core";
import { DatePipe } from "@angular/common";
import { DatePipe, NgIf } from "@angular/common";
import { ViewDirective } from "../../../entity/default-datatype/view.directive";
import { DisplayDateComponent } from "../../date/display-date/display-date.component";

@Component({
selector: "app-display-month",
standalone: true,
template: `{{ value | date: "YYYY-MM" }}`,
imports: [DatePipe],
template: `<app-display-date
[value]="value"
[config]="'YYYY-MM'"
[displayAsAnonymized]="isPartiallyAnonymized"
></app-display-date>`,
imports: [DatePipe, NgIf, DisplayDateComponent],
})
export class DisplayMonthComponent extends ViewDirective<Date> {}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
[formControl]="formControl"
[matDatepicker]="datepickerComp"
/>

<fa-icon
*ngIf="isPartiallyAnonymized"
matIconSuffix
icon="warning"
matTooltip="This data has been partially anonymized."
i18n-matTooltip
></fa-icon>

<mat-datepicker-toggle
matIconSuffix
[for]="datepickerComp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import {
MAT_MOMENT_DATE_ADAPTER_OPTIONS,
MomentDateAdapter,
} from "@angular/material-moment-adapter";
import { FontAwesomeModule } from "@fortawesome/angular-fontawesome";
import { MatTooltipModule } from "@angular/material/tooltip";

export const MY_FORMATS = {
parse: {
Expand All @@ -42,6 +44,8 @@ export const MY_FORMATS = {
MatDatepickerModule,
ReactiveFormsModule,
ErrorHintComponent,
FontAwesomeModule,
MatTooltipModule,
],
templateUrl: "./edit-month.component.html",
styleUrls: ["./edit-month.component.scss"],
Expand Down
10 changes: 10 additions & 0 deletions src/app/core/entity/default-datatype/edit-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ export abstract class EditComponent<T> implements OnInit {
*/
additional?: any;

/** indicating that the value is not in its original state, so that components can explain this to the user */
isPartiallyAnonymized: boolean;

ngOnInit() {
if (!this.formFieldConfig?.forTable) {
this.label = this.formFieldConfig?.label ?? this.propertySchema?.label;
Expand All @@ -68,4 +71,11 @@ export abstract class EditComponent<T> implements OnInit {
// This type casts are needed as the normal types throw errors in the templates
this.parent = this.formControl.parent as FormGroup;
}

ngOnChanges() {
this.isPartiallyAnonymized =
this.entity?.anonymized &&
this.entity?.getSchema()?.get(this.formFieldConfig?.id)?.anonymize ===
"retain-anonymized";
}
}
13 changes: 11 additions & 2 deletions src/app/core/entity/default-datatype/view.directive.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
import { Entity } from "../model/entity";
import { Directive, Input } from "@angular/core";
import { Directive, Input, OnChanges } from "@angular/core";

@Directive()
export abstract class ViewDirective<T, C = any> {
export abstract class ViewDirective<T, C = any> implements OnChanges {
@Input() entity: Entity;
@Input() id: string;
@Input() tooltip: string;
@Input() value: T;
@Input() config: C;

/** indicating that the value is not in its original state, so that components can explain this to the user */
isPartiallyAnonymized: boolean;

ngOnChanges() {
this.isPartiallyAnonymized =
this.entity?.anonymized &&
this.entity?.getSchema()?.get(this.id)?.anonymize === "retain-anonymized";
}
}