Skip to content

Commit

Permalink
Merge pull request #136 from solita/renovate-fix/prettier-3.x
Browse files Browse the repository at this point in the history
Update dependency prettier to v3
  • Loading branch information
Juholei authored Mar 8, 2024
2 parents 1317445 + 63e54d9 commit 1cda5a4
Show file tree
Hide file tree
Showing 23 changed files with 163 additions and 121 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci-public.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
cache-dependency-path: etp-public/package-lock.json
- run: npm ci
- run: npm run build --if-present
- run: npm run check-format

format:
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions etp-front/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"plugins": ["prettier-plugin-svelte"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }],
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
Expand Down
36 changes: 18 additions & 18 deletions etp-front/package-lock.json

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

4 changes: 2 additions & 2 deletions etp-front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
"postcss-load-config": "^2.1.0",
"postcss-loader": "^3.0.0",
"postcss-preset-env": "^6.7.0",
"prettier": "^2.8.6",
"prettier-plugin-svelte": "^2.10.0",
"prettier": "^3.0.0",
"prettier-plugin-svelte": "^3.2.2",
"svelte": "^3.37.0",
"svelte-loader": "^2.13.6",
"svelte-preprocess": "^3.3.0",
Expand Down
4 changes: 3 additions & 1 deletion etp-front/src/components/Button/Button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
<style type="text/postcss">
button {
@apply relative px-6 py-3 flex justify-center items-center rounded-full font-bold uppercase text-light tracking-xl min-w-10;
transition: padding-right 0.5s, padding-left 0.5s;
transition:
padding-right 0.5s,
padding-left 0.5s;
}
.primary {
Expand Down
9 changes: 6 additions & 3 deletions etp-front/src/components/Select/Select2.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,12 @@
search={true}
on:input={evt => {
textCancel();
textCancel = Future.value(value => {
searchText = value;
}, Future.after(500, Maybe.fromEmpty(R.trim(evt.target.value))));
textCancel = Future.value(
value => {
searchText = value;
},
Future.after(500, Maybe.fromEmpty(R.trim(evt.target.value)))
);
}} />
</div>
{/if}
Expand Down
4 changes: 2 additions & 2 deletions etp-front/src/pages/breadcrumb/breadcrumb-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,8 @@ const folderForKayttajaRole = R.curry((i18n, whoami, kayttaja) =>
R.eqProps('id', whoami, kayttaja)
? []
: Kayttajat.isAccreditedLaatija(kayttaja)
? laatijat(i18n)
: kayttajat(i18n)
? laatijat(i18n)
: kayttajat(i18n)
);

export const kayttajaIdCrumb = R.curry((i18n, whoami, id) => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@
const updateInput = label => {
const kunta = Maybe.find(R.compose(R.equals(label), kuntaLabel), kunnat);
R.forEach(id => {
input.value = id;
input.dispatchEvent(new Event('change', { bubbles: true }));
}, R.map(R.prop('id'), kunta));
R.forEach(
id => {
input.value = id;
input.dispatchEvent(new Event('change', { bubbles: true }));
},
R.map(R.prop('id'), kunta)
);
};
$: !R.isNil(input) && updateInput(queryKuntaLabel);
Expand Down
12 changes: 6 additions & 6 deletions etp-front/src/pages/energiatodistus/korvaavuus/korvattu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@
Korvaus.isSame(korvattava, energiatodistus)
? Maybe.Some('is-same')
: !Korvaus.isValidState(korvattava, energiatodistus)
? Maybe.Some('invalid-tila')
: Korvaus.hasOtherKorvaaja(korvattava, energiatodistus)
? Maybe.Some('already-replaced')
: Maybe.None();
? Maybe.Some('invalid-tila')
: Korvaus.hasOtherKorvaaja(korvattava, energiatodistus)
? Maybe.Some('already-replaced')
: Maybe.None();
const fetchKorvattavaEnergiatodistus = initialDelay => id => {
cancel = R.compose(
Expand Down Expand Up @@ -107,8 +107,8 @@
? Maybe.isNone(R.chain(parseId, query))
? Maybe.Some('invalid-id')
: korvattavaEnergiatodistus.isNone()
? Maybe.Some('not-found')
: R.chain(korvattavaETError, korvattavaEnergiatodistus)
? Maybe.Some('not-found')
: R.chain(korvattavaETError, korvattavaEnergiatodistus)
: Maybe.None();
const searchKorvattavaEnergiatodistus = R.compose(
Expand Down
4 changes: 2 additions & 2 deletions etp-front/src/pages/energiatodistus/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ export const assocRequired = (schema, property) => {
const language = R.endsWith('-fi', property)
? 'fi'
: R.endsWith('-sv', property)
? 'sv'
: 'all';
? 'sv'
: 'all';

return R.unless(
R.compose(R.isNil, R.path(path)),
Expand Down
4 changes: 2 additions & 2 deletions etp-front/src/pages/energiatodistus/signing.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@
const signAllPdf = Kielisyys.bilingual(energiatodistus)
? Future.and(signPdf('sv'), signPdf('fi'))
: Kielisyys.onlySv(energiatodistus)
? signPdf('sv')
: signPdf('fi');
? signPdf('sv')
: signPdf('fi');
const signingProcess = R.compose(
Future.fork(response => {
Expand Down
8 changes: 4 additions & 4 deletions etp-front/src/pages/valvonta-kaytto/osapuolet.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ export const toimitustapaErrorKey = {
(Maybe.isNone(yritys.ytunnus) || invalidOsoite(yritys))
? Maybe.Some('suomifi-yritys')
: invalidEmail(yritys)
? Maybe.Some('email')
: Maybe.None(),
? Maybe.Some('email')
: Maybe.None(),
henkilo: henkilo =>
toimitustapa.suomifi(henkilo) &&
(Maybe.isNone(henkilo.henkilotunnus) || invalidOsoite(henkilo))
? Maybe.Some('suomifi-henkilo')
: invalidEmail(henkilo)
? Maybe.Some('email')
: Maybe.None()
? Maybe.Some('email')
: Maybe.None()
};

/**
Expand Down
96 changes: 55 additions & 41 deletions etp-front/src/pages/valvonta-kaytto/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,50 +109,64 @@ export const toimenpidePublish = (templates, toimenpide) =>
'type-specific-data': {
fine: addRequiredValidator(Toimenpiteet.hasFine(toimenpide)),
'osapuoli-specific-data': osapuoliSpecificSchema =>
R.addIndex(R.map)((item, index) => {
const hasDocument = R.path(
[
'type-specific-data',
'osapuoli-specific-data',
index,
'document'
],
toimenpide
);
R.addIndex(R.map)(
(item, index) => {
const hasDocument = R.path(
[
'type-specific-data',
'osapuoli-specific-data',
index,
'document'
],
toimenpide
);

const recipientAnswered = R.path(
[
'type-specific-data',
'osapuoli-specific-data',
index,
'recipient-answered'
],
toimenpide
);
return R.compose(
addRequiredValidatorToFieldsWhen(
(Toimenpiteet.isDecisionOrderActualDecision(toimenpide) ||
Toimenpiteet.isPenaltyDecisionActualDecision(toimenpide)) &&
recipientAnswered,
const recipientAnswered = R.path(
[
'answer-commentary-sv',
'answer-commentary-fi',
'statement-sv',
'statement-fi'
]
),
addRequiredValidatorToFieldsWhen(
(Toimenpiteet.isDecisionOrderActualDecision(toimenpide) ||
Toimenpiteet.isPenaltyDecisionActualDecision(toimenpide)) &&
hasDocument,
['hallinto-oikeus-id']
),
addRequiredValidatorToFieldsWhen(
Toimenpiteet.isNoticeBailiff(toimenpide) && hasDocument,
['karajaoikeus-id', 'haastemies-email']
'type-specific-data',
'osapuoli-specific-data',
index,
'recipient-answered'
],
toimenpide
);
return R.compose(
addRequiredValidatorToFieldsWhen(
(Toimenpiteet.isDecisionOrderActualDecision(toimenpide) ||
Toimenpiteet.isPenaltyDecisionActualDecision(toimenpide)) &&
recipientAnswered,
[
'answer-commentary-sv',
'answer-commentary-fi',
'statement-sv',
'statement-fi'
]
),
addRequiredValidatorToFieldsWhen(
(Toimenpiteet.isDecisionOrderActualDecision(toimenpide) ||
Toimenpiteet.isPenaltyDecisionActualDecision(toimenpide)) &&
hasDocument,
['hallinto-oikeus-id']
),
addRequiredValidatorToFieldsWhen(
Toimenpiteet.isNoticeBailiff(toimenpide) && hasDocument,
['karajaoikeus-id', 'haastemies-email']
)
)(item);
},
R.map(
R.always(osapuoliSpecificSchema[0]),
R.range(
0,
R.length(
R.path(
['type-specific-data', 'osapuoli-specific-data'],
toimenpide
)
)
)
)(item);
}, R.map(R.always(osapuoliSpecificSchema[0]), R.range(0, R.length(R.path(['type-specific-data', 'osapuoli-specific-data'], toimenpide))))),
)
),
'department-head-title-fi': addRequiredValidator(
Toimenpiteet.isDecisionOrderActualDecision(toimenpide)
),
Expand Down
9 changes: 6 additions & 3 deletions etp-front/src/pages/valvonta-kaytto/valvonnat.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,12 @@
search={true}
on:input={evt => {
textCancel();
textCancel = Future.value(keyword => {
query = R.assoc('keyword', keyword, query);
}, Future.after(1000, Maybe.fromEmpty(R.trim(evt.target.value))));
textCancel = Future.value(
keyword => {
query = R.assoc('keyword', keyword, query);
},
Future.after(1000, Maybe.fromEmpty(R.trim(evt.target.value)))
);
}} />
</div>
<div class="md:col-span-1 col-span-4">
Expand Down
9 changes: 6 additions & 3 deletions etp-front/src/pages/valvonta-oikeellisuus/valvonnat.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,12 @@
search={true}
on:input={evt => {
textCancel();
textCancel = Future.value(keyword => {
query = R.assoc('keyword', keyword, query);
}, Future.after(1000, Maybe.fromEmpty(R.trim(evt.target.value))));
textCancel = Future.value(
keyword => {
query = R.assoc('keyword', keyword, query);
},
Future.after(1000, Maybe.fromEmpty(R.trim(evt.target.value)))
);
}} />
</div>
<div class="w-1/2 md:w-1/4">
Expand Down
9 changes: 6 additions & 3 deletions etp-front/src/pages/viesti/viestit.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,12 @@
search={true}
on:input={evt => {
cancelKeywordSearch();
cancelKeywordSearch = Future.value(keyword => {
query = R.assoc('keyword', keyword, query);
}, Future.after(1000, Maybe.fromEmpty(R.trim(evt.target.value))));
cancelKeywordSearch = Future.value(
keyword => {
query = R.assoc('keyword', keyword, query);
},
Future.after(1000, Maybe.fromEmpty(R.trim(evt.target.value)))
);
}} />
</div>
<div class="md:w-1/2 w-full mr-4 my-4 md:my-8">
Expand Down
2 changes: 1 addition & 1 deletion etp-front/src/template.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="fi">
<head>
<meta charset="utf-8" />
Expand Down
2 changes: 2 additions & 0 deletions etp-public/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"plugins": ["prettier-plugin-svelte"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }],
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
Expand Down
Loading

0 comments on commit 1cda5a4

Please sign in to comment.