Skip to content

Commit

Permalink
Merge branch 'main' into feature/nafnskirteini-update
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Sep 9, 2024
2 parents 4690765 + 251a043 commit ad7ddda
Show file tree
Hide file tree
Showing 144 changed files with 6,658 additions and 3,192 deletions.
4 changes: 4 additions & 0 deletions apps/api/infra/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ import {
OfficialJournalOfIceland,
OfficialJournalOfIcelandApplication,
Frigg,
HealthDirectorateOrganDonation,
HealthDirectorateVaccination,
} from '../../../infra/src/dsl/xroad'

export const serviceSetup = (services: {
Expand Down Expand Up @@ -427,6 +429,8 @@ export const serviceSetup = (services: {
OfficialJournalOfIceland,
OfficialJournalOfIcelandApplication,
Frigg,
HealthDirectorateOrganDonation,
HealthDirectorateVaccination,
)
.files({ filename: 'islyklar.p12', env: 'ISLYKILL_CERT' })
.ingress({
Expand Down
2 changes: 1 addition & 1 deletion apps/judicial-system/web/src/routes/Shared/Cases/Cases.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export const Cases: FC = () => {
const casesAwaitingAssignment = filterCases(
(c) =>
isIndictmentCase(c.type) &&
c.state !== CaseState.WAITING_FOR_CANCELLATION &&
(c.state === CaseState.SUBMITTED || c.state === CaseState.RECEIVED) &&
!c.judge,
)

Expand Down
2 changes: 1 addition & 1 deletion apps/native/app/android/link-assets-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"sha1": "8bf01afac8fc3e072eb36667374393b8566a044d"
},
{
"path": "assets/fonts/IBMPlexSans-Regular.ttf",
"path": "assets/fonts/IBMPlexSans.ttf",
"sha1": "ad38f2d6870ca73533f36bdb958cd8083a49c1a8"
},
{
Expand Down
2 changes: 1 addition & 1 deletion apps/native/app/ios/IslandApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<string>Used for license scanning capabilities</string>
<key>UIAppFonts</key>
<array>
<string>IBMPlexSans-Regular.ttf</string>
<string>IBMPlexSans.ttf</string>
<string>IBMPlexSans-Italic.ttf</string>
<string>IBMPlexSans-Bold.ttf</string>
<string>IBMPlexSans-BoldItalic.ttf</string>
Expand Down
2 changes: 1 addition & 1 deletion apps/native/app/ios/link-assets-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"sha1": "8bf01afac8fc3e072eb36667374393b8566a044d"
},
{
"path": "assets/fonts/IBMPlexSans-Regular.ttf",
"path": "assets/fonts/IBMPlexSans.ttf",
"sha1": "ad38f2d6870ca73533f36bdb958cd8083a49c1a8"
},
{
Expand Down
3 changes: 3 additions & 0 deletions apps/native/app/src/graphql/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ const cache = new InMemoryCache({
userNotifications: {
merge: true,
},
getUserProfile: {
merge: true,
},
},
},
DocumentV2: {
Expand Down
6 changes: 6 additions & 0 deletions apps/native/app/src/screens/home/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { ApplicationsModule } from './applications-module'
import { HelloModule } from './hello-module'
import { InboxModule } from './inbox-module'
import { OnboardingModule } from './onboarding-module'
import { usePreferencesStore } from '../../stores/preferences-store'

interface ListItem {
id: string
Expand Down Expand Up @@ -99,6 +100,9 @@ export const MainHomeScreen: NavigationFunctionComponent = ({
useAndroidNotificationPermission()
const syncToken = useNotificationsStore(({ syncToken }) => syncToken)
const checkUnseen = useNotificationsStore(({ checkUnseen }) => checkUnseen)
const getAndSetLocale = usePreferencesStore(
({ getAndSetLocale }) => getAndSetLocale,
)
const [refetching, setRefetching] = useState(false)
const flatListRef = useRef<FlatList>(null)
const ui = useUiStore()
Expand Down Expand Up @@ -126,6 +130,8 @@ export const MainHomeScreen: NavigationFunctionComponent = ({
// Sync push tokens and unseen notifications
syncToken()
checkUnseen()
// Get user locale from server
getAndSetLocale()

// Handle initial notification
handleInitialNotification()
Expand Down
31 changes: 28 additions & 3 deletions apps/native/app/src/screens/settings/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
Image,
Linking,
Platform,
Pressable,
ScrollView,
Switch,
TouchableOpacity,
Expand Down Expand Up @@ -151,6 +150,8 @@ export const SettingsScreen: NavigationFunctionComponent = ({
}).then(({ selectedItem }: any) => {
if (selectedItem) {
setLocale(selectedItem.id)
const locale = selectedItem.id === 'is-IS' ? 'is' : 'en'
updateLocale(locale)
}
})
}
Expand All @@ -166,7 +167,7 @@ export const SettingsScreen: NavigationFunctionComponent = ({
}, 330)
}, [])

function updateDocumentNotifications(value: boolean) {
const updateDocumentNotifications = (value: boolean) => {
client
.mutate<UpdateProfileMutation, UpdateProfileMutationVariables>({
mutation: UpdateProfileDocument,
Expand Down Expand Up @@ -198,7 +199,7 @@ export const SettingsScreen: NavigationFunctionComponent = ({
})
}

function updateEmailNotifications(value: boolean) {
const updateEmailNotifications = (value: boolean) => {
client
.mutate<UpdateProfileMutation, UpdateProfileMutationVariables>({
mutation: UpdateProfileDocument,
Expand Down Expand Up @@ -230,6 +231,30 @@ export const SettingsScreen: NavigationFunctionComponent = ({
})
}

const updateLocale = (value: string) => {
client
.mutate<UpdateProfileMutation, UpdateProfileMutationVariables>({
mutation: UpdateProfileDocument,
update(cache, { data }) {
cache.modify({
fields: {
getUserProfile: (existing) => {
return { ...existing, ...data?.updateProfile }
},
},
})
},
variables: {
input: {
locale: value,
},
},
})
.catch(() => {
// noop
})
}

useEffect(() => {
if (userProfile) {
setDocumentNotifications(
Expand Down
25 changes: 25 additions & 0 deletions apps/native/app/src/stores/preferences-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import { persist } from 'zustand/middleware'
import create, { State } from 'zustand/vanilla'
import { getDefaultOptions } from '../utils/get-default-options'
import { getThemeWithPreferences } from '../utils/get-theme-with-preferences'
import { getApolloClientAsync } from '../graphql/client'
import {
GetProfileDocument,
GetProfileQuery,
GetProfileQueryVariables,
} from '../graphql/types/schema'

export type Locale = 'en-US' | 'is-IS' | 'en-IS' | 'is-US'
export type ThemeMode = 'dark' | 'light' | 'efficient'
Expand All @@ -29,6 +35,7 @@ export interface PreferencesStore extends State {
appearanceMode: AppearanceMode
appLockTimeout: number
setLocale(locale: Locale): void
getAndSetLocale(): void
setAppearanceMode(appearanceMode: AppearanceMode): void
setUseBiometrics(useBiometrics: boolean): void
dismiss(key: string, value?: boolean): void
Expand Down Expand Up @@ -61,6 +68,24 @@ export const preferencesStore = create<PreferencesStore>(
persist(
(set, get) => ({
...(defaultPreferences as PreferencesStore),
async getAndSetLocale() {
const client = await getApolloClientAsync()

try {
const res = await client.query<
GetProfileQuery,
GetProfileQueryVariables
>({
query: GetProfileDocument,
})

const locale = res.data?.getUserProfile?.locale
const appLocale = locale === 'en' ? 'en-US' : 'is-IS'
set({ locale: appLocale })
} catch (err) {
// noop
}
},
setLocale(locale: Locale) {
if (!availableLocales.includes(locale)) {
throw new Error('Not supported locale')
Expand Down
1 change: 0 additions & 1 deletion apps/native/app/src/ui/lib/list/list-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ export function ListItem({
variant="body3"
numberOfLines={1}
ellipsizeMode="tail"
style={{ fontWeight: '300' }}
>
{title}
</Typography>
Expand Down
7 changes: 6 additions & 1 deletion apps/services/auth/delegation-api/infra/delegation-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,10 @@ export const serviceSetup = (services: {
public: false,
},
})
.grantNamespaces('nginx-ingress-internal', 'islandis', 'service-portal')
.grantNamespaces(
'nginx-ingress-internal',
'islandis',
'service-portal',
'user-notification-worker',
)
}
11 changes: 7 additions & 4 deletions apps/web/screens/Search/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,13 @@ const Search: Screen<CategoryProps> = ({
active={!query?.type?.length}
onClick={() => {
dispatch({
type: ActionType.RESET_SEARCH,
type: ActionType.SET_PARAMS,
payload: {
query: {
type: [],
processentry: false,
},
},
})
}}
>
Expand All @@ -628,8 +634,6 @@ const Search: Screen<CategoryProps> = ({
query: {
processentry: false,
...getSearchParams(key),
category: [],
organization: [],
},
searchLocked: false,
},
Expand Down Expand Up @@ -676,7 +680,6 @@ const Search: Screen<CategoryProps> = ({
type: ActionType.SET_PARAMS,
payload: {
query: {
...getSearchParams('webArticle'),
...payload,
},
},
Expand Down
1 change: 1 addition & 0 deletions charts/identity-server/values.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ services-auth-delegation-api:
- 'nginx-ingress-internal'
- 'islandis'
- 'service-portal'
- 'user-notification-worker'
grantNamespacesEnabled: true
healthCheck:
liveness:
Expand Down
1 change: 1 addition & 0 deletions charts/identity-server/values.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ services-auth-delegation-api:
- 'nginx-ingress-internal'
- 'islandis'
- 'service-portal'
- 'user-notification-worker'
grantNamespacesEnabled: true
healthCheck:
liveness:
Expand Down
1 change: 1 addition & 0 deletions charts/identity-server/values.staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ services-auth-delegation-api:
- 'nginx-ingress-internal'
- 'islandis'
- 'service-portal'
- 'user-notification-worker'
grantNamespacesEnabled: true
healthCheck:
liveness:
Expand Down
2 changes: 2 additions & 0 deletions charts/islandis/values.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,9 @@ api:
XROAD_FINANCES_V2_PATH: 'IS-DEV/GOV/10021/FJS-Public/financeServicesFJS_v2'
XROAD_FINANCIAL_AID_BACKEND_PATH: 'IS-DEV/MUN/10023/samband-sveitarfelaga/financial-aid-backend'
XROAD_FIREARM_LICENSE_PATH: 'IS-DEV/GOV/10005/Logreglan-Protected/island-api-v1'
XROAD_HEALTH_DIRECTORATE_ORGAN_DONATION_PATH: 'IS-DEV/GOV/10015/EmbaettiLandlaeknis-Protected/organ-donation-v1'
XROAD_HEALTH_DIRECTORATE_PATH: 'IS-DEV/GOV/10015/EmbaettiLandlaeknis-Protected/landlaeknir'
XROAD_HEALTH_DIRECTORATE_VACCINATION_PATH: 'IS-DEV/GOV/10015/EmbaettiLandlaeknis-Protected/vaccination-v1'
XROAD_HEALTH_INSURANCE_ID: 'IS-DEV/GOV/10007/SJUKRA-Protected'
XROAD_HEALTH_INSURANCE_MY_PAGES_PATH: 'IS-DEV/GOV/10007/SJUKRA-Protected/minarsidur'
XROAD_HEALTH_INSURANCE_WSDLURL: 'https://test-huld.sjukra.is/islandrg?wsdl'
Expand Down
2 changes: 2 additions & 0 deletions charts/islandis/values.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,9 @@ api:
XROAD_FINANCES_V2_PATH: 'IS/GOV/5402697509/FJS-Public/financeServicesFJS_v2'
XROAD_FINANCIAL_AID_BACKEND_PATH: 'IS/MUN/5502694739/samband-sveitarfelaga/financial-aid-backend'
XROAD_FIREARM_LICENSE_PATH: 'IS/GOV/5309672079/Logreglan-Protected/island-api-v1'
XROAD_HEALTH_DIRECTORATE_ORGAN_DONATION_PATH: 'IS/GOV/7101695009/EmbaettiLandlaeknis-Protected/organ-donation-v1'
XROAD_HEALTH_DIRECTORATE_PATH: 'IS/GOV/7101695009/EmbaettiLandlaeknis-Protected/landlaeknir'
XROAD_HEALTH_DIRECTORATE_VACCINATION_PATH: 'IS/GOV/7101695009/EmbaettiLandlaeknis-Protected/vaccination-v1'
XROAD_HEALTH_INSURANCE_ID: 'IS/GOV/4804080550/SJUKRA-Protected'
XROAD_HEALTH_INSURANCE_MY_PAGES_PATH: 'IS/GOV/4804080550/SJUKRA-Protected/minarsidur'
XROAD_HEALTH_INSURANCE_WSDLURL: 'https://huld.sjukra.is/islandrg?wsdl'
Expand Down
2 changes: 2 additions & 0 deletions charts/islandis/values.staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,9 @@ api:
XROAD_FINANCES_V2_PATH: 'IS-TEST/GOV/10021/FJS-Public/financeServicesFJS_v2'
XROAD_FINANCIAL_AID_BACKEND_PATH: 'IS-TEST/MUN/5502694739/samband-sveitarfelaga/financial-aid-backend'
XROAD_FIREARM_LICENSE_PATH: 'IS/GOV/5309672079/Logreglan-Protected/island-api-v1'
XROAD_HEALTH_DIRECTORATE_ORGAN_DONATION_PATH: 'IS-TEST/GOV/10015/EmbaettiLandlaeknis-Protected/organ-donation-v1'
XROAD_HEALTH_DIRECTORATE_PATH: 'IS-TEST/GOV/10015/EmbaettiLandlaeknis-Protected/landlaeknir'
XROAD_HEALTH_DIRECTORATE_VACCINATION_PATH: 'IS-TEST/GOV/10015/EmbaettiLandlaeknis-Protected/vaccination-v1'
XROAD_HEALTH_INSURANCE_ID: 'IS-TEST/GOV/4804080550/SJUKRA-Protected'
XROAD_HEALTH_INSURANCE_MY_PAGES_PATH: 'IS-TEST/GOV/4804080550/SJUKRA-Protected/minarsidur'
XROAD_HEALTH_INSURANCE_WSDLURL: 'https://test-huld.sjukra.is/islandrg?wsdl'
Expand Down
21 changes: 21 additions & 0 deletions infra/src/dsl/xroad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -890,3 +890,24 @@ export const Frigg = new XroadConf({
},
},
})

export const HealthDirectorateOrganDonation = new XroadConf({
env: {
XROAD_HEALTH_DIRECTORATE_ORGAN_DONATION_PATH: {
dev: 'IS-DEV/GOV/10015/EmbaettiLandlaeknis-Protected/organ-donation-v1',
staging:
'IS-TEST/GOV/10015/EmbaettiLandlaeknis-Protected/organ-donation-v1',
prod: 'IS/GOV/7101695009/EmbaettiLandlaeknis-Protected/organ-donation-v1',
},
},
})

export const HealthDirectorateVaccination = new XroadConf({
env: {
XROAD_HEALTH_DIRECTORATE_VACCINATION_PATH: {
dev: 'IS-DEV/GOV/10015/EmbaettiLandlaeknis-Protected/vaccination-v1',
staging: 'IS-TEST/GOV/10015/EmbaettiLandlaeknis-Protected/vaccination-v1',
prod: 'IS/GOV/7101695009/EmbaettiLandlaeknis-Protected/vaccination-v1',
},
},
})
Loading

0 comments on commit ad7ddda

Please sign in to comment.