Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/609 ny startside med info fra browseit mm #616

Merged
merged 4 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@
"browserslist": "^4.21.4",
"d3": "^7.8.2",
"dayjs": "^1.11.7",
"dompurify": "^3.1.7",
"exceljs": "^4.3.0",
"framer-motion": "^10.12.4",
"http-proxy-middleware": "^2.0.6",
"marked": "^14.1.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-image": "^4.1.0",
Expand Down
17 changes: 17 additions & 0 deletions apps/web/public/markdown/Administration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
- **[Timeføring]**
- **[Utlegg]**
- **[Kalender]**
- **[1password]**
- **[Kantine]**
- **[Helpit]**
- **[Print]**
- **[Brandbook for Knowit]**

[1password]: https://knowit.1password.eu
[brandbook for knowit]: https://knowit.se/brandbook/
[helpit]: https://helpit.knowit.se/
[kalender]: http://kalender.knowit.no/
[kantine]: https://tullin.munu.shop/
[print]: https://knowit.sharepoint.com/sites/groupcommon/itsupport/SitePages/Knowit--Printix.aspx?web=1&CT=1728381612322&OR=OWA-NT-Mail&CID=cb86ef7f-3f5c-8826-7c08-88a0c6d6b79f
[timeføring]: https://timer.knowit.no/
[utlegg]: https://knowit.unit4cloud.no/
7 changes: 7 additions & 0 deletions apps/web/public/markdown/Communication.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- **[Epost]**
- **[Objectnet Slack]**
- **[Knowit Slack]**

[epost]: http://epost.knowit.no/
[knowit slack]: https://knowit.slack.com/signup
[objectnet slack]: https://knowitobjectnet.slack.com/
23 changes: 23 additions & 0 deletions apps/web/public/markdown/MyEmployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
- **[Profilbilder]**
- **[CVPartner]**
- **[Hvordan skrive CV]**
- **[Seatit]**
- **[Kompetansekartlegging]**
- **[Personalhåndbok]**
- **[Simployer]**
- **[Forsikring]**
- **[Eyr]**
- **[Firmahytter]**
- **[Telefon-abonnement for familie]**

[cvpartner]: https://cv.knowit.no/
[eyr]: https://eyr.md/no/
[firmahytter]: https://booking.minfirmahytte.no/vacation-rentals
[forsikring]: https://www.gjensidige.no/
[hvordan skrive cv]: https://knowit.sharepoint.com/sites/Org-320-internal/SitePages/How-to-articles.aspx
[kompetansekartlegging]: https://kompetanse.knowit.no/
[personalhåndbok]: https://handbooks.simployer.com/nb-no/handbook/104949
[profilbilder]: https://knowit.sharepoint.com/teams/profilbilder/Pictures/Forms/Ansatt.aspx?id=%2Fteams%2Fprofilbilder%2FPictures%2FAnsatt%2FKnowit%20Objectnet&viewid=32518de6%2Dc021%2D43e9%2D9418%2D9807285ba4f0
[seatit]: https://seatit.knowit.no/
[simployer]: https://my.simployer.com/
[telefon-abonnement for familie]: https://knowit.sharepoint.com/sites/Org-320-internal/SitePages/Telenor-mobilabonnement-for-familie.aspx
15 changes: 15 additions & 0 deletions apps/web/public/markdown/Other.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- **[Bedriftskonti]**
- **[Objectnet på Sharepoint]**
- **[Objectnet fag på Sharepoint]**
- **[Bedriftidrettslag]**
- **[Hva Skjer]**
- **[Objectnet github]**
- **[Knowit github]**

[bedriftidrettslag]: https://knowit.sharepoint.com/:u:/r/sites/Local-320-aktiviteter/SitePages/Bedriftsidrettslag.aspx?csf=1&=&web=1&e=18ZzpQ
[bedriftskonti]: https://knowit.sharepoint.com/sites/Org-320-internal/SitePages/Bedriftskontoer-(bedriftskonti)-og-mat.aspx
[hva skjer]: https://hvaskjer.knowit.no/
[objectnet på sharepoint]: https://knowit.sharepoint.com/sites/Org-320-internal
[objectnet fag på sharepoint]: https://knowit.sharepoint.com/sites/Local-320-fagrommet
[objectnet github]: https://github.com/Knowit-Objectnet
[knowit github]: https://github.com/knowit
8 changes: 5 additions & 3 deletions apps/web/src/components/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import {
CompetencePage,
CustomerPage,
CustomerSitePage,
DebugPage,
EmployeePage,
EmployeeProfilePage,
NotFoundPage,
UnderConstructionPage,
DebugPage,
OrganizationStructurePage,
StartPage,
UnderConstructionPage,
} from '../pages'
import { useUserInfo } from '../hooks/useUserInfo'

Expand All @@ -19,7 +20,8 @@ export default function Content() {
<>
{isAuthenticated && (
<Routes>
<Route path="/" element={<Navigate replace to="/ansatte" />} />
<Route path="/" element={<Navigate replace to="/start" />} />
<Route path="/start" element={<StartPage />} />
<Route path="/ansatte" element={<EmployeePage />} />
<Route path="/ansatt/:id" element={<EmployeeProfilePage />} />
<Route path="/kunder" element={<CustomerPage />} />
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/LoginLogoutButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function LoginLogoutButton() {
},
})

navigate('/ansatte', { replace: true })
navigate('/', { replace: true })
}

