Skip to content

Commit ff3015a

Browse files
Merge pull request #597 from GeotrekCE/develop
Develop > Master / Release 3.7.0
2 parents 655dd17 + aa233e5 commit ff3015a

File tree

135 files changed

+4251
-706
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+4251
-706
lines changed

docs/changelog.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# Changelog
22

3+
3.7.0 (2022-03-11)
4+
------------------
5+
6+
**🚀 New features**
7+
8+
* Include 3D view in trek detail pages (#390)
9+
* Add ``maxLengthTrekAllowedFor3DRando`` setting to define the maximum length of a trek to enable the 3D view on its page (or to disable 3D view) (#390)
10+
* Add breadcrumb on detail and information pages (#506)
11+
* Add Open System reservation widget on trek detail pages with an ``id_reservation`` (#382)
12+
* Add ``reservationPartner`` and ``reservationProject`` settings to enable Open System reservation widget (#382)
13+
* Add a customizable color for each content category (treks, outdoor sites, services and events) to better differentiate content categories (#437)
14+
* Add content type name display on hover of pictograms in search page (#437)
15+
* Add the possibility to define outdoor sites, services and events suggestions on home page (#372)
16+
* Display more information on suggestions cards on home page (#372)
17+
* Improve layer controller on treks and outdoor sites detail pages (#449)
18+
* Add a panel on trek mobile map to display trek title, steps and altimetric profile (#452)
19+
* Display SVG theme pictograms in filters
20+
* Improve modale component
21+
* Add German, Spanish and Catalan translations (#571)
22+
23+
**🐛 Fixes**
24+
25+
* Fix categories display in mobile filters depending on contents and settings (#586)
26+
* Fix trek filters displayed in 3 columns (#377)
27+
* Display ``disabledInfrastructure`` and ``accessibilities`` in trek detail pages only if they have content
28+
329
3.6.0 (2022-02-07)
430
------------------
531

docs/customization.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ In json files, you can just override the primary keys you need. You have to over
3434
- `applicationName`: application name appearing on PWA
3535
- `enableReport`: to enable report form in trek detail pages
3636
- `enableSearchByMap`: to enable searching by map displayed area (bbox)
37+
- `maxLengthTrekAllowedFor3DRando`: Maximum length of meters allowed to enable 3D mode in the current trek. Adjust this setting carefully as too long a trek could freeze your browser. If this setting is defined to `0` (or `mapSatelliteLayerUrl` from `map.json` is not set) the 3D mode feature is disabled for the whole application
3738

3839
- `header.json` to define logo URL, default and available languages, number items to flatpages to display in navbar (see default values in https://github.com/GeotrekCE/Geotrek-rando-v3/blob/main/frontend/config/header.json)
3940

40-
- `home.json` to define homepage settings. You can define blocks to display and trek suggestion block with trek ID to highlight on homepage (see https://github.com/GeotrekCE/Geotrek-rando-v3/blob/main/frontend/customization/config/home.json).
41+
- `home.json` to define homepage settings. You can define blocks to display and trek suggestion block with treks ID, outdoor sites ID, services ID or events ID to highlight on homepage (see https://github.com/GeotrekCE/Geotrek-rando-v3/blob/main/frontend/customization/config/home.json).
4142

4243
- In `welcomeBanner`, you can personnalize the cover on the homepage. You can add an asset on the top of the page: it can either be a video, a single picture or a carousel of images:
4344

@@ -120,6 +121,19 @@ Example for Cevennes national park orange colors:
120121
}
121122
```
122123

124+
It's also possible to change category colors :
125+
126+
```json
127+
{
128+
"categories": {
129+
"trek": "blue",
130+
"events": "red",
131+
"outdoor": "#62AB41",
132+
"service": "#3B89A2"
133+
}
134+
}
135+
```
136+
123137
You can also override CSS in `customization/theme/style.css` file. To help overriding CSS, some ID have been added on main DIV components (header, logo, footer, cover, cards, results, maps, details...).
124138

125139
## Translations

docs/icons.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Icons
22

3-
Geotrek V3 uses icons which images come from API. This file intends to help upload a right format for them in Geotrek Admin.
3+
Geotrek-rando V3 uses icons which images come from API. This file intends to help upload a right format for them in Geotrek-admin.
44

55
## Activity icons
66

@@ -10,15 +10,17 @@ Because of that, they have to be :
1010
- in **`svg` format**
1111
- **white**, or with a light color, by default (a color that is visible on a `primary1` background)
1212
- **without filled background** : only shapes or lines
13+
- without `width` and `height` attributes
1314
- preferrably, **no different colors**. If different colors are used, they will be lost anyway when the icon is modified. The icon has to stay readable with all its shapes and lines in one color.
15+
- with an usable licence and credits
1416

15-
**Default activity icons**, not modified, are visible in search filter list or on map :
17+
**Default activity icons**, not modified, are visible in search filter list or on map
1618

1719
![Activity Icon on filter list](assets/iconFilterList.png)
1820

19-
Here that "Alpinisme" icon should have been white by default.
21+
Here the "Alpinisme" icon should have been white by default.
2022

21-
**Modified activity icons** are visible on activity bar on home or details page :
23+
**Modified activity icons** are visible on activity bar on home or details page:
2224

2325
![Activity Icon modified on home](assets/iconHome.png)
2426

frontend/config/global.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
"enableTouristicEvents": true,
99
"portalIds": [],
1010
"apiUrl": "https://geotrekdemo.ecrins-parcnational.fr/api/v2",
11+
"reservationPartner": null,
12+
"reservationProject": null,
1113
"googleAnalyticsId": null,
1214
"googleSiteVerificationToken": "eKAyxwaXAobFWQcJen0mnZ8T3CpLoN45JysXeNkRf38",
1315
"baseUrl": "http://127.0.0.1:3000",
@@ -17,5 +19,7 @@
1719
"enableIndexation": true,
1820
"enableReport": true,
1921
"enableSearchByMap": true,
20-
"enableServerCache": true
21-
}
22+
"enableServerCache": true,
23+
"enableMeteoWidget": true,
24+
"maxLengthTrekAllowedFor3DRando": 25000
25+
}

frontend/customization/config/global.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
"enableTouristicEvents": true,
99
"portalIds": [1],
1010
"apiUrl": "https://geotrekdemo.ecrins-parcnational.fr/api/v2",
11+
"reservationPartner": "parcdesecrins",
12+
"reservationProject": "parcdesecrins",
1113
"googleAnalyticsId": "G-8FSV2N4FXN",
1214
"googleSiteVerificationToken": "eKAyxwaXAobFWQcJen0mnZ8T3CpLoN45JysXeNkRf38",
1315
"baseUrl": "http://localhost:3000",

frontend/customization/config/home.json

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,31 @@
1414
{
1515
"titleTranslationId": "home.territoryTreks",
1616
"iconUrl": "/icons/practice-pedestrian.svg",
17-
"ids": ["2", "582", "586", "501", "771", "596", "604"]
17+
"ids": ["2", "582", "586", "501", "771", "596"],
18+
"type": "trek"
19+
},
20+
{
21+
"titleTranslationId": "home.events",
22+
"iconUrl": "/icons/category-events.svg",
23+
"ids": ["1", "5"],
24+
"type": "events"
25+
},
26+
{
27+
"titleTranslationId": "home.outdoor",
28+
"iconUrl": "/icons/practice-outdoor.svg",
29+
"ids": ["65", "12", "79"],
30+
"type": "outdoor"
31+
},
32+
{
33+
"titleTranslationId": "home.services",
34+
"iconUrl": "/icons/category-services.svg",
35+
"ids": ["1", "6", "476"],
36+
"type": "service"
1837
},
1938
{
2039
"titleTranslationId": "home.itinerantTreks",
2140
"iconUrl": "/icons/practice-pedestrian.svg",
22-
"ids": ["501", "771"]
41+
"ids": ["501", "771", "604"]
2342
}
2443
]
2544
}

frontend/next.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,20 @@ module.exports = withPlugins(plugins, {
2424
webpack(config) {
2525
config.resolve.modules.push(path.resolve('./src'));
2626

27+
Object.assign(config.resolve.alias, {
28+
// GSAP aliases are useful for @makina-corpus/rando3d package
29+
EasePack: 'gsap/src/uncompressed/easing/EasePack.js',
30+
TweenLite: 'gsap/src/uncompressed/TweenLite.js',
31+
TimelineLite: 'gsap/src/uncompressed/TimelineLite.js',
32+
BezierPlugin: 'gsap/src/uncompressed/plugins/BezierPlugin.js',
33+
DirectionalRotationPlugin: 'gsap/src/uncompressed/plugins/DirectionalRotationPlugin.js',
34+
});
35+
36+
config.module.rules.push({
37+
test: /\.html$/,
38+
use: 'raw-loader',
39+
});
40+
2741
return config;
2842
},
2943
pwa: {

frontend/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "geotrek-rando-frontend",
3-
"version": "3.6.0",
3+
"version": "3.7.0",
44
"private": true,
55
"scripts": {
66
"debug": "NODE_OPTIONS='--inspect' next ./src",
@@ -33,6 +33,7 @@
3333
},
3434
"dependencies": {
3535
"@fullhuman/postcss-purgecss": "^4.0.3",
36+
"@makina-corpus/rando3d": "^1.3.1",
3637
"@next/bundle-analyzer": "11.1.2",
3738
"@raruto/leaflet-elevation": "1.7.0",
3839
"@sentry/browser": "6.13.2",
@@ -128,12 +129,14 @@
128129
"eslint-plugin-react-hooks": "^4.2.0",
129130
"eslint-plugin-testing-library": "4.12.3",
130131
"full-icu": "1.3.4",
132+
"gsap": "1.16.1",
131133
"html-loader-jest": "^0.2.1",
132134
"isomorphic-fetch": "^3.0.0",
133135
"jest": "27.2.1",
134136
"next-server": "^9.0.5",
135137
"nock": "13.1.3",
136138
"prettier": "2.4.1",
139+
"raw-loader": "^4.0.2",
137140
"react-addons-test-utils": "^15.6.2",
138141
"stylelint": "13.13.1",
139142
"stylelint-config-prettier": "^8.0.2",
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import styled from 'styled-components';
2+
import { colorPalette } from 'stylesheet';
3+
4+
export const Wrapper = styled.div`
5+
width: 90vw;
6+
height: 90vh;
7+
background-color: ${colorPalette.greyDarkColored};
8+
background-image: url(/images/3d/background.jpg);
9+
background-size: 100% 100%;
10+
`;
11+
export const Control = styled.div`
12+
background-color: rgba(255, 255, 255, 0.2);
13+
border-radius: 0 0 0.35em 0.35em;
14+
`;
15+
16+
export const Camera = styled.ul`
17+
background-color: rgba(255, 255, 255, 0.2);
18+
border-radius: 0.35em 0 0 0.35em;
19+
`;
20+
21+
export const CameraItem = styled.li`
22+
border-left: 1px solid transparent;
23+
border-bottom: solid 1px rgba(255, 255, 255, 0.2);
24+
&.camera--disabled {
25+
cursor: default;
26+
opacity: 0.4;
27+
}
28+
&.camera--selected {
29+
cursor: auto;
30+
border-left-color: white;
31+
}
32+
&:last-child {
33+
border-bottom: none;
34+
}
35+
`;
36+
37+
export const LoaderOverlay = styled.div`
38+
background-color: rgba(255, 255, 255, 0.2);
39+
`;
40+
41+
export const PoiSide = styled.div`
42+
background-color: rgba(20, 20, 20, 0.8);
43+
top: 0;
44+
left: -100%;
45+
width: 24rem;
46+
height: 100%;
47+
transition: left 0.3s ease-out;
48+
&.opened {
49+
left: 0;
50+
}
51+
`;
52+
53+
export const Poi = styled.div`
54+
background-color: rgba(255, 255, 255, 0.2);
55+
position: absolute;
56+
width: auto;
57+
height: auto;
58+
padding: 2px;
59+
border-radius: 0.35em;
60+
text-align: center;
61+
display: none;
62+
`;
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
import Image from 'next/image';
2+
import { MessageFormatElement, useIntl } from 'react-intl';
3+
import { Camera, CameraItem, Control } from './3D.style';
4+
5+
const getControls = (t: Record<string, string> | Record<string, MessageFormatElement[]>) => [
6+
{
7+
control: 'examine',
8+
title: t['rando3D.views.examine.title'],
9+
steps: [
10+
{
11+
label: t['rando3D.instructions.zoom'],
12+
action: <strong>{t['rando3D.actions.scrollMouse']}</strong>,
13+
},
14+
{
15+
label: t['rando3D.instructions.lookAround'],
16+
action: <strong>{t['rando3D.actions.leftClick']}</strong>,
17+
},
18+
{
19+
label: t['rando3D.instructions.moveAround'],
20+
action: <Image width={50} height={33} src="/images/3d/icon_783__.png" alt="" />,
21+
},
22+
],
23+
cameraTitle: t['rando3D.views.examine.cameraTitle'],
24+
},
25+
{
26+
control: 'bird',
27+
title: t['rando3D.views.bird.title'],
28+
steps: [
29+
{
30+
label: t['rando3D.instructions.zoom'],
31+
action: <strong>{t['rando3D.actions.scrollMouse']}</strong>,
32+
},
33+
{
34+
label: t['rando3D.instructions.lookAround'],
35+
action: <strong>{t['rando3D.actions.leftClick']}</strong>,
36+
},
37+
{
38+
label: t['rando3D.instructions.moveAround'],
39+
action: <Image width={50} height={33} src="/images/3d/icon_783__.png" alt="" />,
40+
},
41+
],
42+
cameraTitle: t['rando3D.views.bird.cameraTitle'],
43+
},
44+
{
45+
control: 'hiker',
46+
title: t['rando3D.views.hiker.title'],
47+
steps: [
48+
{
49+
label: t['rando3D.instructions.lookAround'],
50+
action: <strong>{t['rando3D.actions.leftClick']}</strong>,
51+
},
52+
{
53+
label: t['rando3D.instructions.playPause'],
54+
action: <strong>{t['rando3D.actions.space']}</strong>,
55+
},
56+
{
57+
label: t['rando3D.instructions.stop'],
58+
action: <strong>{t['rando3D.actions.enter']}</strong>,
59+
},
60+
],
61+
cameraTitle: t['rando3D.views.examine.hiker'],
62+
},
63+
];
64+
65+
const Interface: React.FC = () => {
66+
const { messages } = useIntl();
67+
const controls = getControls(messages);
68+
return (
69+
<section className="interface absolute inset-0 pointer-events-none z-10">
70+
{controls.map(({ control, title, steps }) => (
71+
<Control
72+
key={control}
73+
className={`controls controls--${control} absolute top-0 right-0 w-70 p-4 hidden`}
74+
>
75+
<h2 className="text-2xl mb-2">{title}</h2>
76+
<p className="controls-description mb-2" />
77+
{steps.map(({ label, action }, index) => (
78+
<span key={index} className="block m-1">
79+
{label} <span className="font-bold">{action}</span>
80+
</span>
81+
))}
82+
</Control>
83+
))}
84+
85+
<Camera className="camera_switcher absolute hidden top-90 right-0 w-15 pointer-events-auto">
86+
{controls.map(({ control, cameraTitle }) => (
87+
<CameraItem
88+
key={control}
89+
className={`camera camera--${control} camera--disabled text-center cursor-pointer`}
90+
>
91+
<button type="button" className="block">
92+
<Image width="100%" height="100%" src={`/images/3d/camera-${control}.svg`} alt="" />
93+
<span className="block">{cameraTitle}</span>
94+
</button>
95+
</CameraItem>
96+
))}
97+
</Camera>
98+
99+
<div className="absolute bottom-1 left-2 block pointer-events-auto">
100+
<a
101+
className="geotrek_link"
102+
href="https://makina-corpus.com/"
103+
target="_blank"
104+
rel="noreferrer"
105+
>
106+
<Image width={80} height={80} src="/images/3d/logo-makina-corpus.svg" />
107+
</a>
108+
</div>
109+
110+
<strong className="absolute bottom-1 right-2">©IGN</strong>
111+
</section>
112+
);
113+
};
114+
115+
export default Interface;

0 commit comments

Comments
 (0)