Commit 4aba305c authored by René Rösner's avatar René Rösner
Browse files

Merge branch 'main' into feature/354-design-richtlinien

parents 92d9147c ea4c807a
# http://editorconfig.org
root = true
[*.{json, yaml, yml, md, mdx, js, jsx}]
end_of_line = lf
indent_size = 2
indent_style = space
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Files: .env.example .gitignore package.json README.md yarn.lock
ci/* components/* lib/contentful/* lib/utils/* lib/assets/data/* pages/* views/*.tsx styles/*.scss
Files: .env.example .editorconfig .gitignore package.json README.md
lib/contentful/* lib/utils/* lib/assets/data/*
yarn.lock ci/* components/* lib/* pages/* views/*.tsx styles/*.scss
public/*.png public/*.svg public/*.svg public/robots.txt
*.js *.ts
Copyright: 2022 FIT-Connect contributors
......@@ -9,4 +10,4 @@ License: EUPL-1.2
Files: lib/assets/fonts/Montserrat/*
Copyright: 2011 The Montserrat Project Authors
License: OFL-1.1
\ No newline at end of file
License: OFL-1.1
# Föderales Entwicklungsportal
# Federal Developer Portal (Förderales Entwicklungsportal)
<img src="public/img/kabelmaennchen_construct.svg" style="width:100px;"/>
The federal developer portal collects developer ressources (documatation, API specifications and code samples) about German government IT systems.
The developer portal bundles developer resources (documentation, API specifications and code samples) about German government IT systems.
The live version is available here: [https://docs.fitko.de](https://docs.fitko.de)
## How to build
// TODO
To build the developer portal locally [yarn package manager](https://yarnpkg.com/) is recommended.
## Licenses
### Preconditions
To install yarn:
```sh
npm install --global yarn
```
Before proceeding, double check if yarn is installed correctly:
```sh
yarn --version
```
### Development build
For the federal developer portal running in dev mode run:
```sh
yarn install
yarn dev
```
By default, the server runs on [http://localhost:3000](http://localhost:3000)
### Deployable build
Build a fully deployable export with:
```sh
yarn install
yarn export
```
The result is stored in a sub folder of project root called `out`.
## Continous Integration
Every incomming commit triggers our gitlab pipeline. For details check the configuration in the YAML file: `ci/gitlab-ci.yml`. In order to ensure a high code quality, static code analysis are triggered before deployment.
Licensing of the files works with a tool called Reuse. As soon as new files are added, the Reuse configuration(`.reuse/dep5`) must be extended accordingly.
## Licenses
Source code is licensed under the [EUPL](LICENSES/EUPL-1.2.txt).
Unless otherwise noted, the content of this website is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/).
Unless stated otherwise, the content of this website is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/).
......@@ -34,6 +34,12 @@ export type Tag = {
}
}
export type Filter = {
label: string,
id: string,
value: string,
}
export async function fetchServices(): Promise<Entry<any>[]> {
const services = await client.getEntries({
content_type: 'service',
......
import { Header } from '@/views/Service'
import Link from "next/link"
import { fetchServices, fetchService } from '@/lib/contentful'
import { fetchServices, fetchService, Filter, ServiceType, Tag } from '@/lib/contentful'
import { removeFromObjRecursive, replaceEmailsRecursive } from '@/lib/utils'
import { documentToHtmlString } from '@contentful/rich-text-html-renderer'
import { IconChevronLeft } from '@tabler/icons'
import filterData from '@/lib/assets/data/currentFilter.json'
function getServiceTag(service: ServiceType): Tag {
const ONLY_STATUS_TAG = 0
const statusTag = service.tags?.filter((tag: Tag) => tag.fields?.name.startsWith('status'))[ONLY_STATUS_TAG]
return statusTag
}
function getTagLabelValue(tag: Tag): string {
const ONLY_MATCHING_FILTER = 0
const TAG_LABEL_EXPRESSION = 1
const STATUS_FILTER_DEFINITION = 1
const tagLabelParts = tag?.fields?.name.split(':')
const statusFilter = tag ? filterData.filter[STATUS_FILTER_DEFINITION].options.filter((option: Filter) => option.id === tagLabelParts[TAG_LABEL_EXPRESSION]) : null
return statusFilter ? statusFilter[ONLY_MATCHING_FILTER].label : 'Unbekannt'
}
export default function ({ service }) {
const statusTag = getServiceTag(service)
const statusLabel = getTagLabelValue(statusTag)
return (
<div className={'mx-auto max-w-screen-xl'}>
<nav className="relative max-w-7xl flex">
......@@ -47,7 +68,7 @@ export default function ({ service }) {
name: service.developer.fields.name,
link: service.developer.fields.link,
}}
status={service.status}
statusLabel={statusLabel}
documentationURL={service.documentation}
sourceURL={service.sourcecodeURL}
resources={service.ressource?.map(resource => {return { name: resource.fields.name, slug: resource.fields.slug}})
......
......@@ -3,8 +3,6 @@ import Link from 'next/link'
import PageHeaderCard from '@/components/PageHeaderCard'
import { decodeEmail } from '@/lib/utils'
type ServiceStatus = 'Alpha' | 'Beta' | 'Live'
type HeaderOptions = {
title: string
description: string
......@@ -20,7 +18,7 @@ type HeaderOptions = {
name: string
mailTo: string
}
status: ServiceStatus
statusLabel: string
documentationURL: string
sourceURL?: string
tosURL?: string
......@@ -35,7 +33,7 @@ export function Header({
developer,
contact,
tosURL,
status,
statusLabel,
documentationURL,
sourceURL,
issuesURL,
......@@ -69,11 +67,11 @@ export function Header({
</dd>
</div>
)}
{status && (
{statusLabel && (
<div className="sm:col-span-1">
<dt className="text-sm font-medium text-gray-500">Status</dt>
<dd className="ml-0 mt-1 text-sm text-gray-900">
{status}
{statusLabel}
</dd>
</div>
)}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment