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

PROD Løft #2776

Merged
merged 14 commits into from
Jun 4, 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: 1 addition & 1 deletion .github/workflows/deploy_to_prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
deploy_to_prod:
name: 'Deploy to PROD'
runs-on: 'ubuntu-latest'
environment: 'PROD_mimir'
environment: 'production'
steps:
- id: build_app
uses: enonic/release-tools/build-and-publish@master
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/former_build_deploy_to_prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
deploy-artifact:
name: 'Deploy artifact'
runs-on: ubuntu-latest
environment: 'PROD_mimir'
environment: 'production'
steps:
- name: Download workflow artifact
uses: dawidd6/action-download-artifact@v3.1.4
Expand Down
16 changes: 0 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@
"date-fns": "~3.6.0",
"highcharts-react-official": "~3.2.1",
"react-bootstrap": "~2.10.2",
"react-ga": "~3.3.1",
"react-select": "~5.8.0",
"redux": "~5.0.1",
"redux-logger": "~3.0.6",
Expand Down
44 changes: 0 additions & 44 deletions src/main/resources/assets/js/app/highchart.es6
Original file line number Diff line number Diff line change
Expand Up @@ -139,78 +139,40 @@ export function init() {
})
}

const category = 'Highcharts'
const action = 'Lastet ned highcharts'