async function handleSignOut() {
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/components/gridItem/GridItemContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export const GridItemContent = styled('div')(({ theme }) => ({
borderBottom: `1px solid ${theme.palette.background.darker}`,
borderRight: `1px solid ${theme.palette.background.darker}`,
borderRadius: '0px 0px 6px 6px',
height: '100%',
}))
3 changes: 2 additions & 1 deletion apps/web/src/pages/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
export { default as CompetencePage } from './competence/CompetencePage'
export { default as CustomerPage } from './customer/CustomerPage'
export { default as CustomerSitePage } from './customer/CustomerSitePage'
export { default as DebugPage } from './other/DebugPage'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flyttet så de ligger alfabetisk

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Liker det

export { default as EmployeePage } from './employee/EmployeePage'
export { default as EmployeeProfilePage } from './employee/EmployeeProfilePage'
export { default as NotFoundPage } from './other/NotFoundPage'
export { default as OrganizationStructurePage } from './organizationStructure/OrganizationStructurePage'
export { default as StartPage } from './start/StartPage'
export { default as UnderConstructionPage } from './other/UnderConstructionPage'
export { default as DebugPage } from './other/DebugPage'
26 changes: 26 additions & 0 deletions apps/web/src/pages/start/MarkdownContent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { marked } from 'marked'
import DOMPurify from 'dompurify'
import { GridItem } from '../../components/gridItem/GridItem'
import { GridItemHeader } from '../../components/gridItem/GridItemHeader'
import { GridItemContent } from '../../components/gridItem/GridItemContent'
interface MarkdownContentProps {
title: string
markdown: string
}

const MarkdownContent = ({ ...props }: MarkdownContentProps) => {
return (
<GridItem>
<GridItemHeader title={props.title} />
<GridItemContent>
<div
dangerouslySetInnerHTML={{
__html: DOMPurify.sanitize(marked.parse(props.markdown)),
}}
></div>
</GridItemContent>
</GridItem>
)
}

export default MarkdownContent
54 changes: 54 additions & 0 deletions apps/web/src/pages/start/StartPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { useEffect, useState } from 'react'
import { Grid } from '@mui/material'
import { useMatomo } from '@jonkoops/matomo-tracker-react'
import { pageTitle } from '../../utils/pagetitle'
import MarkdownContent from './MarkdownContent'

export default function StartPage() {
const { trackPageView } = useMatomo()

const [administrationMD, setAdministrationMD] = useState('')
const [communicationMD, setCommunicationMD] = useState('')
const [employmentMD, setEmploymentMD] = useState('')
const [otherMD, setOtherMD] = useState('')

useEffect(() => {
fetch('/markdown/Administration.md')
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vi bør etterhvert få henta .md filene fra et annet sted, sånn at de kan oppdateres uten å ha github kompetanse

.then((response) => response.text())
.then((text) => setAdministrationMD(text))
}, [])

useEffect(() => {
fetch('/markdown/Communication.md')
.then((response) => response.text())
.then((text) => setCommunicationMD(text))
}, [])

useEffect(() => {
fetch('/markdown/MyEmployment.md')
.then((response) => response.text())
.then((text) => setEmploymentMD(text))
}, [])

useEffect(() => {
fetch('/markdown/Other.md')
.then((response) => response.text())
.then((text) => setOtherMD(text))
}, [])

useEffect(() => {
trackPageView({
documentTitle: 'Start',
})
pageTitle('Start')
}, [trackPageView])

return (
<Grid container spacing={2} alignItems={'stretch'}>
<MarkdownContent title="Administrasjon" markdown={administrationMD} />
<MarkdownContent title="Kommunikasjon" markdown={communicationMD} />
<MarkdownContent title="Min ansettelse" markdown={employmentMD} />
<MarkdownContent title="Annet" markdown={otherMD} />
</Grid>
)
}
18 changes: 18 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11407,6 +11407,13 @@ __metadata:
languageName: node
linkType: hard

"dompurify@npm:^3.1.7":
version: 3.1.7
resolution: "dompurify@npm:3.1.7"
checksum: 0a9b811bbc94f3dba60cf6486962362b0f1a5b4ab789f5e1cbd4749b6ba1a1fad190a677a962dc8850ce28764424765fe425e9d6508e4e93ba648ef15d54bc24
languageName: node
linkType: hard

"domutils@npm:^1.7.0":
version: 1.7.0
resolution: "domutils@npm:1.7.0"
Expand Down Expand Up @@ -16003,6 +16010,15 @@ __metadata:
languageName: node
linkType: hard

"marked@npm:^14.1.2":
version: 14.1.2
resolution: "marked@npm:14.1.2"
bin:
marked: bin/marked.js
checksum: 47636a6c4edd2ccfa682826ff139292900a9e179812a4ed8a8007fcb34cab662659e5c27565f5250c82409ee0f8cd3c0c1c23b448bb453c5f3d71d510a75b437
languageName: node
linkType: hard

"mdn-data@npm:2.0.14":
version: 2.0.14
resolution: "mdn-data@npm:2.0.14"
Expand Down Expand Up @@ -21577,12 +21593,14 @@ __metadata:
cross-env: ^7.0.3
d3: ^7.8.2
dayjs: ^1.11.7
dompurify: ^3.1.7
dotenv: ^16.0.3
eslint-plugin-react: ^7.31.11
eslint-plugin-react-hooks: ^4.6.0
exceljs: ^4.3.0
framer-motion: ^10.12.4
http-proxy-middleware: ^2.0.6
marked: ^14.1.2
react: ^18.2.0
react-dom: ^18.2.0
react-image: ^4.1.0
Expand Down
Loading