Skip to content

Conversation

@belfhi
Copy link

@belfhi belfhi commented Sep 8, 2025

Description

Adds a footer with two new icons, for a link to the privacy statement and to the imprint.
These are a requirement by our data protection officers at DESY.

Changes:

Adds two new configuration options for the frontend:

  • imprintUrl
  • privacyUrl

Summary by Sourcery

Add a privacy and imprint footer to the application by introducing a new component, exposing configuration options for the links, and integrating its styles into the global theme

New Features:

  • Introduce a footer component with Imprint and Privacy links
  • Add imprintUrl and privacyUrl options to application configuration

Enhancements:

  • Include the footer in the main layout and integrate its SCSS theme into global styles

Tests:

  • Update AppConfigService spec with new URL properties and add spec stub for the AppFooterComponent

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and found some issues that need to be addressed.

Blocking issues:

  • Assignment operator used instead of colon in object literal. (link)

General comments:

  • You need to declare AppFooterComponent in your LayoutModule (or convert it to a standalone component) so that is recognized by Angular.
  • There’s a typo in app-config.service.spec.ts using ‘imprintUrl =’ and ‘privacyUrl =’ instead of ‘:’, which will cause a syntax error in the test object literal.
  • The SCSS duplicates background-color definitions and uses !important; consider consolidating styles (e.g. merge theme and component SCSS) and remove !important for cleaner styling.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- You need to declare AppFooterComponent in your LayoutModule (or convert it to a standalone component) so that <app-app-footer> is recognized by Angular.
- There’s a typo in app-config.service.spec.ts using ‘imprintUrl =’ and ‘privacyUrl =’ instead of ‘:’, which will cause a syntax error in the test object literal.
- The SCSS duplicates background-color definitions and uses !important; consider consolidating styles (e.g. merge theme and component SCSS) and remove !important for cleaner styling.

## Individual Comments

### Comment 1
<location> `src/app/app-config.service.spec.ts:58` </location>
<code_context>
   multipleDownloadAction: "http://localhost:3012/zip",
   multipleDownloadEnabled: true,
   multipleDownloadUseAuthToken: false,
+  imprintUrl = "https://example.com/imprint",
+  privacyUrl = "https://example.com/privacy",
   oAuth2Endpoints: [],
   policiesEnabled: true,
</code_context>

<issue_to_address>
Assignment operator used instead of colon in object literal.

Please replace the equals sign with a colon to avoid syntax errors in the object literal.
</issue_to_address>

### Comment 2
<location> `src/app/_layout/app-footer/app-footer.component.html:11` </location>
<code_context>
+          class="toplink"
+          href="{{ imprintUrl }}"
+          target="_blank"
+          rel="noopener"
+        >
+          <mat-icon>description</mat-icon>
</code_context>

<issue_to_address>
Consider adding 'noreferrer' to rel attribute for external links.

This helps prevent referrer information from being shared with external sites.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
          rel="noopener"
=======
          rel="noopener noreferrer"
>>>>>>> REPLACE

</suggested_fix>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +58 to +59
imprintUrl = "https://example.com/imprint",
privacyUrl = "https://example.com/privacy",
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (bug_risk): Assignment operator used instead of colon in object literal.

Please replace the equals sign with a colon to avoid syntax errors in the object literal.

Copy link
Member

Choose a reason for hiding this comment

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

Please change as suggested

Copy link
Contributor

Choose a reason for hiding this comment

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

Absolutely! To fix the syntax error, update the appConfig object as follows:

const appConfig: AppConfigInterface = {
  multipleDownloadAction: "http://localhost:3012/zip",
  multipleDownloadEnabled: true,
  multipleDownloadUseAuthToken: false,
  imprintUrl: "https://example.com/imprint",
  privacyUrl: "https://example.com/privacy",
}

Just replace the equals signs (=) with colons (:) for imprintUrl and privacyUrl. This will resolve the issue.

class="toplink"
href="{{ imprintUrl }}"
target="_blank"
rel="noopener"
Copy link
Contributor

Choose a reason for hiding this comment

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

🚨 suggestion (security): Consider adding 'noreferrer' to rel attribute for external links.

This helps prevent referrer information from being shared with external sites.

Suggested change
rel="noopener"
rel="noopener noreferrer"

Copy link
Member

Choose a reason for hiding this comment

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

Please include the suggestion

Copy link
Contributor

Choose a reason for hiding this comment

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

Absolutely! To include the suggestion, update the rel attribute in your anchor tag as follows:

<a
  class="toplink"
  href="{{ imprintUrl }}"
  target="_blank"
  rel="noopener noreferrer"
>

This will ensure both security and privacy by preventing the new page from accessing the window object and by not sending referrer information. Let me know if you need help with anything else!

@Junjiequan
Copy link
Member

Could you include screentshots of the changes in the PR description?

@belfhi belfhi force-pushed the add-privacy-imprint-footer branch from da462c5 to 731e9e0 Compare October 2, 2025 10:44
@nitrosx
Copy link
Member

nitrosx commented Nov 6, 2025

Thanks @Junjiequan for the image
scicat_imprint_privacy

Copy link
Member

@nitrosx nitrosx left a comment

Choose a reason for hiding this comment

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

Please follow up to the requested changes.
Additional questions:

  • Is it requested by your data policy to show Imprint and Privacy in the footer or they can be shown also in the header?
  • What is the Imprint? Apologies for the ignorance
  • Please use localization when showing your options, so the labels can be easily changed
  • Do you need show both icon and text? should we include option to decide which either or both?

class="toplink"
href="{{ imprintUrl }}"
target="_blank"
rel="noopener"
Copy link
Member

Choose a reason for hiding this comment

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

Please include the suggestion

Comment on lines +2 to +5
// background: white;
// width: 100%;
// padding: 1rem;
// text-align: center;
Copy link
Member

Choose a reason for hiding this comment

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

Please remove the commented lines

Comment on lines +19 to +22
this.imprintUrl =
this.appConfig.imprintUrl || "https://example.com/imprint";
this.privacyUrl =
this.appConfig.privacyUrl || "https://example.com/privacy";
Copy link
Member

Choose a reason for hiding this comment

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

Please add explicit configuration option to enable/disable imprint and privacy

<div class="main">
<router-outlet></router-outlet>
</div>
<app-app-footer></app-app-footer>
Copy link
Member

Choose a reason for hiding this comment

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

Should we show the footer if nothing is shown in the footer

Comment on lines +58 to +59
imprintUrl = "https://example.com/imprint",
privacyUrl = "https://example.com/privacy",
Copy link
Member

Choose a reason for hiding this comment

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

Please change as suggested

Comment on lines +146 to +147
imprintUrl?: string;
privacyUrl?: string;
Copy link
Member

Choose a reason for hiding this comment

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

Add also explicit configuration options to enable/disable showing the imprint and the privacy.
Something like:

  • imprintEnable: true/false
  • privacyEnable: true/false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants