Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 031ab35

Browse files
committed
fix: use Fi translations over base fields
Backend SQL optimizer doesn't support the base fields if there exists translated fields. nameFi is an alias for the base field.
1 parent 49165d1 commit 031ab35

13 files changed

Lines changed: 133 additions & 131 deletions

File tree

apps/admin-ui/gql/gql-types.ts

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5471,7 +5471,7 @@ export type ApplicationNameFragment = {
54715471
applicantType?: ApplicantTypeChoice | null;
54725472
organisation?: {
54735473
id: string;
5474-
name: string;
5474+
nameFi?: string | null;
54755475
organisationType: OrganizationTypeChoice;
54765476
} | null;
54775477
contactPerson?: { id: string; lastName: string; firstName: string } | null;
@@ -5581,17 +5581,17 @@ export type ApplicantFragment = {
55815581
organisation?: {
55825582
id: string;
55835583
pk?: number | null;
5584-
name: string;
5584+
nameFi?: string | null;
55855585
identifier?: string | null;
55865586
organisationType: OrganizationTypeChoice;
5587-
coreBusiness: string;
5587+
coreBusinessFi?: string | null;
55885588
yearEstablished?: number | null;
55895589
address?: {
55905590
id: string;
55915591
pk?: number | null;
55925592
postCode: string;
5593-
streetAddress: string;
5594-
city: string;
5593+
streetAddressFi?: string | null;
5594+
cityFi?: string | null;
55955595
} | null;
55965596
} | null;
55975597
homeCity?: {
@@ -5605,8 +5605,8 @@ export type ApplicantFragment = {
56055605
id: string;
56065606
pk?: number | null;
56075607
postCode: string;
5608-
streetAddress: string;
5609-
city: string;
5608+
streetAddressFi?: string | null;
5609+
cityFi?: string | null;
56105610
} | null;
56115611
user?: {
56125612
id: string;
@@ -5781,17 +5781,17 @@ export type ApplicationCommonFragment = {
57815781
organisation?: {
57825782
id: string;
57835783
pk?: number | null;
5784-
name: string;
5784+
nameFi?: string | null;
57855785
identifier?: string | null;
57865786
organisationType: OrganizationTypeChoice;
5787-
coreBusiness: string;
5787+
coreBusinessFi?: string | null;
57885788
yearEstablished?: number | null;
57895789
address?: {
57905790
id: string;
57915791
pk?: number | null;
57925792
postCode: string;
5793-
streetAddress: string;
5794-
city: string;
5793+
streetAddressFi?: string | null;
5794+
cityFi?: string | null;
57955795
} | null;
57965796
} | null;
57975797
homeCity?: {
@@ -5805,8 +5805,8 @@ export type ApplicationCommonFragment = {
58055805
id: string;
58065806
pk?: number | null;
58075807
postCode: string;
5808-
streetAddress: string;
5809-
city: string;
5808+
streetAddressFi?: string | null;
5809+
cityFi?: string | null;
58105810
} | null;
58115811
user?: {
58125812
id: string;
@@ -5955,17 +5955,17 @@ export type ApplicationQuery = {
59555955
organisation?: {
59565956
id: string;
59575957
pk?: number | null;
5958-
name: string;
5958+
nameFi?: string | null;
59595959
identifier?: string | null;
59605960
organisationType: OrganizationTypeChoice;
5961-
coreBusiness: string;
5961+
coreBusinessFi?: string | null;
59625962
yearEstablished?: number | null;
59635963
address?: {
59645964
id: string;
59655965
pk?: number | null;
59665966
postCode: string;
5967-
streetAddress: string;
5968-
city: string;
5967+
streetAddressFi?: string | null;
5968+
cityFi?: string | null;
59695969
} | null;
59705970
} | null;
59715971
homeCity?: {
@@ -5979,8 +5979,8 @@ export type ApplicationQuery = {
59795979
id: string;
59805980
pk?: number | null;
59815981
postCode: string;
5982-
streetAddress: string;
5983-
city: string;
5982+
streetAddressFi?: string | null;
5983+
cityFi?: string | null;
59845984
} | null;
59855985
user?: {
59865986
id: string;
@@ -6202,7 +6202,7 @@ export type ApplicationSectionFragment = {
62026202
applicantType?: ApplicantTypeChoice | null;
62036203
organisation?: {
62046204
id: string;
6205-
name: string;
6205+
nameFi?: string | null;
62066206
organisationType: OrganizationTypeChoice;
62076207
} | null;
62086208
contactPerson?: { id: string; lastName: string; firstName: string } | null;
@@ -6306,17 +6306,17 @@ export type ApplicationAdminFragment = {
63066306
organisation?: {
63076307
id: string;
63086308
pk?: number | null;
6309-
name: string;
6309+
nameFi?: string | null;
63106310
identifier?: string | null;
63116311
organisationType: OrganizationTypeChoice;
6312-
coreBusiness: string;
6312+
coreBusinessFi?: string | null;
63136313
yearEstablished?: number | null;
63146314
address?: {
63156315
id: string;
63166316
pk?: number | null;
63176317
postCode: string;
6318-
streetAddress: string;
6319-
city: string;
6318+
streetAddressFi?: string | null;
6319+
cityFi?: string | null;
63206320
} | null;
63216321
} | null;
63226322
homeCity?: {
@@ -6330,8 +6330,8 @@ export type ApplicationAdminFragment = {
63306330
id: string;
63316331
pk?: number | null;
63326332
postCode: string;
6333-
streetAddress: string;
6334-
city: string;
6333+
streetAddressFi?: string | null;
6334+
cityFi?: string | null;
63356335
} | null;
63366336
user?: {
63376337
id: string;
@@ -8243,17 +8243,17 @@ export type ApplicationAdminQuery = {
82438243
organisation?: {
82448244
id: string;
82458245
pk?: number | null;
8246-
name: string;
8246+
nameFi?: string | null;
82478247
identifier?: string | null;
82488248
organisationType: OrganizationTypeChoice;
8249-
coreBusiness: string;
8249+
coreBusinessFi?: string | null;
82508250
yearEstablished?: number | null;
82518251
address?: {
82528252
id: string;
82538253
pk?: number | null;
82548254
postCode: string;
8255-
streetAddress: string;
8256-
city: string;
8255+
streetAddressFi?: string | null;
8256+
cityFi?: string | null;
82578257
} | null;
82588258
} | null;
82598259
homeCity?: {
@@ -8267,8 +8267,8 @@ export type ApplicationAdminQuery = {
82678267
id: string;
82688268
pk?: number | null;
82698269
postCode: string;
8270-
streetAddress: string;
8271-
city: string;
8270+
streetAddressFi?: string | null;
8271+
cityFi?: string | null;
82728272
} | null;
82738273
user?: {
82748274
id: string;
@@ -8494,7 +8494,7 @@ export type ApplicationSectionAllocationsQuery = {
84948494
applicantType?: ApplicantTypeChoice | null;
84958495
organisation?: {
84968496
id: string;
8497-
name: string;
8497+
nameFi?: string | null;
84988498
organisationType: OrganizationTypeChoice;
84998499
} | null;
85008500
contactPerson?: {
@@ -8608,7 +8608,7 @@ export type RejectedOccurrencesQuery = {
86088608
firstName: string;
86098609
lastName: string;
86108610
} | null;
8611-
organisation?: { id: string; name: string } | null;
8611+
organisation?: { id: string; nameFi?: string | null } | null;
86128612
};
86138613
};
86148614
reservationUnit: {
@@ -8687,7 +8687,7 @@ export type ApplicationsQuery = {
86878687
}> | null;
86888688
organisation?: {
86898689
id: string;
8690-
name: string;
8690+
nameFi?: string | null;
86918691
organisationType: OrganizationTypeChoice;
86928692
} | null;
86938693
contactPerson?: {
@@ -8802,7 +8802,7 @@ export type ApplicationSectionsQuery = {
88028802
applicantType?: ApplicantTypeChoice | null;
88038803
organisation?: {
88048804
id: string;
8805-
name: string;
8805+
nameFi?: string | null;
88068806
organisationType: OrganizationTypeChoice;
88078807
} | null;
88088808
contactPerson?: {
@@ -8884,7 +8884,7 @@ export type AllocatedTimeSlotsQuery = {
88848884
applicantType?: ApplicantTypeChoice | null;
88858885
organisation?: {
88868886
id: string;
8887-
name: string;
8887+
nameFi?: string | null;
88888888
organisationType: OrganizationTypeChoice;
88898889
} | null;
88908890
contactPerson?: {
@@ -8994,17 +8994,17 @@ export const ApplicantFragmentDoc = gql`
89948994
organisation {
89958995
id
89968996
pk
8997-
name
8997+
nameFi
89988998
identifier
89998999
organisationType
9000-
coreBusiness
9000+
coreBusinessFi
90019001
yearEstablished
90029002
address {
90039003
id
90049004
pk
90059005
postCode
9006-
streetAddress
9007-
city
9006+
streetAddressFi
9007+
cityFi
90089008
}
90099009
}
90109010
homeCity {
@@ -9018,8 +9018,8 @@ export const ApplicantFragmentDoc = gql`
90189018
id
90199019
pk
90209020
postCode
9021-
streetAddress
9022-
city
9021+
streetAddressFi
9022+
cityFi
90239023
}
90249024
user {
90259025
id
@@ -9283,7 +9283,7 @@ export const ApplicationNameFragmentDoc = gql`
92839283
applicantType
92849284
organisation {
92859285
id
9286-
name
9286+
nameFi
92879287
organisationType
92889288
}
92899289
contactPerson {
@@ -15495,7 +15495,7 @@ export const RejectedOccurrencesDocument = gql`
1549515495
}
1549615496
organisation {
1549715497
id
15498-
name
15498+
nameFi
1549915499
}
1550015500
}
1550115501
}

apps/admin-ui/src/helpers/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ type Application = {
8383
organisation?:
8484
| Pick<
8585
NonNullable<Pick<ApplicationNode, "organisation">["organisation"]>,
86-
"name"
86+
"nameFi"
8787
>
8888
| null
8989
| undefined;
@@ -96,7 +96,7 @@ export function getApplicantName(app?: Application | undefined | null): string {
9696
const { firstName, lastName } = app.contactPerson || {};
9797
return `${firstName || "-"} ${lastName || "-"}`;
9898
}
99-
return app.organisation?.name || "-";
99+
return app.organisation?.nameFi || "-";
100100
}
101101

102102
export function getApplicationStatusColor(

apps/admin-ui/src/spa/applications/[id]/index.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ function ApplicationDetails({
940940
{isOrganisation && (
941941
<KV
942942
k={t("Application.coreActivity")}
943-
v={application.organisation?.coreBusiness || "-"}
943+
v={application.organisation?.coreBusinessFi || "-"}
944944
/>
945945
)}
946946
</DefinitionList>
@@ -984,11 +984,11 @@ function ApplicationDetails({
984984
<>
985985
<ValueBox
986986
label={t("Application.organisationName")}
987-
value={application.organisation?.name}
987+
value={application.organisation?.nameFi}
988988
/>
989989
<ValueBox
990990
label={t("Application.coreActivity")}
991-
value={application.organisation?.coreBusiness}
991+
value={application.organisation?.coreBusinessFi}
992992
/>
993993
<ValueBox label={t("common.homeCity")} value={homeCity} />
994994
<ValueBox
@@ -1031,15 +1031,15 @@ function ApplicationDetails({
10311031
<EventProps>
10321032
<ValueBox
10331033
label={t("common.streetAddress")}
1034-
value={application.organisation?.address?.streetAddress}
1034+
value={application.organisation?.address?.streetAddressFi}
10351035
/>
10361036
<ValueBox
10371037
label={t("common.postalNumber")}
10381038
value={application.organisation?.address?.postCode}
10391039
/>
10401040
<ValueBox
10411041
label={t("common.postalDistrict")}
1042-
value={application.organisation?.address?.city}
1042+
value={application.organisation?.address?.cityFi}
10431043
/>
10441044
</EventProps>
10451045
</>
@@ -1054,15 +1054,15 @@ function ApplicationDetails({
10541054
<EventProps>
10551055
<ValueBox
10561056
label={t("common.streetAddress")}
1057-
value={application.billingAddress?.streetAddress}
1057+
value={application.billingAddress?.streetAddressFi}
10581058
/>
10591059
<ValueBox
10601060
label={t("common.postalNumber")}
10611061
value={application.billingAddress?.postCode}
10621062
/>
10631063
<ValueBox
10641064
label={t("common.postalDistrict")}
1065-
value={application.billingAddress?.city}
1065+
value={application.billingAddress?.cityFi}
10661066
/>
10671067
</EventProps>
10681068
</>

apps/admin-ui/src/spa/recurring-reservations/application-rounds/[id]/review/RejectedOccurrencesDataLoader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export const REJECTED_OCCURRENCES_QUERY = gql`
179179
}
180180
organisation {
181181
id
182-
name
182+
nameFi
183183
}
184184
}
185185
}

0 commit comments

Comments
 (0)