Skip to content

Commit

Permalink
1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
danfun-kit committed Nov 10, 2020
1 parent a85e9bf commit a38aec3
Show file tree
Hide file tree
Showing 88 changed files with 5,064 additions and 2,470 deletions.
4 changes: 4 additions & 0 deletions config/env/EnvSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export abstract class EnvSettings {

abstract ENTRYSCAPE_BLOCKS_URL:string;

abstract ENTRYSCAPE_OPENDATA_SV_URL:string;

abstract ENTRYSCAPE_OPENDATA_EN_URL:string;

abstract CONTENTBACKEND_SITEURL: string;

abstract CONTENTBACKEND_GRAPHAPI: string;
Expand Down
9 changes: 6 additions & 3 deletions config/env/Settings.Dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ export class Settings_Dev extends EnvSettings {
ENTRYSCAPE_CONCEPT_STATS_URL="https://editera.dataportal.se/stats/entityData.json"
ENTRYSCAPE_HISTORY_STATS_URL="https://registrera.oppnadata.se/stats/historyData.json"

ENTRYSCAPE_BLOCKS_URL="https://dataportal.azureedge.net/cdn/blocks.0.19.app.js"
ENTRYSCAPE_BLOCKS_URL="https://dataportal.azureedge.net/cdn/blocks.0.20.app-0.6.js"

ENTRYSCAPE_OPENDATA_SV_URL="https://dataportal.azureedge.net/cdn/ext-opendata-sv-0.6.js"
ENTRYSCAPE_OPENDATA_EN_URL="https://dataportal.azureedge.net/cdn/ext-opendata-en-0.6.js"

ENTRYSCAPE_SITEMAP_JSON_URL="https://registrera.oppnadata.se/sitemap.json";

CONTENTBACKEND_SITEURL="*";

CONTENTBACKEND_GRAPHAPI="https://digg-test-graphproxy.azurewebsites.net";
// CONTENTBACKEND_GRAPHAPI="http://localhost:4444";
// CONTENTBACKEND_GRAPHAPI="https://digg-test-graphproxy.azurewebsites.net";
CONTENTBACKEND_GRAPHAPI="http://localhost:4444";

CANONICAL_URL = "http://localhost:8080";

Expand Down
5 changes: 4 additions & 1 deletion config/env/Settings.Prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export class Settings_Prod extends EnvSettings {
ENTRYSCAPE_CONCEPT_STATS_URL="https://editera.dataportal.se/stats/entityData.json"
ENTRYSCAPE_HISTORY_STATS_URL="https://registrera.oppnadata.se/stats/historyData.json"

ENTRYSCAPE_BLOCKS_URL="https://dataportal.azureedge.net/cdn/blocks.0.19.app.js"
ENTRYSCAPE_BLOCKS_URL="https://dataportal.azureedge.net/cdn/blocks.0.20.app-0.6.js"

ENTRYSCAPE_OPENDATA_SV_URL="https://dataportal.azureedge.net/cdn/ext-opendata-sv-0.6.js"
ENTRYSCAPE_OPENDATA_EN_URL="https://dataportal.azureedge.net/cdn/ext-opendata-en-0.6.js"

ENTRYSCAPE_SITEMAP_JSON_URL="https://registrera.oppnadata.se/sitemap.json";

Expand Down
5 changes: 4 additions & 1 deletion config/env/Settings.Sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export class Settings_Sandbox extends EnvSettings {
ENTRYSCAPE_CONCEPT_STATS_URL="https://editera.dataportal.se/stats/entityData.json"
ENTRYSCAPE_HISTORY_STATS_URL="https://registrera.oppnadata.se/stats/historyData.json"

ENTRYSCAPE_BLOCKS_URL="https://dataportal.azureedge.net/cdn/blocks.0.19.app.js"
ENTRYSCAPE_BLOCKS_URL="https://dataportal.azureedge.net/cdn/blocks.0.20.app-0.6.js"

ENTRYSCAPE_OPENDATA_SV_URL="https://dataportal.azureedge.net/cdn/ext-opendata-sv-0.6.js"
ENTRYSCAPE_OPENDATA_EN_URL="https://dataportal.azureedge.net/cdn/ext-opendata-en-0.6.js"

ENTRYSCAPE_SITEMAP_JSON_URL="https://registrera.oppnadata.se/sitemap.json";

Expand Down
5 changes: 4 additions & 1 deletion config/env/Settings.Test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export class Settings_Test extends EnvSettings {
ENTRYSCAPE_CONCEPT_STATS_URL="https://editera.dataportal.se/stats/entityData.json"
ENTRYSCAPE_HISTORY_STATS_URL="https://registrera.oppnadata.se/stats/historyData.json"

ENTRYSCAPE_BLOCKS_URL="https://dataportal.azureedge.net/cdn/blocks.0.19.app.js"
ENTRYSCAPE_BLOCKS_URL="https://dataportal.azureedge.net/cdn/blocks.0.20.app-0.6.js"

ENTRYSCAPE_OPENDATA_SV_URL="https://dataportal.azureedge.net/cdn/ext-opendata-sv-0.6.js"
ENTRYSCAPE_OPENDATA_EN_URL="https://dataportal.azureedge.net/cdn/ext-opendata-en-0.6.js"

ENTRYSCAPE_SITEMAP_JSON_URL="https://registrera.oppnadata.se/sitemap.json";

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
},
"dependencies": {
"@apollo/react-hooks": "^3.1.5",
"@datapunt/matomo-tracker-react": "^0.2.1",
"@digg/design-system": "file:local_modules/digg_design-system-1.1.87.tgz",
"@digg/react-ideal-image": "file:local_modules/digg_react-ideal-image-1.0.2.tgz",
"@emotion/core": "^10.0.17",
Expand Down
28 changes: 28 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,33 @@
crossorigin="anonymous"
></script>
<script src="/app.js"></script>
<!-- Matomo -->
<script>
var matomoId;

if(window.document.domain === 'www.dataportal.se') {
console.log('prod');
matomoId = '4';
} else if(window.document.domain === 'localhost') {
console.log('dev');
matomoId = '6';
} else {
console.log('test');
matomoId = '5';
}

var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//webbanalys.digg.se/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', matomoId]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
</body>
</html>
6 changes: 4 additions & 2 deletions server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ var csp_headers = {
'*.googleapis.com',
'*.gstatic.com',
'digg-test-graphproxy.azurewebsites.net',
'digg-prod-graphproxy.azurewebsites.net'
'digg-prod-graphproxy.azurewebsites.net',
'webbanalys.digg.se'
],
'base-uri': ["'self'"],
'manifest-src': ["'self'"],
Expand Down Expand Up @@ -85,7 +86,8 @@ app.use(function forceLiveDomain(req, res, next) {
host === 'ckan.xn--ppnadata-m4a.se' ||
host === 'www.xn--ppnadata-m4a.se' ||
host === 'ckan.oppnadata.se' ||
host === 'www.oppnadata.se') {
host === 'www.oppnadata.se' ||
host === 'vidareutnyttjande.se') {
return res.redirect(301, 'https://www.dataportal.se/oppnadata');
}
if (host === 'oppnadata.local:3003') {
Expand Down
2 changes: 1 addition & 1 deletion server/renderer/html-template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const getFooter = ({ bundles, ids }: FooterData) => {
<script>window.__EMOTION_IDS__ = ${serialize(ids)};</script>
<div id="scriptsPlaceholder"></div>
<script src="https://dataportal.azureedge.net/cdn/postscribe.min.js" crossorigin="anonymous"></script>
${bundles.map(src => createScriptTag(src))}
${bundles.map(src => createScriptTag(src))}
</body>
</html>
`;
Expand Down
Binary file removed src/assets/Fjall_36.jpg
Binary file not shown.
5 changes: 5 additions & 0 deletions src/assets/Illustration_1.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import React from 'react';

const illustration_1 = require('./illustration_1.png');

export const Illustration_1: React.SFC = () => <img src={illustration_1} alt="Illustration dator" />;
5 changes: 5 additions & 0 deletions src/assets/Illustration_2.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import React from 'react';

const illustration_2 = require('./illustration_2.png');

export const Illustration_2: React.SFC = () => <img src={illustration_2} alt="Illustration dator" />;
5 changes: 5 additions & 0 deletions src/assets/Illustration_3.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import React from 'react';

const illustration_3 = require('./illustration_3.png');

export const Illustration_3: React.SFC = () => <img src={illustration_3} alt="Illustration dator" />;
Binary file removed src/assets/STHLM_36.jpg
Binary file not shown.
Binary file removed src/assets/Sthlm_28.jpg
Binary file not shown.
4 changes: 2 additions & 2 deletions src/assets/TopImage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';

const topimage = require('./Sthlm_28.jpg');
const topimage = require('./start_bg1.jpg');

export const TopImage: React.SFC = () => <img src={topimage} alt="Stockholm och blå himmel" />;
export const TopImage: React.SFC = () => <img src={topimage} alt=" " />;
5 changes: 5 additions & 0 deletions src/assets/TopImageInspo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import React from 'react';

const topimage = require('./project_bg.jpg');

export const TopImageInspo: React.SFC = () => <img src={topimage} alt="" />;
5 changes: 5 additions & 0 deletions src/assets/TopImageTellUS.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import React from 'react';

const topimage = require('./tellus_bg.jpg');

export const TopImageTellUs: React.SFC = () => <img src={topimage} alt="" />;
Binary file removed src/assets/gothenburg_36.jpg
Binary file not shown.
Binary file removed src/assets/gothenburg_45.jpg
Binary file not shown.
Binary file added src/assets/illustration_1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/illustration_2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/illustration_3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/project_bg.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/start_bg.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/start_bg1.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/startimage.jpf
Binary file not shown.
Binary file added src/assets/swe_bg2.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/tellus_bg.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 8 additions & 20 deletions src/components/Articles/ArticleBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ const lang = 'sv';
const NEWS = gql`
{
othernews:
news(siteurl:"*", lang:"${i18n.languages[0]}", take:3, skip:0, skiptags:["sticky"]){
news(siteurl:"*", lang:"${i18n.languages[0]}", take:3, skip:0){
id
heading
preamble
published
modified
tags
modified
body
imageUrl
}
Expand All @@ -36,21 +35,12 @@ export const ArticleBlock: React.FC<ArticleBlockProps> = () => {
othernews: Array<any>;
}>(NEWS);

// const stickyNews =
// data && data.stickynews && data.stickynews.length > 0
// ? data.stickynews
// : [];

const articleList =
data && data.othernews && data.othernews.length > 0 ? data.othernews : [];

// if (stickyNews.length == 0 && newsList.length == 0) {
// return <></>;
// }

if (articleList && articleList.length > 0) {
return (
<div>
<div className="main-container">
<h2 className="text-3">{i18n.t('pages|articles|articles')}</h2>
<div className="news-compact">
<div className="news-list-compact">
Expand Down Expand Up @@ -86,22 +76,20 @@ export const ArticleBlock: React.FC<ArticleBlockProps> = () => {
/>
)}
</div>

<div className="news-text">
<span className="text-6">
{moment(n.published.toString()).format('D MMM YYYY')}
</span>

<h3>
<a
className="text-4"
href={`/${i18n.languages[0]}/${i18n.t('routes|news|path')}/${n.id}/${slugify(n.heading)}`}>{n.heading}



href={`/${i18n.languages[0]}/${i18n.t(
'routes|news|path'
)}/${n.id}/${slugify(n.heading)}`}
>
{n.heading}
</a>
</h3>

<ChopLines lines={3} lineHeight={27}>
<p
className="text-5"
Expand Down
8 changes: 2 additions & 6 deletions src/components/Articles/ArticleItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ export const ArticleItem : React.FC<ArticleItemProps> = (props) => {
heading
preamble
published
modified
tags
modified
body
imageUrl
}
Expand All @@ -57,18 +56,15 @@ export const ArticleItem : React.FC<ArticleItemProps> = (props) => {

return (
<div className="news-article content">

{loading && (<span className="text-5 loading">{i18n.t('common|loading')}</span>)}
{!loading && articleItem && id && id != '0' ?
<>
<Helmet>
<title>{articleItem.heading} - {i18n.t('common|seo-title')}</title>
</Helmet>

</Helmet>
{articleItem && articleItem.imageUrl && (
<img src={`${articleItem.imageUrl}?width=1024`} />
)}

<span className="text-6">{moment(articleItem.published.toString()).format("D MMM YYYY")}</span>
<h1 className="text-1">{articleItem.heading}</h1>
<p className="preamble text-4">
Expand Down
6 changes: 2 additions & 4 deletions src/components/Articles/ArticleList.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { Component, useState } from 'react';
import i18n from '../../i18n';
import { TopImage } from 'assets/TopImage';
import { EnvSettings } from '../../../config/env/EnvSettings';
import { useQuery } from '@apollo/react-hooks';
import { gql } from 'apollo-boost';
Expand All @@ -23,8 +22,7 @@ export const ArticleList: React.FC<ArticleListProps> = (props) => {
heading
preamble
published
modified
tags
modified
body
}
}
Expand Down Expand Up @@ -73,7 +71,7 @@ export const ArticleList: React.FC<ArticleListProps> = (props) => {
<a
className="text-4"
href={`/${i18n.languages[0]}/${i18n.t(
'pages|articles|articles'
'routes|news|path'
)}/${n.id}/${slugify(n.heading)}`}
>
{n.heading}
Expand Down
9 changes: 9 additions & 0 deletions src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ export class Footer extends React.Component<FooterProps> {
<Box className="footer-main">
<Box className="footer__links">
<div className="footer__links-nav">
<a
href={`/${i18n.languages[0]}/${i18n.t(
'routes|register-data|path'
)}`}
className="footer-link text-6-link"
>
{i18n.t('routes|register-data|title')}
</a>

<a
href={`/${i18n.languages[0]}/${i18n.t(
'routes|about|path'
Expand Down

0 comments on commit a38aec3

Please sign in to comment.