Skip to content

Commit

Permalink
Merge branch 'main' into feat/parental-leave-periods-applicationRights
Browse files Browse the repository at this point in the history
  • Loading branch information
helgifr authored Sep 24, 2024
2 parents 0e5b654 + 2bd9353 commit 87138b8
Show file tree
Hide file tree
Showing 140 changed files with 3,492 additions and 427 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,16 @@ beforeAll(async () => {
describe('Application system payments callback API', () => {
// Sets the payment status to paid.
it(`POST /application-payment/32eee126-6b7f-4fca-b9a0-a3618b3e42bf/6b11dc9f-a694-440e-b3dd-7163b5f34815 should update payment fulfilled`, async () => {
await server
const response = await server
.post(
'/application-payment/32eee126-6b7f-4fca-b9a0-a3618b3e42bf/6b11dc9f-a694-440e-b3dd-7163b5f34815',
)
.send({
callback: {
receptionID: '1234567890',
chargeItemSubject: 'Very nice subject',
status: 'paid',
},
receptionID: '123e4567-e89b-12d3-a456-426614174000', // Updated to real UUID
chargeItemSubject: 'Very nice subject',
status: 'paid',
})
.expect(201)
expect(response.status).toBe(201)
})

// Fails to set the payment status to paid.
Expand All @@ -37,11 +35,9 @@ describe('Application system payments callback API', () => {
'/application-payment/32eee126-6b7f-4fca-b9a0-a3618b3e42bf/missing-id',
)
.send({
callback: {
receptionID: '1234567890',
chargeItemSubject: 'nice subject.. not',
status: 'paid',
},
receptionID: '123e4567-e89b-12d3-a456-426614174000', // Updated to real UUID
chargeItemSubject: 'nice subject.. not',
status: 'paid',
})
.expect(400)
})
Expand Down
1 change: 1 addition & 0 deletions apps/application-system/api/src/openApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ export const openApi = new DocumentBuilder()
.setVersion('1.0')
.addTag('application')
.addTag('payment')
.addTag('payment-callback')
.addBearerAuth()
.build()
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,18 @@ export class AwsS3Service {
caseType: CaseType,
key?: string,
timeToLive?: number,
useFreshSession = false,
): Promise<string> {
if (!key) {
throw new Error('Key is required')
}

return new Promise((resolve, reject) => {
this.s3.getSignedUrl(
const s3 = useFreshSession
? new S3({ region: this.config.region })
: this.s3

s3.getSignedUrl(
'getObject',
{
Bucket: this.config.bucket,
Expand All @@ -155,6 +160,7 @@ export class AwsS3Service {
force: boolean,
confirmContent: (content: Buffer) => Promise<string | undefined>,
timeToLive?: number,
useFreshSession = false,
): Promise<string> {
if (!key) {
throw new Error('Key is required')
Expand All @@ -167,19 +173,24 @@ export class AwsS3Service {
const confirmedKey = formatConfirmedIndictmentCaseKey(key)

if (!force && (await this.objectExists(caseType, confirmedKey))) {
return this.getSignedUrl(caseType, confirmedKey, timeToLive)
return this.getSignedUrl(
caseType,
confirmedKey,
timeToLive,
useFreshSession,
)
}

const confirmedContent = await this.getObject(caseType, key).then(
(content) => confirmContent(content),
)

if (!confirmedContent) {
return this.getSignedUrl(caseType, key, timeToLive)
return this.getSignedUrl(caseType, key, timeToLive, useFreshSession)
}

return this.putObject(caseType, confirmedKey, confirmedContent).then(() =>
this.getSignedUrl(caseType, confirmedKey, timeToLive),
this.getSignedUrl(caseType, confirmedKey, timeToLive, useFreshSession),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ export class FileService {
theCase: Case,
file: CaseFile,
timeToLive?: number,
useFreshSession = false,
): Promise<string> {
if (this.shouldGetConfirmedDocument(file, theCase)) {
return this.awsS3Service.getConfirmedIndictmentCaseSignedUrl(
Expand All @@ -414,10 +415,16 @@ export class FileService {
(content: Buffer) =>
this.confirmIndictmentCaseFile(theCase, file, content),
timeToLive,
useFreshSession,
)
}

return this.awsS3Service.getSignedUrl(theCase.type, file.key, timeToLive)
return this.awsS3Service.getSignedUrl(
theCase.type,
file.key,
timeToLive,
useFreshSession,
)
}

async getCaseFileSignedUrl(
Expand Down Expand Up @@ -559,6 +566,7 @@ export class FileService {
theCase,
file,
this.config.robotS3TimeToLiveGet,
true,
)

return this.courtService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ describe('FileController - Get case file signed url', () => {
theCase.type,
key,
undefined,
false,
)
expect(then.result).toEqual({ url })
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ describe('InternalFileController - Deliver case file to court of appeals', () =>
theCase.type,
key,
mockFileConfig.robotS3TimeToLiveGet,
true,
)
expect(mockCourtService.updateAppealCaseWithFile).toHaveBeenCalledWith(
user,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ describe('LimitedAccessFileController - Get case file signed url', () => {
theCase.type,
key,
undefined,
false,
)
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ export const HearingArrangements = () => {
[formatMessage, router, setWorkingCase, transitionCase, workingCase],
)

const stepIsValid =
isHearingArrangementsStepValidRC(workingCase) || isTransitioningCase
const stepIsValid = isHearingArrangementsStepValidRC(workingCase)

return (
<PageLayout
Expand Down
2 changes: 1 addition & 1 deletion apps/native/app/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode getMyVersionCode(143)
versionName "1.4.2"
versionName "1.4.3"
manifestPlaceholders = [
appAuthRedirectScheme: "is.island.app" // project.config.get("BUNDLE_ID_ANDROID")
]
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 @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.4.2</string>
<string>1.4.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand Down
4 changes: 3 additions & 1 deletion apps/native/app/src/screens/applications/applications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ export const ApplicationsScreen: NavigationFunctionComponent = ({
const [hiddenContent, setHiddenContent] = useState(isIos)
const { locale } = usePreferencesStore()

const queryLocale = locale === 'is-IS' ? 'is' : 'en'

const applicationsRes = useListApplicationsQuery({
variables: { locale: locale === 'is-US' ? 'is' : 'en' },
variables: { locale: queryLocale },
})

const applications = useMemo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const ApplicationsPreview = ({
},
)}
progressContainerWidth={
slider ? screenWidth - theme.spacing[2] * 6 : undefined
slider && count > 1 ? screenWidth - theme.spacing[2] * 6 : undefined
}
description={
type !== 'incomplete'
Expand Down
39 changes: 24 additions & 15 deletions apps/native/app/src/screens/home/applications-module.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { EmptyCard, StatusCardSkeleton } from '@ui'
import React from 'react'
import { useIntl } from 'react-intl'
import { Image, SafeAreaView } from 'react-native'
import styled from 'styled-components'
import { Image, SafeAreaView, View } from 'react-native'
import { ApolloError } from '@apollo/client'

import leJobss3 from '../../assets/illustrations/le-jobs-s3.png'
Expand All @@ -20,6 +21,10 @@ interface ApplicationsModuleProps {
componentId: string
}

const Wrapper = styled(View)`
margin-horizontal: ${({ theme }) => theme.spacing[2]}px;
`

const validateApplicationsInitialData = ({
data,
loading,
Expand Down Expand Up @@ -50,23 +55,27 @@ const ApplicationsModule = React.memo(
return (
<SafeAreaView>
{loading && !data ? (
<StatusCardSkeleton />
<Wrapper>
<StatusCardSkeleton />
</Wrapper>
) : (
<>
{count === 0 && (
<EmptyCard
text={intl.formatMessage({
id: 'applications.emptyDescription',
})}
image={
<Image
source={leJobss3}
resizeMode="contain"
style={{ height: 87, width: 69 }}
/>
}
link={null}
/>
<Wrapper>
<EmptyCard
text={intl.formatMessage({
id: 'applications.emptyDescription',
})}
image={
<Image
source={leJobss3}
resizeMode="contain"
style={{ height: 87, width: 69 }}
/>
}
link={null}
/>
</Wrapper>
)}
{count !== 0 && (
<ApplicationsPreview
Expand Down
6 changes: 4 additions & 2 deletions apps/native/app/src/ui/lib/card/status-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ export function StatusCard({
const icon = getOrganizationLogoUrl(institution ?? '')
const theme = useTheme()

const hideProgress = !progress && !progressTotalSteps

return (
<Host style={style}>
<Row>
Expand Down Expand Up @@ -128,9 +130,9 @@ export function StatusCard({
</Typography>
</Title>
{!!description && <Typography>{description}</Typography>}
{!!progress && (
{!hideProgress && (
<ProgressMeter
finishedSteps={progress}
finishedSteps={progress ?? 0}
totalSteps={progressTotalSteps ?? 0}
progressMessage={progressMessage}
containerWidth={progressContainerWidth}
Expand Down
254 changes: 254 additions & 0 deletions apps/portals/admin/src/assets/images/skjaldarmerki.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions apps/services/auth/admin-api/infra/auth-admin-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ export const serviceSetup = (): ServiceBuilder<'services-auth-admin-api'> => {
prod: 'IS/GOV/5402696029/Skatturinn/ft-v1',
},
COMPANY_REGISTRY_REDIS_NODES: REDIS_NODE_CONFIG,
SYSLUMENN_HOST: {
dev: 'https://api.syslumenn.is/staging',
staging: 'https://api.syslumenn.is/staging',
prod: 'https://api.syslumenn.is',
},
SYSLUMENN_TIMEOUT: '3000',
})
.secrets({
CLIENT_SECRET_ENCRYPTION_KEY:
Expand All @@ -67,6 +73,8 @@ export const serviceSetup = (): ServiceBuilder<'services-auth-admin-api'> => {
'/k8s/services-auth/IDENTITY_SERVER_CLIENT_SECRET',
NATIONAL_REGISTRY_IDS_CLIENT_SECRET:
'/k8s/xroad/client/NATIONAL-REGISTRY/IDENTITYSERVER_SECRET',
SYSLUMENN_USERNAME: '/k8s/services-auth/SYSLUMENN_USERNAME',
SYSLUMENN_PASSWORD: '/k8s/services-auth/SYSLUMENN_PASSWORD',
})
.xroad(Base, Client, RskProcuring)
.ingress({
Expand Down
18 changes: 10 additions & 8 deletions apps/services/auth/admin-api/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ import {
SequelizeConfigService,
} from '@island.is/auth-api-lib'
import { AuthModule } from '@island.is/auth-nest-tools'
import { RskRelationshipsClientConfig } from '@island.is/clients-rsk-relationships'
import { NationalRegistryClientConfig } from '@island.is/clients/national-registry-v2'
import { CompanyRegistryConfig } from '@island.is/clients/rsk/company-registry'
import { SyslumennClientConfig } from '@island.is/clients/syslumenn'
import { AuditModule } from '@island.is/nest/audit'
import { IdsClientConfig, XRoadConfig } from '@island.is/nest/config'
import { FeatureFlagConfig } from '@island.is/nest/feature-flags'
import { ProblemModule } from '@island.is/nest/problem'

import { environment } from '../environments'
Expand All @@ -21,16 +27,11 @@ import { ResourcesModule } from './modules/resources/resources.module'
import { TranslationModule } from './modules/translation/translation.module'
import { UsersModule } from './modules/users/users.module'
import { ClientsModule as ClientsV2Module } from './v2/clients/clients.module'
import { DelegationAdminModule } from './v2/delegations/delegation-admin.module'
import { ProvidersModule } from './v2/providers/providers.module'
import { ScopesModule } from './v2/scopes/scopes.module'
import { ClientSecretsModule } from './v2/secrets/client-secrets.module'
import { TenantsModule } from './v2/tenants/tenants.module'
import { ScopesModule } from './v2/scopes/scopes.module'
import { ProvidersModule } from './v2/providers/providers.module'
import { DelegationAdminModule } from './v2/delegations/delegation-admin.module'
import { RskRelationshipsClientConfig } from '@island.is/clients-rsk-relationships'
import { FeatureFlagConfig } from '@island.is/nest/feature-flags'
import { IdsClientConfig, XRoadConfig } from '@island.is/nest/config'
import { NationalRegistryClientConfig } from '@island.is/clients/national-registry-v2'
import { CompanyRegistryConfig } from '@island.is/clients/rsk/company-registry'

@Module({
imports: [
Expand Down Expand Up @@ -64,6 +65,7 @@ import { CompanyRegistryConfig } from '@island.is/clients/rsk/company-registry'
FeatureFlagConfig,
XRoadConfig,
IdsClientConfig,
SyslumennClientConfig,
],
envFilePath: ['.env', '.env.secret'],
}),
Expand Down
10 changes: 9 additions & 1 deletion apps/services/auth/delegation-api/infra/delegation-api.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
json,
ref,
service,
ServiceBuilder,
ref,
} from '../../../../../infra/src/dsl/dsl'
import { Base, Client, RskProcuring } from '../../../../../infra/src/dsl/xroad'

Expand Down Expand Up @@ -54,12 +54,20 @@ export const serviceSetup = (services: {
prod: 'IS/GOV/5402696029/Skatturinn/ft-v1',
},
COMPANY_REGISTRY_REDIS_NODES: REDIS_NODE_CONFIG,
SYSLUMENN_HOST: {
dev: 'https://api.syslumenn.is/staging',
staging: 'https://api.syslumenn.is/staging',
prod: 'https://api.syslumenn.is',
},
SYSLUMENN_TIMEOUT: '3000',
})
.secrets({
IDENTITY_SERVER_CLIENT_SECRET:
'/k8s/services-auth/IDENTITY_SERVER_CLIENT_SECRET',
NATIONAL_REGISTRY_IDS_CLIENT_SECRET:
'/k8s/xroad/client/NATIONAL-REGISTRY/IDENTITYSERVER_SECRET',
SYSLUMENN_USERNAME: '/k8s/services-auth/SYSLUMENN_USERNAME',
SYSLUMENN_PASSWORD: '/k8s/services-auth/SYSLUMENN_PASSWORD',
})
.xroad(Base, Client, RskProcuring)
.readiness('/health/check')
Expand Down
Loading

0 comments on commit 87138b8

Please sign in to comment.