config.exporting.menuItemDefinitions = {
printChart: {
onclick: function () {
const label = `${config.title.text} - Skriv ut graf`
gtag('event', action, {
event_category: category,
event_label: label,
})

this.print()
},
},
downloadPNG: {
onclick: function () {
const label = `${config.title.text} - Last ned som PNG`
gtag('event', action, {
event_category: category,
event_label: label,
})

this.exportChartLocal() //png is default
},
},
downloadJPEG: {
onclick: function () {
const label = `${config.title.text} - Last ned som JPEG`
gtag('event', action, {
event_category: category,
event_label: label,
})

this.exportChartLocal({
type: 'image/jpeg',
})
},
},
downloadPDF: {
onclick: function () {
const label = `${config.title.text} - Last ned som PDF`
gtag('event', action, {
event_category: category,
event_label: label,
})

this.exportChartLocal({
type: 'application/pdf',
})
},
},
downloadSVG: {
onclick: function () {
const label = `${config.title.text} - Last ned som SVG`
gtag('event', action, {
event_category: category,
event_label: label,
})

this.exportChartLocal({
type: 'image/svg+xml',
})
},
},
downloadXLS: {
onclick: function () {
const label = `${config.title.text} - Last ned som XLS`
gtag('event', action, {
event_category: category,
event_label: label,
})
const rows = this.getDataRows(true)
const xlsxRows = rows.slice(1).map(function (row) {
return row.map(function (column) {
Expand All @@ -230,12 +192,6 @@ export function init() {
},
downloadCSV: {
onclick: function () {
const label = `${config.title.text} - Last ned som CSV`
gtag('event', action, {
event_category: category,
event_label: label,
})

this.downloadCSV()
},
},
Expand Down
6 changes: 6 additions & 0 deletions src/main/resources/assets/styles/_keyFigures.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,10 @@
margin-right: auto;
}
}
}

.macro-keyfigure{
.green-box {
margin-bottom: 15px;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export type AttachmentTablesFiguresProps = {
showAll: string
showLess: string
appName: string
GA_TRACKING_ID: string | null
title: string
}

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/lib/types/partTypes/keyFigure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface KeyFigureProps {
pageTypeKeyFigure: boolean
hiddenTitle: string
isInStatisticsPage: boolean
isMacro: boolean
}

export interface KeyFigureData {
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/lib/types/partTypes/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export interface LinksProps {
linkType?: 'regular' | 'profiled' | 'header'
text?: string
description?: string
GA_TRACKING_ID?: string
isPDFAttachment?: boolean
attachmentTitle?: string
}
1 change: 0 additions & 1 deletion src/main/resources/lib/types/partTypes/nameSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,4 @@ export interface NameSearchProps {
close: string
}
language: string
GA_TRACKING_ID: string | null
}
1 change: 0 additions & 1 deletion src/main/resources/lib/types/partTypes/searchResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export interface SearchResultProps {
contentTypePhrases: Array<ContentTypePhrase>
contentTypes: Array<Facet>
subjects: Array<Facet>
GA_TRACKING_ID: string | null
contentTypeUrlParam: string | undefined
subjectUrlParam: string | undefined
searchResultSRText: string
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/lib/types/partTypes/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export interface TableProps {
sourceTableLabel: string
statBankWebUrl: string
hiddenTitle: string | undefined
GA_TRACKING_ID: string | null
}

export interface TableStandardSymbolLink {
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/main.es6
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ try {
feature: 'structured-data',
enabled: false,
},
{
feature: 'pageMap',
enabled: false,
},
],
},
])
Expand Down
15 changes: 0 additions & 15 deletions src/main/resources/react4xp/ReactGA.tsx

This file was deleted.

15 changes: 0 additions & 15 deletions src/main/resources/react4xp/_entries/AttachmentTablesFigures.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
} from '../../lib/types/partTypes/attachmentTablesFigures'

import Table from '../table/Table'
import { addGtagForEvent } from '/react4xp/ReactGA'

function AttachmentTableFigures(props: AttachmentTablesFiguresProps) {
const [isHidden, setIsHidden] = useState(true)
Expand All @@ -29,19 +28,6 @@ function AttachmentTableFigures(props: AttachmentTablesFiguresProps) {
}
}

function toggleAccordion(isOpen: boolean, index: number) {
const { contentType, subHeader, open } = accordions[index]

if (isOpen && contentType === `${props.appName}:table` && props.GA_TRACKING_ID) {
addGtagForEvent(
props.GA_TRACKING_ID,
'Utvidet vedleggstabell',
'Statistikkside vedleggstabeller',
`${subHeader} ${open}`
)
}
}

function getButtonBreakpoint() {
if (accordions.length > 5) {
return ''
Expand Down Expand Up @@ -127,7 +113,6 @@ function AttachmentTableFigures(props: AttachmentTablesFiguresProps) {
header={accordion.open}
subHeader={accordion.subHeader}
openByDefault={anchor && accordion.id && accordion.id === anchor}
onToggle={(isOpen: boolean) => toggleAccordion(isOpen, index)}
>
{renderAccordionBody(accordion)}
</Accordion>
Expand Down
10 changes: 7 additions & 3 deletions src/main/resources/react4xp/_entries/KeyFigure.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class KeyFigures extends React.Component<KeyFigureProps, KeyFigureState> {
isRight = !columns || (columns && !isRight) || keyFigure.size === 'large'
return (
<React.Fragment key={`figure-${i}`}>
{this.props.isMacro && !keyFigure.greenBox ? this.addDivider(isRight) : null}
<Col
className={`col-12${columns && keyFigure.size !== 'large' ? ' col-md-6' : ''}${
this.props.isInStatisticsPage ? ' p-0' : ''
Expand All @@ -102,14 +103,17 @@ class KeyFigures extends React.Component<KeyFigureProps, KeyFigureState> {
/>
{this.addKeyFigureSource(keyFigure)}
</Col>
{i < keyFigures.length - 1 ? (
<Divider className={`my-5 d-block ${!isRight ? 'd-md-none' : ''}`} light />
) : null}
{i < keyFigures.length - 1 ? this.addDivider(isRight) : null}
{this.props.isMacro && !keyFigure.greenBox ? this.addDivider(isRight) : null}
</React.Fragment>
)
})
}

addDivider(isRight: boolean) {
return <Divider className={`my-5 d-block ${!isRight ? 'd-md-none' : ''}`} light />
}

addKeyFigureSource(keyFigure: KeyFigureData) {
if ((!this.props.source || !this.props.source.url) && keyFigure.source && keyFigure.source.url) {
const sourceLabel = this.props.sourceLabel
Expand Down
14 changes: 0 additions & 14 deletions src/main/resources/react4xp/table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { default as isEmpty } from 'ramda/es/isEmpty'
import { NumericFormat } from 'react-number-format'
import { Alert } from 'react-bootstrap'
import { ChevronLeft, ChevronRight } from 'react-feather'
import { addGtagForEvent } from '/react4xp/ReactGA'
import { type TableProps } from '../../lib/types/partTypes/table'
import { PreliminaryData, type TableCellUniform } from '../../lib/types/xmlParser'

Expand Down Expand Up @@ -156,10 +155,6 @@ function Table(props: TableProps) {
}

function downloadTableAsCSV() {
if (props.GA_TRACKING_ID) {
addGtagForEvent(props.GA_TRACKING_ID, 'Lastet ned csv tabell', 'Statistikkside tabeller', 'Last ned csv tabell')
}

if (window && window.downloadTableFile) {
window.downloadTableFile(tableRef.current, {
type: 'csv',
Expand All @@ -172,15 +167,6 @@ function Table(props: TableProps) {
}

function downloadTableAsExcel() {
if (props.GA_TRACKING_ID) {
addGtagForEvent(
props.GA_TRACKING_ID,
'Lastet ned excell tabell',
'Statistikkside tabeller',
'Last ned excell tabell'
)
}

if (window && window.downloadTableFile) {
window.downloadTableFile(tableRef.current, {
type: 'xlsx',
Expand Down
39 changes: 18 additions & 21 deletions src/main/resources/site/error/error.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
<!DOCTYPE html>
<html data-th-lang="${language.code}">
<head>
<script async="true" data-th-if="${GA_TRACKING_ID}" data-th-src="|https://www.googletagmanager.com/gtag/js?id=${GA_TRACKING_ID}|"></script>
<script th:inline="javascript" data-th-if="${GA_TRACKING_ID}">
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', /*[[${GA_TRACKING_ID}]]*/);
</script>

<meta http-equiv="Content-Type" content="text/html;" charset="UTF-8"/>
<title data-th-text="${pageTitle}">Side ikke funnet / Page not found</title>
<meta name="viewport" content="width=device-width"/>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans%7COpen+Sans:700%7CRoboto:700%7CRoboto+Condensed:700"/>
<link rel="stylesheet" data-th-href="${stylesUrl}"/>
<link rel="alternate" data-th-if="${alternateLanguageVersionUrl}" data-th-href="${alternateLanguageVersionUrl}" data-th-hreflang="${language.alternate}"/>
</head>
<body class="xp-page" data-th-classappend="${bodyClasses}">
<div class="container">
<div data-th-utext="${contentHtml}" data-th-remove="tag"></div>
</div>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html;" charset="UTF-8" />
<title data-th-text="${pageTitle}">Side ikke funnet / Page not found</title>
<meta name="viewport" content="width=device-width" />
<link rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Open+Sans%7COpen+Sans:700%7CRoboto:700%7CRoboto+Condensed:700" />
<link rel="stylesheet" data-th-href="${stylesUrl}" />
<link rel="alternate" data-th-if="${alternateLanguageVersionUrl}" data-th-href="${alternateLanguageVersionUrl}"
data-th-hreflang="${language.alternate}" />
</head>

<body class="xp-page" data-th-classappend="${bodyClasses}">
<div class="container">
<div data-th-utext="${contentHtml}" data-th-remove="tag"></div>
</div>
</body>

</html>
1 change: 0 additions & 1 deletion src/main/resources/site/error/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ function getMainErrorBody(status: number, contentHtml: string, language: Languag
language,
pageTitle: status === 404 ? 'Side ikke funnet / Page not found' : 'Siden feilet / Page error',
bodyClasses: '',
GA_TRACKING_ID: app.config && app.config.GA_TRACKING_ID ? app.config.GA_TRACKING_ID : null,
contentHtml,
}
const mainErrorBody = render(mainErrorView, mainErrorModel)
Expand Down
Loading
Loading