-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: rebuilds/-styles (and -names) application (pre)view component #1452
base: refactor-seasonal-reservation
Are you sure you want to change the base?
fix: rebuilds/-styles (and -names) application (pre)view component #1452
Conversation
23e07cb
to
ad7553d
Compare
ad7553d
to
434f65d
Compare
- All secondary buttons / link buttons use white background. - Remove overrides from buttons inside a Card. - Replace !important overrides with focus / hover vars.
c7b0105
to
dfbf8be
Compare
- move criteria and search pages under the application round
- use `applications` base url for all application page - remove unnecessary intro page
- use SSR for query - include when the application was handled - remove unneccessary button section
dfbf8be
to
acdb5c3
Compare
- ViewInner.tsx becomes ViewApplication.tsx
434f65d
to
ca636b6
Compare
@@ -51,112 +66,204 @@ const formatDurationSeconds = (seconds: number, t: TFunction): string => { | |||
)}`; | |||
}; | |||
|
|||
const getDuration = (begin: number, end: number, t: TFunction): string => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getDuration
-> formatDurationRange
begin
-> beginSecs
end
-> endSecs
|
||
const sections = aes.map((applicationEvent, i) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrap the loop invariant into a component. No 100s lines of JSX inside map
invariant
const InfoListItem = ({ label, value }: { label: string; value: string }) => ( | ||
<li> | ||
{`${label}: `} | ||
<span className="value">{value}</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why class?
"status": { | ||
"UNALLOCATED": "Vastaanotettu", | ||
"IN_ALLOCATION": "Käsittelyssä", | ||
"HANDLED": "Hyväksytty", | ||
"REJECTED": "Hylätty" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move enum translations to top level of the json with a key that matches the enum type name, not a generic status
key
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are the en
and sv
translations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where are the en
and sv
translations?
<Accordion heading={t("application:preview.reservationUnitTerms")} open> | ||
<CompactTermsBox | ||
id="preview.acceptServiceSpecificTerms" | ||
heading="" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you made heading optional, why pass heading=""
here?
{reservationUnits?.map((ru) => ( | ||
<li key={ru?.pk}> | ||
{getTranslation(ru ?? {}, "name").trim()} | ||
</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filterNonNullable
instead of ?.
and ??
const reservationUnits = | ||
applicationEvent.reservationUnitOptions?.map((eru, index) => ({ | ||
pk: eru.reservationUnit?.pk ?? 0, | ||
priority: index, | ||
nameFi: eru.reservationUnit?.nameFi ?? undefined, | ||
nameSv: eru.reservationUnit?.nameSv ?? undefined, | ||
nameEn: eru.reservationUnit?.nameEn ?? undefined, | ||
})) ?? []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why? why not use reservationUnitOptions.reservationUnit
directly? ex
filterNonNullable(applicationEvent.reservationUnitOptions?.flatMap((x) => x. reservationUnit))
prefer filterNonNullable
over ?? []
why is index
turned into priority
? looks wrong. why do we need priority
? why isn't it gotten from the backend?
const primaryTimes = | ||
applicationEvent.suitableTimeRanges | ||
?.filter(filterPrimary) | ||
.map(convertApplicationSchedule) ?? []; | ||
const secondaryTimes = | ||
applicationEvent.suitableTimeRanges | ||
?.filter(filterSecondary) | ||
.map(convertApplicationSchedule) ?? []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filterNonNullable
over ?? []
22c0c11
to
9f54174
Compare
🛠️ Changelog
🧪 Test plan
🎫 Tickets