Skip to content

urbo-feature-legal 1.0.0-16956

Install from the command line:
Learn more about npm packages
$ npm install @sw-code/urbo-feature-legal@1.0.0-16956
Install via package.json:
"@sw-code/urbo-feature-legal": "1.0.0-16956"

About this version

feature-legal

This library provides legal-related functionality for the Urbo application, including privacy policy, legal notice, and license attribution.

Features

  • Privacy Policy page
  • Legal Notice page
  • License Attribution section
  • User data management

Customization

The legal module is designed to be fully customizable to accommodate different projects with varying legal requirements.

Basic Usage

Import the module in your app module:

import { FeatureLegalModule } from '@sw-code/urbo-feature-legal';

@NgModule({
  imports: [
    FeatureLegalModule.forRoot(),
    // other imports
  ],
})
export class AppModule {}

Customizing URLs and Licenses

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 {}

Advanced Customization

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 {}

Running unit tests

Run nx test feature-legal to execute the unit tests.

Details


Assets

  • urbo-feature-legal-1.0.0-16956.tgz

Download activity

  • Total downloads 0
  • Last 30 days 0
  • Last week 0
  • Today 0