Skip to content
Snippets Groups Projects
Commit 93e58f68 authored by Andy Leuchtturm's avatar Andy Leuchtturm
Browse files

Merge branch 'feature/it-standards' of...

Merge branch 'feature/it-standards' of https://git.fitko.de/fit-connect/entwicklungsportal into feature/it-standards
parents dea362e8 f337e886
No related branches found
No related tags found
1 merge request!86planning#1203: Standards
......@@ -22,8 +22,7 @@ export default ({ status } : LifecylceOptions) => {
/>
</div>
)
}
else {
} else {
return (
<div className="border border-gray-300 rounded-lg overflow-hidden p-2">
#INVALID! (tags.status)
......
......@@ -8,14 +8,13 @@ import { InfoBoxes } from '@/views/it-standards/InfoBoxes'
import useContent from 'shared/use-content'
import useImgPath from 'shared/use-img-path'
import { translateStatusLableValue } from '@/lib/utils/labelHelper'
const initializedUsedContent = useContent('standards')
const { getImgPath } = useImgPath()
export default function ({ contentString }) {
const content: ServiceContent = JSON.parse(contentString)
console.log(content.status)
console.log('statusLabel = ' + translateStatusLableValue(content.status))
console.log(content)
return (
<div className={'mx-auto max-w-screen-xl it-standard'}>
<div className="col-start-1 col-span-12 ">
......@@ -74,8 +73,9 @@ export default function ({ contentString }) {
}}
supportInfo={ [] }
artefacts={ [] }
combinedStandards={ [] }
// combinedStandards={ content.childResources }
combinedStandards={content.childResources}
slugMaster={content.slugMaster}
currentSlug={content.slug}
lastUpdate={content.dateLastUpdate}
/>
......
......@@ -13,6 +13,7 @@ class ServiceContent {
initialized: boolean = false
text: string = ''
childResources: ChildResource[] = []
slugMaster = ''
logo: Logo = new Logo()
slug: string = ''
dateLastUpdate: string = ''
......@@ -41,6 +42,11 @@ class ServiceContent {
if (statusTags.length > 0) {
this.status = statusTags[0].status
}
const slugMasterTags:any = (this.tags?.filter((tag: Tag) => tag.name == 'slug_master'))
if (slugMasterTags.length > 0) {
this.slugMaster = slugMasterTags[0].value
}
this.dateLastUpdate = newContent.dateLastUpdate || ''
}
}
......
import { Tag } from './Tag'
export class SlugMasterTag extends Tag {
type: string
slug: string
name: string = 'slug_master'
value: string
constructor(type: string) {
super()
this.type = type
this.slug = type
this.value = type
}
}
import MY_CONSTANTS from '@/lib/constants-standards.js'
import { ChildResource } from 'types/content'
import Link from 'next/link'
type Contact = {
name: string
......@@ -19,7 +20,9 @@ type InfoboxOptions = {
contact: Contact
supportInfo: LinkItem[]
artefacts: LinkItem[]
combinedStandards: LinkItem[]
combinedStandards: ChildResource[]
slugMaster: string
currentSlug: string
lastUpdate: string
}
......@@ -48,10 +51,13 @@ export function InfoBoxes({
supportInfo,
artefacts,
combinedStandards,
slugMaster,
currentSlug,
lastUpdate,
}: InfoboxOptions) {
console.log(combinedStandards, slugMaster)
return (
<div>
<div className="infoboxes">
{/* Dummy to ensure Tailwind classes are imported */}
<div className="hidden w-20 bg-red-100 bg-yellow-100 bg-slate-100">
&nbsp;
......@@ -93,19 +99,29 @@ export function InfoBoxes({
</div>
)}
{combinedStandards.length > 0 && combinedStandards[0].link != '' && (
{/* COMBINED STANDARDS */}
{combinedStandards.length > 0 && combinedStandards[0].name != '' && (
<div className="w-80 border-2 mb-4 rounded-md">
<div className={`${MY_CONSTANTS.BG_COLORS.COMBINED_STANDARDS} p-1 font-bold`}>Verbundene IT-Standards</div>
<div className="text-sm p-1">
{combinedStandards.map((myItem: LinkItem, key) => (
<div className="flex" key={`${key}`}>
<div className={`${myItem.name}`}></div>
</div>
))}
{
(combinedStandards.filter((item) => item.slug != currentSlug))
.map((myItem: ChildResource, key) => {
return (
<div className="flex" key={`${key}`}>
{myItem.slug == slugMaster ?
<div className={'leading-7 ' + 'font-bold ' + `${myItem.name}`}><a href={'/standards/' + myItem.slug}>{myItem.name}</a></div>
: <div className={'leading-7 ' + `${myItem.name}`}><a href={'/standards/' + myItem.slug}>{myItem.name}&nbsp;{slugMaster}</a></div>
}
</div>
)
})
}
</div>
</div>
)}
{/* LAST UPDATE */}
{lastUpdate && (
<div className="w-80 border-2 mb-4 rounded-md">
<div className={`${MY_CONSTANTS.BG_COLORS.DEFAULT} p-1 font-bold`}>Letzte Aktualisierung</div>
......
......@@ -42,7 +42,6 @@ export function Header({
issuesURL,
resources,
}: HeaderOptions) {
console.log(statusLabel)
return (
<PageHeaderCard title={title} description={description} img={img} status={statusLabel} >
{developer && (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment