Skip to content

Commit 42922e8

Browse files
e-halinenjhanninen
andauthored
Production release (#126)
* Revert "Fix login url to prevent redirect" This reverts commit 7127c16. * Show prompt when template isn't selected instead of generating (#109) * AB#32667: Add smaller TerminalPoster variant (#110) * AB#32085: Add UI for testing line timetable generation (#111) * Ab#32085: Prevent LineTimetable generation without dates (#112) * AB#32085: Add UI for testing line timetable generation * AB#32085: Disable linetimetable generation without dates * AB#32085: Improve search UX, generate multiple line timetables at once (#113) * AB#32085: Improve search UX, add capability to generate multiple line timetables at once * Sort search results by lineId * Shorten train IDs so they display correctly * AB#32085: Print LineTimetable as A5 (#114) * AB#46862: Tweak placeholder texts for route filtering (#115) * Add local env * AB#48698: Add option for printing out the cover page for timetables (#118) * AB#48698: Add option for printing out the cover page for timetables * Add per-build cover page * Update button disabling logic * AB#53258: Fix map-publisher showing up in google search results (#119) * AB#55632: Kilvitysohje UI first version (#121) * AB#55632: First draft of kilvitysohje UI * AB#55632: Add support for multiple file types * AB#55632: Show stop mode filter * AB#55632: Add line mode colors to multi-select labels * Fix bug with opening empty build id * Change date range picker title for StopRoutePlate * AB#57920: Add line query mode for StopRoutePlate component (#123) * AB#57920: Add line query mode for StopRoutePlate component * Add styling to StopRoutePlate line query option * Add error checking and clearing selected lines after generating starts * AB#56573: Add version numbering and PR check against prod version (#124) * AB#56573: Add version numbering and PR check against prod version * AB#56568: Change license to AGPL-3.0-only (#125) * AB#57970: Switch to configurable ID provider, change prod ID provider (#122) * AB#57970: Switch to configurable ID provider, change prod ID provider and client ID * v1.1.0 --------- Co-authored-by: Juho Hänninen <juho.hanninen@cgi.com>
1 parent 8bfcdec commit 42922e8

File tree

19 files changed

+560
-68
lines changed

19 files changed

+560
-68
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ REACT_APP_API_URL=http://localhost:4000
44
REACT_APP_JORE_API_URL=https://kartat.hsl.fi/jore/graphql
55
REACT_APP_CLIENT_ID=7833861618225795
66
REACT_APP_REDIRECT_URI=http://localhost:3000
7+
REACT_APP_LOGIN_PROVIDER_URI=https://hslid-uat.cinfra.fi
78
REACT_APP_NAMESPACE=hsl-kartta
89

910
CYPRESS_TESTING_HSLID_USERNAME=

.env.dev

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ REACT_APP_API_URL=https://dev.kartat.hsl.fi/julkaisin-api
44
REACT_APP_JORE_API_URL=https://dev.kartat.hsl.fi/jore/graphql
55
REACT_APP_CLIENT_ID=7833861618225795
66
REACT_APP_REDIRECT_URI=https://dev.kartat.hsl.fi/julkaisin
7+
REACT_APP_LOGIN_PROVIDER_URI=https://hslid-uat.cinfra.fi
78
REACT_APP_NAMESPACE=hsl-kartta
89

910
CYPRESS_TESTING_HSLID_USERNAME=

.env.local

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ REACT_APP_API_URL=http://localhost:4000
44
REACT_APP_JORE_API_URL=https://dev.kartat.hsl.fi/jore/graphql
55
REACT_APP_CLIENT_ID=7833861618225795
66
REACT_APP_REDIRECT_URI=http://localhost:3000
7+
REACT_APP_LOGIN_PROVIDER_URI=https://hslid-uat.cinfra.fi
78
REACT_APP_NAMESPACE=hsl-kartta
89

910
CYPRESS_TESTING_HSLID_USERNAME=

.env.prod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
REACT_APP_API_URL=https://kartat.hsl.fi/julkaisin-api
44
REACT_APP_JORE_API_URL=https://kartat.hsl.fi/jore/graphql
5-
REACT_APP_CLIENT_ID=7833861618225795
5+
REACT_APP_CLIENT_ID=0704589208046070
66
REACT_APP_REDIRECT_URI=https://kartat.hsl.fi/julkaisin
7+
REACT_APP_LOGIN_PROVIDER_URI=https://id.hsl.fi
78
REACT_APP_NAMESPACE=hsl-kartta

.env.stage

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Check version numbering is updated prior to merging
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
check_version:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
- name: Check if version has been updated
15+
id: check
16+
uses: EndBug/version-check@v2
17+
- name: Fail if version is not changed prior to merge
18+
if: steps.check.outputs.changed == 'false'
19+
uses: actions/github-script@v7
20+
with:
21+
script: |
22+
core.setFailed('No version number change found. Run `yarn version`-command to upgrade version before merge can be completed.')

LICENSE

Lines changed: 211 additions & 21 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "hsl-map-publisher-ui",
3-
"version": "0.1.0",
3+
"version": "1.1.0",
44
"private": true,
5-
"license": "MIT",
5+
"license": "AGPL-3.0-only",
66
"homepage": "./",
77
"dependencies": {
88
"@material-ui/core": "^4.11.0",

src/components/Build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const Build = props => {
101101
{props.pending < 1 && props.ready > 0 && (
102102
<RaisedButton
103103
onClick={() => downloadBuild({ id: props.id })}
104-
label="Lataa PDF"
104+
label="Lataa tulosteet"
105105
style={{ marginLeft: 10 }}
106106
primary
107107
/>

src/components/BuildDetails.js

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import FlatButton from 'material-ui/FlatButton';
1010
import RaisedButton from 'material-ui/RaisedButton';
1111
import Divider from 'material-ui/Divider';
1212

13-
import { downloadPoster, downloadBuildSection } from '../util/api';
13+
import { downloadPoster, downloadBuildSection, downloadCoverPageBuild } from '../util/api';
1414

1515
const Root = styled.div`
1616
overflow: auto;
@@ -117,7 +117,7 @@ const Poster = props => (
117117
<FlatButton
118118
disabled={props.status !== 'READY'}
119119
onClick={() => downloadPoster({ id: props.id })}
120-
label="Lataa PDF"
120+
label={props.component === 'StopRoutePlate' ? 'Lataa CSV' : 'Lataa PDF'}
121121
primary
122122
/>
123123
<FlatButton
@@ -160,6 +160,22 @@ class BuildDetails extends Component {
160160
this.setState({ last: { value, isValid } });
161161
};
162162

163+
isCoverPagePrintingAllowed = posters => {
164+
// Enable timetable cover page only if the build contains timetables
165+
const hasTimetablePosters = posters.filter(poster => poster.component === 'Timetable');
166+
return hasTimetablePosters.length > 0;
167+
};
168+
169+
hasSpreadsheetDownload = posters => {
170+
const hasCSVFiles = posters.filter(poster => poster.component === 'StopRoutePlate');
171+
return hasCSVFiles.length > 0;
172+
};
173+
174+
hasOnlySpreadsheetDownloads = posters => {
175+
const hasOnlyCSVFiles = posters.filter(poster => poster.component === 'StopRoutePlate');
176+
return hasOnlyCSVFiles.length === posters.length;
177+
};
178+
163179
render() {
164180
const buildDownloadEnabled = this.state.first.isValid && this.state.last.isValid;
165181
return (
@@ -222,6 +238,21 @@ class BuildDetails extends Component {
222238
label="Lataa PDF"
223239
primary
224240
/>
241+
<RaisedButton
242+
disabled={
243+
buildDownloadEnabled ? !this.isCoverPagePrintingAllowed(this.props.posters) : true
244+
}
245+
style={{ marginLeft: '1rem' }}
246+
onClick={() =>
247+
downloadCoverPageBuild({
248+
id: this.props.id,
249+
first: this.state.first.value - 1,
250+
last: this.state.last.value,
251+
})
252+
}
253+
label="Lataa kansilehdellinen PDF"
254+
primary
255+
/>
225256
</Buttons>
226257
</Root>
227258
</Dialog>

0 commit comments

Comments
 (0)