urbo-feature-legal 1.0.0-17106
Install from the command line:
Learn more about npm packages
$ npm install @sw-code/urbo-feature-legal@1.0.0-17106
Install via package.json:
"@sw-code/urbo-feature-legal": "1.0.0-17106"
About this version
This library provides legal-related functionality for the Urbo application, including privacy policy, legal notice, and license attribution.
- Privacy Policy page
- Legal Notice page
- License Attribution section
- User data management
The legal module is designed to be fully customizable to accommodate different projects with varying legal requirements.
Import the module in your app module:
import { FeatureLegalModule } from '@sw-code/urbo-feature-legal';
@NgModule({
imports: [
FeatureLegalModule.forRoot(),
// other imports
],
})
export class AppModule {}You can customize the privacy policy URL, legal notice URL, and license sections by providing configuration options to the forRoot method:
import { FeatureLegalModule, LicenseInfo } from '@sw-code/urbo-feature-legal';
// Define custom license sections
const customLicenses: LicenseInfo[] = [
{
title: 'My Custom Font', // Generic title (required)
titleDe: 'Meine benutzerdefinierte Schriftart', // German title (required)
titleEn: 'My Custom Font', // English title (required)
// All language-specific texts are required
textEn:
'My Custom Font is used under the <a href="https://example.com/license" target="_blank">Example License</a>.',
textDe:
'My Custom Font wird unter der <a href="https://example.com/license" target="_blank">Example License</a> verwendet.',
// Note: German text is used as fallback when displaying in English UI if English text is not available
},
{
title: 'Another Library',
titleDe: 'Eine andere Bibliothek',
titleEn: 'Another Library',
textEn: 'Another Library is used under the MIT License.',
textDe: 'Another Library wird unter der MIT-Lizenz verwendet.',
},
// Add more license sections as needed
];
@NgModule({
imports: [
FeatureLegalModule.forRoot({
privacyPolicyUrl: 'https://example.com/privacy-policy',
legalNoticeUrl: 'https://example.com/legal-notice',
licenseSections: customLicenses,
}),
// other imports
],
})
export class AppModule {}For more advanced customization, you can provide your own implementations of the injection tokens:
import {
FeatureLegalModule,
PRIVACY_POLICY_URL,
LEGAL_NOTICE_URL,
LICENSE_SECTIONS,
} from '@sw-code/urbo-feature-legal';
@NgModule({
imports: [
FeatureLegalModule,
// other imports
],
providers: [
{ provide: PRIVACY_POLICY_URL, useValue: 'https://example.com/privacy-policy' },
{ provide: LEGAL_NOTICE_URL, useValue: 'https://example.com/legal-notice' },
{
provide: LICENSE_SECTIONS,
useValue: [
{
title: 'My Custom Font', // Generic title (required)
titleDe: 'Meine benutzerdefinierte Schriftart', // German title (required)
titleEn: 'My Custom Font', // English title (required)
// All language-specific texts are required
textEn:
'My Custom Font is used under the <a href="https://example.com/license" target="_blank">Example License</a>.',
textDe:
'My Custom Font wird unter der <a href="https://example.com/license" target="_blank">Example License</a> verwendet.',
// Note: German text is used as fallback when displaying in English UI if English text is not available
},
// Add more license sections as needed
],
},
],
})
export class AppModule {}Run nx test feature-legal to execute the unit tests.