Skip to content
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

feat(native-app): update applications screen #15964

Merged
merged 32 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
25cba4d
feat: first version of updating applications
thoreyjona Sep 9, 2024
1bae6f6
feat: first version of applications subscreens
thoreyjona Sep 9, 2024
7a29178
feat: reusable component for applications list
thoreyjona Sep 11, 2024
a6b3a59
feat: new progress bar and final ui for status card
thoreyjona Sep 11, 2024
854145b
fix: change unfinished to incomplete and finished to completed to kee…
thoreyjona Sep 11, 2024
705dc71
feat: add applications preview component to use on applications screen
thoreyjona Sep 11, 2024
d5bb331
feat: applications module now uses applications preview as well
thoreyjona Sep 11, 2024
8cc23d5
fix: add bottom tabs indicator on applications screen
thoreyjona Sep 11, 2024
dbc4ba9
feat: finalizing progress meter
thoreyjona Sep 11, 2024
44dbc1c
fix: getTypeAndBadgeVariant should match sorting
thoreyjona Sep 11, 2024
b06758e
fix: loading state for list screens
thoreyjona Sep 11, 2024
5faee4e
fix: add margin to skeleton loaders for lists
thoreyjona Sep 11, 2024
01d4fe1
fix: add error to applications list of something goes wrong and no da…
thoreyjona Sep 11, 2024
67312d6
feat: add pull to refresh on new applications page
thoreyjona Sep 11, 2024
d1965dd
fix: fix imports
thoreyjona Sep 11, 2024
b44a584
fix: revert changes on view around empty state for applications
thoreyjona Sep 11, 2024
06b2059
fix: remove unused stuff from graphql query
thoreyjona Sep 11, 2024
f43648c
fix: stop checking for state and prerequisites for incomplete applica…
thoreyjona Sep 12, 2024
de31f07
fix: address nit comments on PR
thoreyjona Sep 17, 2024
dc54c11
fix: make sure to not send new Date into new Date
thoreyjona Sep 17, 2024
e8338a1
fix: rename props in progress meter
thoreyjona Sep 17, 2024
cb5790f
feat: use createSkeletonArr helper function
thoreyjona Sep 17, 2024
d1b902d
fix: add px to margin-bottom
thoreyjona Sep 17, 2024
39fefbd
Merge branch 'main' into feat/update-applications-screen
kodiakhq[bot] Sep 17, 2024
eaff9dc
Merge branch 'main' into feat/update-applications-screen
kodiakhq[bot] Sep 18, 2024
64fc45a
fix: include not started applications in incomplete applications
thoreyjona Sep 18, 2024
32b75c1
feat: use tags and pendingAction from server if provided
thoreyjona Sep 19, 2024
3784b0d
Merge branch 'main' into feat/update-applications-screen
kodiakhq[bot] Sep 19, 2024
64b7e90
fix: send locale to applications query
thoreyjona Sep 19, 2024
c81a945
fix: only query for draft not notstarted applications until backed is…
thoreyjona Sep 19, 2024
ab8c94b
fix: 3 loader items instead of 5
thoreyjona Sep 19, 2024
2701130
Merge branch 'main' into feat/update-applications-screen
kodiakhq[bot] Sep 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,16 @@ fragment ApplicationFragment on Application {
name
progress
status
institution
actionCard {
draftTotalSteps
draftFinishedSteps
tag {
label
variant
}
pendingAction {
title
}
}
}
4 changes: 2 additions & 2 deletions apps/native/app/src/graphql/queries/applications.graphql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
query ListApplications {
applicationApplications {
query ListApplications($input: ApplicationApplicationsInput, $locale: String) {
applicationApplications(input: $input, locale: $locale) {
...ApplicationFragment
}
}
Expand Down
27 changes: 17 additions & 10 deletions apps/native/app/src/messages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -474,27 +474,34 @@ export const en: TranslatedMessages = {
// applications screen
'applications.title': 'Applications',
'applications.bottomTabText': 'Applications',
'applications.searchPlaceholder': 'Search...',
'applications.loadingText': 'Searching...',
'applications.resultText': 'results',
'applications.singleResultText': 'result',
'applications.noResultText': 'No results',
'applications.emptyListTitle': 'There are currently no links',
'applications.emptyListDescription':
'There are no links available at the moment',
'applications.emptyTitle': 'No applications',
'applications.emptyDescription':
'When you apply for services from the government, they will appear here.',
'applications.incomplete': 'Unfinished applications',
'applications.completed': 'Finished applications',
'applications.inProgress': 'Applications in progress',

// cards
'applicationStatusCard.openButtonLabel': 'Open application',
'applicationStatusCard.seeMoreApplications': 'View applications',
'applicationStatusCard.description': `{
state,
select,
inprogress {The application is being processed}
completed {Completed}
rejected {Rejected}
other {}
}`,
'applicationStatusCard.status': `{
state,
select,
inprogress {In progress}
completed {Completed}
rejected {Rejected}
draft {Application in progress}
other {Unknown status}
}`,
'applicationStatusCard.noActiveApplications': 'No active applications',
'applicationStatusCard.draftProgress':
'You have completed {draftFinishedSteps} of {draftTotalSteps} steps',

// edit phone
'edit.phone.screenTitle': 'Edit Phone',
Expand Down
32 changes: 19 additions & 13 deletions apps/native/app/src/messages/is.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,28 +473,34 @@ export const is = {
// applications screen
'applications.title': 'Umsóknir',
'applications.bottomTabText': 'Umsóknir',
'applications.searchPlaceholder': 'Leita að umsóknum...',
'applications.loadingText': 'Leita í skjölum...',
'applications.resultText': 'niðurstöður fundust',
'applications.singleResultText': 'niðurstaða fannst',
'applications.noResultText': 'Engar niðurstöður fundust',
'applications.emptyListTitle': 'Hér eru engir linkar sem stendur',
'applications.emptyListDescription':
'Að einhverjum ástæðum þá eru engir linkar að umsóknum aðgengilegir eins og er',
'applications.emptyTitle': 'Engar umsóknir',
'applications.emptyDescription':
'Þegar þú stofnar stafræna umsókn á Ísland.is birtist staða hennar hér.',
'applications.incomplete': 'Ókláraðar umsóknir',
'applications.completed': 'Afgreiddar umsóknir',
'applications.inProgress': 'Umsóknir í vinnslu',
thoreyjona marked this conversation as resolved.
Show resolved Hide resolved

// cards
'applicationStatusCard.openButtonLabel': 'Opna umsókn',
'applicationStatusCard.seeMoreApplications': 'Skoða umsóknir',
'applicationStatusCard.description': `{
state,
select,
inprogress {Umsókn er í afgreiðsluferli}
completed {Samþykkt}
rejected {Hafnað}
other {}
}`,
'applicationStatusCard.status': `{
state,
select,
inprogress {Í ferli}
completed {Lokið}
inprogress {Í vinnslu}
completed {Afgreidd}
rejected {Hafnað}
draft {Í vinnslu hjá þér}
other {Staða óþekkt}
}`,
'applicationStatusCard.noActiveApplications':
'Þegar þú stofnar stafræna umsókn á Ísland.is birtist staða hennar hér.',
'applicationStatusCard.draftProgress':
'Þú hefur klárað {draftFinishedSteps} af {draftTotalSteps} skrefum',

// edit phone
'edit.phone.screenTitle': 'Breyta símanúmeri',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import { useState } from 'react'
import { NavigationFunctionComponent } from 'react-native-navigation'

import {
ApplicationResponseDtoStatusEnum,
useListApplicationsQuery,
} from '../../graphql/types/schema'
import { createNavigationOptionHooks } from '../../hooks/create-navigation-option-hooks'
import { useConnectivityIndicator } from '../../hooks/use-connectivity-indicator'
import { ApplicationsList } from './components/applications-list'
import { usePreferencesStore } from '../../stores/preferences-store'

const { useNavigationOptions, getNavigationOptions } =
createNavigationOptionHooks(
(theme, intl) => ({
topBar: {
title: {
text: intl.formatMessage({ id: 'applications.completed' }),
},
noBorder: true,
},
}),
{
bottomTabs: {
visible: false,
drawBehind: true,
},
},
)

export const ApplicationsCompletedScreen: NavigationFunctionComponent = ({
componentId,
}) => {
useNavigationOptions(componentId)
const [refetching, setRefetching] = useState(false)
const { locale } = usePreferencesStore()

const applicationsRes = useListApplicationsQuery({
variables: {
input: {
status: [
ApplicationResponseDtoStatusEnum.Completed,
ApplicationResponseDtoStatusEnum.Rejected,
ApplicationResponseDtoStatusEnum.Approved,
],
},
locale: locale === 'is-US' ? 'is' : 'en',
},
})

useConnectivityIndicator({
componentId,
refetching,
queryResult: applicationsRes,
})

return (
<ApplicationsList
applicationsRes={applicationsRes}
displayProgress={false}
displayDescription
componentId={componentId}
onRefetch={setRefetching}
/>
)
}

ApplicationsCompletedScreen.options = getNavigationOptions
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { useState } from 'react'
import { NavigationFunctionComponent } from 'react-native-navigation'

import {
ApplicationResponseDtoStatusEnum,
useListApplicationsQuery,
} from '../../graphql/types/schema'
import { createNavigationOptionHooks } from '../../hooks/create-navigation-option-hooks'
import { useConnectivityIndicator } from '../../hooks/use-connectivity-indicator'
import { ApplicationsList } from './components/applications-list'
import { usePreferencesStore } from '../../stores/preferences-store'

const { useNavigationOptions, getNavigationOptions } =
createNavigationOptionHooks(
(theme, intl) => ({
topBar: {
title: {
text: intl.formatMessage({ id: 'applications.inProgress' }),
},
noBorder: true,
},
}),
{
bottomTabs: {
visible: false,
drawBehind: true,
},
},
)

export const ApplicationsInProgressScreen: NavigationFunctionComponent = ({
componentId,
}) => {
useNavigationOptions(componentId)
const [refetching, setRefetching] = useState(false)
const { locale } = usePreferencesStore()

const applicationsRes = useListApplicationsQuery({
variables: {
input: {
status: [ApplicationResponseDtoStatusEnum.Inprogress],
},
locale: locale === 'is-US' ? 'is' : 'en',
},
})

useConnectivityIndicator({
componentId,
refetching,
queryResult: applicationsRes,
})

return (
<ApplicationsList
applicationsRes={applicationsRes}
displayProgress={false}
displayDescription
componentId={componentId}
thoreyjona marked this conversation as resolved.
Show resolved Hide resolved
onRefetch={setRefetching}
/>
)
}

ApplicationsInProgressScreen.options = getNavigationOptions
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { useState } from 'react'
import { NavigationFunctionComponent } from 'react-native-navigation'

import {
ApplicationResponseDtoStatusEnum,
useListApplicationsQuery,
} from '../../graphql/types/schema'
import { createNavigationOptionHooks } from '../../hooks/create-navigation-option-hooks'
import { useConnectivityIndicator } from '../../hooks/use-connectivity-indicator'
import { ApplicationsList } from './components/applications-list'
import { usePreferencesStore } from '../../stores/preferences-store'

const { useNavigationOptions, getNavigationOptions } =
createNavigationOptionHooks(
(theme, intl) => ({
topBar: {
title: {
text: intl.formatMessage({ id: 'applications.incomplete' }),
},
noBorder: true,
},
}),
{
bottomTabs: {
visible: false,
drawBehind: true,
},
},
)

export const ApplicationsIncompleteScreen: NavigationFunctionComponent = ({
componentId,
}) => {
useNavigationOptions(componentId)
const [refetching, setRefetching] = useState(false)
const { locale } = usePreferencesStore()

const applicationsRes = useListApplicationsQuery({
variables: {
input: {
status: [ApplicationResponseDtoStatusEnum.Draft],
thoreyjona marked this conversation as resolved.
Show resolved Hide resolved
},
locale: locale === 'is-US' ? 'is' : 'en',
},
})

useConnectivityIndicator({
componentId,
refetching,
queryResult: applicationsRes,
})

return (
<ApplicationsList
applicationsRes={applicationsRes}
displayProgress
displayDescription={false}
thoreyjona marked this conversation as resolved.
Show resolved Hide resolved
componentId={componentId}
onRefetch={setRefetching}
/>
)
}

ApplicationsIncompleteScreen.options = getNavigationOptions
Loading