feat: include font licenses in the licenses section

This commit is contained in:
Thea Schöbl
2022-08-08 14:05:30 +00:00
committed by Rainer Killinger
parent a4de628495
commit 82479f463c
10 changed files with 113 additions and 71 deletions

View File

@@ -27,3 +27,18 @@ export function pick<T extends object, U extends keyof T>(
return accumulator;
}, {} as Pick<T, U>);
}
/**
* Pick a set of properties from an object using a predicate function
*/
export function pickBy<T extends object, U extends keyof T>(
object: T,
predicate: (value: T[U], key: U) => boolean,
): Pick<T, U> {
return (Object.keys(object) as U[]).reduce((accumulator, key) => {
if (predicate(object[key], key)) {
accumulator[key] = object[key];
}
return accumulator;
}, {} as Pick<T, U>);
}

View File

@@ -25,7 +25,6 @@ export interface License {
publisher?: string;
email?: string;
url?: string;
path: string;
licenseText?: string;
}
@@ -58,12 +57,6 @@ export class AboutLicensesComponent implements OnInit {
}
loadLicenses(): License[] {
return Object.values(licensesFile as Record<string, object>).map(
(value, key) =>
({
name: key,
...value,
} as unknown as License),
);
return licensesFile as License[];
}
}

View File

@@ -1,21 +1,22 @@
/*
* Copyright (C) 2021 StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
* Copyright (C) 2022 StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {Component, OnInit} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {SCAboutPage, SCAppConfiguration} from '@openstapps/core';
import {ConfigProvider} from '../../config/config.provider';
import packageJson from '../../../../../package.json';
@Component({
selector: 'about-page',
@@ -25,6 +26,8 @@ import {ConfigProvider} from '../../config/config.provider';
export class AboutPageComponent implements OnInit {
content: SCAboutPage;
version = packageJson.version;
constructor(
private readonly route: ActivatedRoute,
private readonly configProvider: ConfigProvider,

View File

@@ -1,16 +1,16 @@
<!--
~ Copyright (C) 2021 StApps
~ This program is free software: you can redistribute it and/or modify it
~ under the terms of the GNU General Public License as published by the Free
~ Software Foundation, version 3.
~ Copyright (C) 2022 StApps
~ This program is free software: you can redistribute it and/or modify it
~ under the terms of the GNU General Public License as published by the Free
~ Software Foundation, version 3.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-header>
@@ -32,6 +32,7 @@
</ion-toolbar>
</ion-header>
<ion-content *ngIf="content">
<pre>StApps v{{ version }}</pre>
<about-page-content
*ngFor="let element of content.content"
[content]="element"

File diff suppressed because one or more lines are too long