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

Anonymization & Archive functionality #2012

Merged
merged 38 commits into from
Oct 18, 2023
Merged

Anonymization & Archive functionality #2012

merged 38 commits into from
Oct 18, 2023

Conversation

sleidig
Copy link
Member

@sleidig sleidig commented Sep 25, 2023

see #1674 (and #899)

UX Changes

  • Entity Details context (three-dot menu) items to "anonymize" and "archive" in addition to "delete" (+ extensive confirmation dialogs
  • inactive records always hidden by default + toggle to include always available below table
  • info box in Entity Details for archived + anonymized records
  • anonymization logic

Tasks

  • after refactor(core): simplify entity-remove service #2011
  • create a unit testing setup
  • define all test cases
  • trigger anonymization logic
  • implement special "retain-anonymized" logic in datatype implementations
  • entity actions menu with "anonymize" option
  • display info box if archived/anonymized (both popup + entity details component, ...)
  • update Entity.isActive to ensure it always prioritizes the "archive" functionality (do we need a migration?)
    • ❓ what about logic for Todo and TimePeriod?
  • default filter for isActive on all lists? (or a way to very easily activate it in config)
  • somehow need to trigger an update to the entity details view after anonymize improve applyChanges of forms for entityUpdates
  • delete file attachments
  • create a new permissions "anonymize"
  • documentation
  • cascading anonymization of related records (--> will be done in separate PR)

sleidig and others added 2 commits September 25, 2023 17:49
in preparation of implementing anonymization (#1674)

---------
This functionality has been developed for the project “codo”.
codo is developed under the projects “Landungsbrücken – Patenschaften in Hamburg stärken” and “openTransfer Patenschaften”. It is funded through the program “Menschen stärken Menschen” by the German Federal Ministry of Family Affairs, Senior Citizens, Women and Youth.
More information at https://github.com/codo-mentoring

“Landungsbrücken – Patenschaften in Hamburg stärken” is a project of BürgerStiftung Hamburg in cooperation with the Mentor.Ring Hamburg. With a mix of networking opportunities, capacity building and financial support the project strengthens Hamburg’s scene of mentoring projects since its founding in 2016.

The “Stiftung Bürgermut” foundation since 2007 supports the digital and real exchange of experiences and connections of active citizens. Within the federal program “Menschen stärken Menschen” the foundation as part of its program “openTransfer Patenschaften” offers support services for connecting, spreading and upskilling mentoring organisations across Germany.

Diese Funktion wurde entwickelt für das Projekt codo.
codo wird entwickelt im Rahmen der Projekte Landungsbrücken – Patenschaften in Hamburg stärken und openTransfer Patenschaften. Er ist gefördert durch das Bundesprogramm Menschen stärken Menschen des Bundesministeriums für Familie, Senioren, Frauen und Jugend.
Mehr Informationen unter https://github.com/codo-mentoring

“Landungsbrücken – Patenschaften in Hamburg stärken” ist ein Projekt der BürgerStiftung Hamburg in Kooperation mit dem Mentor.Ring Hamburg. Mit einer Mischung aus Vernetzungsangeboten, Qualifizierungsmaßnahmen und finanzieller Förderung stärkt das Projekt die Hamburger Szene der Patenschaftsprojekte seit der Gründung im Jahr 2016.

Die Stiftung Bürgermut fördert seit 2007 den digitalen und realen Erfahrungsaustausch und die Vernetzung von engagierten Bürger:innen. Innerhalb des Bundesprogramms „Menschen stärken Menschen” bietet die Stiftung im Rahmen ihres Programms openTransfer Patenschaften Unterstützungsleistungen zur Vernetzung, Verbreitung und Qualifizierung von Patenschafts- und Mentoringorganisationen bundesweit.

Co-authored-by: codo-mentoring <117934638+codo-mentoring@users.noreply.github.com>
@github-actions
Copy link

Deployed to https://pr-2012.aam-digital.net/

sleidig and others added 10 commits October 4, 2023 14:52
# Conflicts:
#	src/app/core/entity/entity-remove.service.spec.ts
#	src/app/core/entity/entity-remove.service.ts
+ full test cases (except cascading related)
…erty

---------
This functionality has been developed for the project “codo”.
codo is developed under the projects “Landungsbrücken – Patenschaften in Hamburg stärken” and “openTransfer Patenschaften”. It is funded through the program “Menschen stärken Menschen” by the German Federal Ministry of Family Affairs, Senior Citizens, Women and Youth.
More information at https://github.com/codo-mentoring

“Landungsbrücken – Patenschaften in Hamburg stärken” is a project of BürgerStiftung Hamburg in cooperation with the Mentor.Ring Hamburg. With a mix of networking opportunities, capacity building and financial support the project strengthens Hamburg’s scene of mentoring projects since its founding in 2016.

The “Stiftung Bürgermut” foundation since 2007 supports the digital and real exchange of experiences and connections of active citizens. Within the federal program “Menschen stärken Menschen” the foundation as part of its program “openTransfer Patenschaften” offers support services for connecting, spreading and upskilling mentoring organisations across Germany.

Diese Funktion wurde entwickelt für das Projekt codo.
codo wird entwickelt im Rahmen der Projekte Landungsbrücken – Patenschaften in Hamburg stärken und openTransfer Patenschaften. Er ist gefördert durch das Bundesprogramm Menschen stärken Menschen des Bundesministeriums für Familie, Senioren, Frauen und Jugend.
Mehr Informationen unter https://github.com/codo-mentoring

“Landungsbrücken – Patenschaften in Hamburg stärken” ist ein Projekt der BürgerStiftung Hamburg in Kooperation mit dem Mentor.Ring Hamburg. Mit einer Mischung aus Vernetzungsangeboten, Qualifizierungsmaßnahmen und finanzieller Förderung stärkt das Projekt die Hamburger Szene der Patenschaftsprojekte seit der Gründung im Jahr 2016.

Die Stiftung Bürgermut fördert seit 2007 den digitalen und realen Erfahrungsaustausch und die Vernetzung von engagierten Bürger:innen. Innerhalb des Bundesprogramms „Menschen stärken Menschen” bietet die Stiftung im Rahmen ihres Programms openTransfer Patenschaften Unterstützungsleistungen zur Vernetzung, Verbreitung und Qualifizierung von Patenschafts- und Mentoringorganisationen bundesweit.

---------

Co-authored-by: codo-mentoring <117934638+codo-mentoring@users.noreply.github.com>
…erty

---------
This functionality has been developed for the project “codo”.
codo is developed under the projects “Landungsbrücken – Patenschaften in Hamburg stärken” and “openTransfer Patenschaften”. It is funded through the program “Menschen stärken Menschen” by the German Federal Ministry of Family Affairs, Senior Citizens, Women and Youth.
More information at https://github.com/codo-mentoring

“Landungsbrücken – Patenschaften in Hamburg stärken” is a project of BürgerStiftung Hamburg in cooperation with the Mentor.Ring Hamburg. With a mix of networking opportunities, capacity building and financial support the project strengthens Hamburg’s scene of mentoring projects since its founding in 2016.

The “Stiftung Bürgermut” foundation since 2007 supports the digital and real exchange of experiences and connections of active citizens. Within the federal program “Menschen stärken Menschen” the foundation as part of its program “openTransfer Patenschaften” offers support services for connecting, spreading and upskilling mentoring organisations across Germany.

Diese Funktion wurde entwickelt für das Projekt codo.
codo wird entwickelt im Rahmen der Projekte Landungsbrücken – Patenschaften in Hamburg stärken und openTransfer Patenschaften. Er ist gefördert durch das Bundesprogramm Menschen stärken Menschen des Bundesministeriums für Familie, Senioren, Frauen und Jugend.
Mehr Informationen unter https://github.com/codo-mentoring

“Landungsbrücken – Patenschaften in Hamburg stärken” ist ein Projekt der BürgerStiftung Hamburg in Kooperation mit dem Mentor.Ring Hamburg. Mit einer Mischung aus Vernetzungsangeboten, Qualifizierungsmaßnahmen und finanzieller Förderung stärkt das Projekt die Hamburger Szene der Patenschaftsprojekte seit der Gründung im Jahr 2016.

Die Stiftung Bürgermut fördert seit 2007 den digitalen und realen Erfahrungsaustausch und die Vernetzung von engagierten Bürger:innen. Innerhalb des Bundesprogramms „Menschen stärken Menschen” bietet die Stiftung im Rahmen ihres Programms openTransfer Patenschaften Unterstützungsleistungen zur Vernetzung, Verbreitung und Qualifizierung von Patenschafts- und Mentoringorganisationen bundesweit.

---------

Co-authored-by: codo-mentoring <117934638+codo-mentoring@users.noreply.github.com>
# Conflicts:
#	src/app/core/common-components/entity-form/entity-form/entity-form.component.ts
@sleidig sleidig changed the title Anonymization - step 2 Anonymization & Archive functionality Oct 11, 2023
@sleidig sleidig changed the base branch from master to fix-apply-changes October 11, 2023 13:34
@sleidig sleidig marked this pull request as ready for review October 11, 2023 13:50
@sleidig sleidig requested a review from TheSlimvReal October 11, 2023 13:50
Copy link
Collaborator

@TheSlimvReal TheSlimvReal left a comment

Choose a reason for hiding this comment

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

I really like how most of the anonymization/archiving logic is found in very few places. Really good approach to it. The entity remove service gets quite big, especially all the tests around anonymization. But I also see the shared logic between the functions.

return value;
}

await this.removeService.anonymize(referencedEntity);
Copy link
Collaborator

Choose a reason for hiding this comment

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

In my understanding, this is only called if the property is marked as retain:anonymized. So in the retain case, no cascading action would happen. Is this expected?

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, the logic for direct references (indirect for cascading action are not implemented here yet) currently would be:

  • "retain" -> keep unchanged
  • "remove" (i.e. no explicit anonymize action configured) -> reference removed, related entity kept unchanged (:question: maybe not always what we want)
  • "retain-anonymized" -> trigger "cascading" anonymization (and keep reference)

This is probably not always what is expected ... I would postpone this to the overall implementation of complete cascading anonymization, however. (tagged this comment explicitly in #220 now)

@@ -562,15 +562,6 @@ export const defaultJsonConfig = {
]
},
"filters": [
{
Copy link
Collaborator

Choose a reason for hiding this comment

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

Needs a migration to remove this from all instances?

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, probably important - the filter will be broken with a default of showInactive = false automatically applied as well.

src/app/core/entity/entity-remove.service.spec.ts Outdated Show resolved Hide resolved
src/app/core/entity/entity-remove.service.spec.ts Outdated Show resolved Hide resolved
src/app/core/entity/entity-remove.service.spec.ts Outdated Show resolved Hide resolved
src/app/core/entity/schema/entity-schema-field.ts Outdated Show resolved Hide resolved
src/app/core/site-settings/site-settings.service.spec.ts Outdated Show resolved Hide resolved
sleidig and others added 5 commits October 16, 2023 11:16
Co-authored-by: Simon <simon@aam-digital.com>
Base automatically changed from fix-apply-changes to master October 16, 2023 09:40
Copy link
Collaborator

@TheSlimvReal TheSlimvReal left a comment

Choose a reason for hiding this comment

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

Thanks for the adjustments. Looks and feels very solid now.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It feels a little bit weird to talk give the annonymize option for recurring activities but then marking all fields as retain. Should we rather mark a whole entity as not-personal so that also the UI can hide this option and we don't have to worry about forgetting a property?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, actually had the exact same thought ... and for the cascading scenarios (#220 (comment)) we may need that also. Configuration options are growing explosively a bit, but I don't see good alternatives.

However, I think, I'd leave this as a TODO for the new PR.

@sleidig sleidig merged commit ad31e25 into master Oct 18, 2023
5 of 6 checks passed
@sleidig sleidig deleted the anon-2 branch October 18, 2023 15:23
@aam-digital-ci
Copy link
Collaborator

🎉 This PR is included in version 3.26.0-master.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@aam-digital-ci aam-digital-ci added the released on @master managed by CI (semantic-release) label Oct 18, 2023
@aam-digital-ci
Copy link
Collaborator

🎉 This PR is included in version 3.26.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@aam-digital-ci aam-digital-ci added the released managed by CI (semantic-release) label Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released on @master managed by CI (semantic-release) released managed by CI (semantic-release)
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants