Skip to content

Commit

Permalink
Merge branch 'main' into chore/update-pdf-package
Browse files Browse the repository at this point in the history
  • Loading branch information
disaerna authored Sep 4, 2024
2 parents 7cb657b + 7fd1639 commit 413de25
Show file tree
Hide file tree
Showing 916 changed files with 27,409 additions and 11,130 deletions.
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

/* @island-is/core
/libs/api/domains/identity/ @island-is/core
# Edge case escaping the /infra/ and **/infra/ devops patterns below
/libs/infra-nest-server/src/lib/infra/ @island-is/core
/libs/testing/ @island-is/core
/libs/nest/swagger/ @island-is/core

Expand Down Expand Up @@ -166,6 +168,7 @@ codemagic.yaml
/libs/clients/firearm-license/ @island-is/hugsmidjan
/libs/clients/hunting-license/ @island-is/hugsmidjan
/libs/clients/smartsolutions/ @island-is/hugsmidjan
/libs/clients/smart-solutions-v2/ @island-is/hugsmidjan
/libs/clients/license-client/ @island-is/hugsmidjan @island-is/aranja
/libs/clients/intellectual-properties/ @island-is/hugsmidjan
/libs/clients/islykill/ @island-is/hugsmidjan
Expand All @@ -190,6 +193,7 @@ codemagic.yaml
/libs/portals/admin/document-provider/ @island-is/hugsmidjan @island-is/core
/libs/clients/icelandic-health-insurance/rights-portal/ @island-is/hugsmidjan
/libs/clients/health-directorate @island-is/hugsmidjan @island-is/origo
/libs/clients/mms/grade @island-is/hugsmidjan
/libs/portals/admin/air-discount-scheme @island-is/hugsmidjan
/libs/application/templates/official-journal-of-iceland/ @island-is/hugsmidjan
/libs/application/template-api-modules/src/lib/modules/templates/official-journal-of-iceland/ @island-is/hugsmidjan
Expand Down
2 changes: 1 addition & 1 deletion apps/air-discount-scheme/backend/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ services:

redis-cluster:
container_name: ads_redis_cluster
image: docker.io/grokzen/redis-cluster:7.0.0
image: docker.io/grokzen/redis-cluster:6.0.16
privileged: true
environment:
- IP=0.0.0.0
Expand Down
2 changes: 1 addition & 1 deletion apps/api/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3.3'
services:
redis_cluster:
container_name: api_redis_cluster
image: docker.io/grokzen/redis-cluster:7.0.0
image: docker.io/grokzen/redis-cluster:6.0.16
networks:
- local
privileged: true
Expand Down
4 changes: 4 additions & 0 deletions apps/api/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { DocumentModule } from '@island.is/api/domains/documents'
import { DrivingLicenseModule } from '@island.is/api/domains/driving-license'
import { DrivingLicenseBookModule } from '@island.is/api/domains/driving-license-book'
import { EducationModule } from '@island.is/api/domains/education'
import { EducationV2Module } from '@island.is/api/domains/education'
import { SocialInsuranceModule } from '@island.is/api/domains/social-insurance'
import { ElectronicRegistrationsModule } from '@island.is/api/domains/electronic-registration-statistics'
import {
Expand Down Expand Up @@ -192,6 +193,7 @@ import { CriminalRecordClientConfig } from '@island.is/clients/criminal-record'
import { HealthInsuranceV2ClientConfig } from '@island.is/clients/icelandic-health-insurance/health-insurance'
import { VmstClientConfig } from '@island.is/clients/vmst'
import { FriggClientConfig } from '@island.is/clients/mms/frigg'
import { GradeClientConfig } from '@island.is/clients/mms/grade'
import { UmbodsmadurSkuldaraModule } from '@island.is/api/domains/umbodsmadur-skuldara'
import { UmbodsmadurSkuldaraClientConfig } from '@island.is/clients/ums-cost-of-living-calculator'
import { emailModuleConfig } from '@island.is/email-service'
Expand Down Expand Up @@ -230,6 +232,7 @@ const environment = getConfig
},
fileDownloadBucket: environment.education.fileDownloadBucket!,
}),
EducationV2Module,
ApplicationModule.register({
baseApiUrl: environment.applicationSystem.baseApiUrl!,
}),
Expand Down Expand Up @@ -417,6 +420,7 @@ const environment = getConfig
UserProfileClientConfig,
UltravioletRadiationClientConfig,
FriggClientConfig,
GradeClientConfig,
VmstClientConfig,
HealthInsuranceV2ClientConfig,
CriminalRecordClientConfig,
Expand Down
2 changes: 1 addition & 1 deletion apps/application-system/api/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ services:

redis_cluster:
container_name: redis_cluster
image: docker.io/grokzen/redis-cluster:7.0.0
image: docker.io/grokzen/redis-cluster:6.0.16
networks:
- local
privileged: true
Expand Down
6 changes: 3 additions & 3 deletions apps/application-system/api/infra/application-system-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const workerSetup =
},
XROAD_CHARGE_FJS_V2_PATH: {
dev: 'IS-DEV/GOV/10021/FJS-Public/chargeFJS_v2',
staging: 'IS-DEV/GOV/10021/FJS-Public/chargeFJS_v2',
staging: 'IS-TEST/GOV/10021/FJS-Public/chargeFJS_v2',
prod: 'IS/GOV/5402697509/FJS-Public/chargeFJS_v2',
},
APPLICATION_ATTACHMENT_BUCKET: {
Expand Down Expand Up @@ -221,12 +221,12 @@ export const serviceSetup = (services: {
),
XROAD_COURT_BANKRUPTCY_CERT_PATH: {
dev: 'IS-DEV/GOV/10019/Domstolasyslan/JusticePortal-v1',
staging: 'IS-DEV/GOV/10019/Domstolasyslan/JusticePortal-v1',
staging: 'IS-TEST/GOV/10019/Domstolasyslan/JusticePortal-v1',
prod: 'IS/GOV/4707171140/Domstolasyslan/JusticePortal-v1',
},
XROAD_ALTHINGI_OMBUDSMAN_SERVICE_PATH: {
dev: 'IS-DEV/GOV/10047/UA-Protected/kvortun-v1/',
staging: 'IS-DEV/GOV/10047/UA-Protected/kvortun-v1/',
staging: 'IS-TEST/GOV/10047/UA-Protected/kvortun-v1/',
prod: 'IS/GOV/5605882089/UA-Protected/kvortun-v1',
},
NOVA_ACCEPT_UNAUTHORIZED: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
UseGuards,
Inject,
} from '@nestjs/common'
import { ApiTags, ApiHeader } from '@nestjs/swagger'
import { ApiTags, ApiHeader, ApiBearerAuth } from '@nestjs/swagger'

import { IdsUserGuard, ScopesGuard, Scopes } from '@island.is/auth-nest-tools'
import { AdminPortalScope } from '@island.is/auth/scopes'
Expand All @@ -31,10 +31,7 @@ import {

@UseGuards(IdsUserGuard, ScopesGuard, DelegationGuard)
@ApiTags('applications')
@ApiHeader({
name: 'authorization',
description: 'Bearer token authorization',
})
@ApiBearerAuth()
@ApiHeader({
name: 'locale',
description: 'Front-end language selected',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
ApiTags,
ApiHeader,
ApiQuery,
ApiBearerAuth,
} from '@nestjs/swagger'
import {
ApplicationTemplateHelper,
Expand Down Expand Up @@ -102,14 +103,11 @@ import { ApplicationActionService } from './application-action.service'

@UseGuards(IdsUserGuard, ScopesGuard, DelegationGuard)
@ApiTags('applications')
@ApiHeader({
name: 'authorization',
description: 'Bearer token authorization',
})
@ApiHeader({
name: 'locale',
description: 'Front-end language selected',
})
@ApiBearerAuth()
@Controller()
export class ApplicationController {
constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,14 @@ import { PaymentModule } from '@island.is/application/api/payment'
import { HistoryModule } from '@island.is/application/api/history'
import { AuthPublicApiClientModule } from '@island.is/clients/auth/public-api'
import { ApplicationActionService } from './application-action.service'
import { TemplateAPIConfig } from '@island.is/application/template-api-modules'

@Module({
imports: [
PaymentModule,
AuditModule.forRoot(environment.audit),
AuthModule.register(environment.auth),
TemplateAPIModule.register({
// TODO: Update typing to accomodate incomplete module setup
// Some modules don't need to configure everything, yet the type requires it.
...(environment.templateApi as TemplateAPIConfig),
...environment.templateApi,
applicationService: TemplateApiApplicationService,
}),
ApplicationApiCoreModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ class PendingAction {
@Expose()
@IsString()
content?: string

@ApiPropertyOptional()
@Expose()
@IsString()
button?: string
}

class History {
Expand Down Expand Up @@ -96,6 +101,11 @@ class ActionCardMetaData {
@Expose()
@IsNumber()
draftTotalSteps?: number

@ApiPropertyOptional()
@Expose()
@IsString()
historyButton?: string
}

export class BaseApplicationResponseDto {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ export class ApplicationSerializer
history,
draftFinishedSteps: application.draftFinishedSteps,
draftTotalSteps: application.draftTotalSteps,
historyButton: actionCardMeta.historyButton
? intl.formatMessage(actionCardMeta.historyButton)
: null,
},
name: getApplicationNameTranslationString(
template,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ import type { AuthConfig } from '@island.is/auth-nest-tools'
import { TemplateAPIConfig } from '@island.is/application/template-api-modules'
import { AuditOptions } from '@island.is/nest/audit'

export interface Environment<
TemplateAPISubset extends keyof TemplateAPIConfig = keyof TemplateAPIConfig,
> {
export interface Environment {
production: boolean
environment: string
name: string
baseApiUrl: string
audit: AuditOptions
auth: AuthConfig
templateApi: Pick<TemplateAPIConfig, TemplateAPISubset>
templateApi: TemplateAPIConfig
contentful: {
accessToken: string
}
Expand Down
69 changes: 28 additions & 41 deletions apps/application-system/api/src/environments/environment.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
import { Environment } from './environment.interface'

type EnvironmentKeys =
| 'attachmentBucket'
| 'baseApiUrl'
| 'clientLocationOrigin'
| 'email'
| 'generalPetition'
| 'islykill'
| 'jwtSecret'
| 'presignBucket'
| 'userProfile'
| 'xRoadBasePathWithEnv'

const devConfig: Environment<EnvironmentKeys> = {
const devConfig = {
production: false,
environment: 'local',
name: 'local',
Expand All @@ -36,69 +24,68 @@ const devConfig: Environment<EnvironmentKeys> = {
jwtSecret: 'supersecret',
xRoadBasePathWithEnv: process.env.XROAD_BASE_PATH_WITH_ENV ?? '',
baseApiUrl: 'http://localhost:4444',
presignBucket: process.env.FILE_SERVICE_PRESIGN_BUCKET ?? '',
attachmentBucket: process.env.APPLICATION_ATTACHMENT_BUCKET ?? '',
presignBucket: process.env.FILE_SERVICE_PRESIGN_BUCKET,
attachmentBucket: process.env.APPLICATION_ATTACHMENT_BUCKET,
generalPetition: {
endorsementsApiBasePath: 'http://localhost:4246',
},
userProfile: {
serviceBasePath: 'http://localhost:3366',
},
islykill: {
cert: process.env.ISLYKILL_CERT ?? '',
passphrase: process.env.ISLYKILL_SERVICE_PASSPHRASE ?? '',
basePath: process.env.ISLYKILL_SERVICE_BASEPATH ?? '',
cert: process.env.ISLYKILL_CERT,
passphrase: process.env.ISLYKILL_SERVICE_PASSPHRASE,
basePath: process.env.ISLYKILL_SERVICE_BASEPATH,
},
},

contentful: {
accessToken: process.env.CONTENTFUL_ACCESS_TOKEN ?? '',
accessToken: process.env.CONTENTFUL_ACCESS_TOKEN,
},
}
} as Environment

// TODO: Remove empty-string defaulting
const prodConfig: Environment<EnvironmentKeys> = {
const prodConfig = {
production: true,
environment: process.env.ENVIRONMENT ?? '',
name: process.env.name ?? '',
baseApiUrl: process.env.GRAPHQL_API_URL ?? '',
environment: process.env.ENVIRONMENT,
name: process.env.name,
baseApiUrl: process.env.GRAPHQL_API_URL,
audit: {
defaultNamespace: '@island.is/applications',
groupName: process.env.AUDIT_GROUP_NAME ?? '',
groupName: process.env.AUDIT_GROUP_NAME,
serviceName: 'application-system-api',
},
auth: {
issuer: process.env.IDENTITY_SERVER_ISSUER_URL ?? '',
issuer: process.env.IDENTITY_SERVER_ISSUER_URL,
audience: ['@island.is', '@admin.island.is'],
allowClientNationalId: true,
},
templateApi: {
clientLocationOrigin: process.env.CLIENT_LOCATION_ORIGIN ?? '',
clientLocationOrigin: process.env.CLIENT_LOCATION_ORIGIN,
email: {
sender: process.env.EMAIL_FROM_NAME ?? '',
address: process.env.EMAIL_FROM ?? '',
sender: process.env.EMAIL_FROM_NAME,
address: process.env.EMAIL_FROM,
},
jwtSecret: process.env.AUTH_JWT_SECRET ?? '',
jwtSecret: process.env.AUTH_JWT_SECRET,
xRoadBasePathWithEnv: process.env.XROAD_BASE_PATH_WITH_ENV ?? '',
baseApiUrl: process.env.GRAPHQL_API_URL ?? '',
presignBucket: process.env.FILE_SERVICE_PRESIGN_BUCKET ?? '',
attachmentBucket: process.env.APPLICATION_ATTACHMENT_BUCKET ?? '',
baseApiUrl: process.env.GRAPHQL_API_URL,
presignBucket: process.env.FILE_SERVICE_PRESIGN_BUCKET,
attachmentBucket: process.env.APPLICATION_ATTACHMENT_BUCKET,
generalPetition: {
endorsementsApiBasePath: process.env.ENDORSEMENTS_API_BASE_PATH ?? '',
endorsementsApiBasePath: process.env.ENDORSEMENTS_API_BASE_PATH,
},
userProfile: {
serviceBasePath: process.env.SERVICE_USER_PROFILE_URL ?? '',
serviceBasePath: process.env.SERVICE_USER_PROFILE_URL,
},
islykill: {
cert: process.env.ISLYKILL_CERT ?? '',
passphrase: process.env.ISLYKILL_SERVICE_PASSPHRASE ?? '',
basePath: process.env.ISLYKILL_SERVICE_BASEPATH ?? '',
cert: process.env.ISLYKILL_CERT,
passphrase: process.env.ISLYKILL_SERVICE_PASSPHRASE,
basePath: process.env.ISLYKILL_SERVICE_BASEPATH,
},
},
contentful: {
accessToken: process.env.CONTENTFUL_ACCESS_TOKEN ?? '',
accessToken: process.env.CONTENTFUL_ACCESS_TOKEN,
},
}
} as Environment

export default process.env.PROD_MODE === 'true' ||
process.env.NODE_ENV === 'production'
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,4 +8,5 @@ export const openApi = new DocumentBuilder()
.setVersion('1.0')
.addTag('application')
.addTag('payment')
.addBearerAuth()
.build()
8 changes: 6 additions & 2 deletions apps/application-system/form/src/routes/Applications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,19 @@ export const Applications: FC<React.PropsWithChildren<unknown>> = () => {
flexDirection={['column', 'row']}
>
<Text variant="h1">
{formatMessage(coreMessages.applications)}
{template.applicationText
? formatMessage(template.applicationText)
: formatMessage(coreMessages.applications)}
</Text>
{shouldRenderNewApplicationButton ? (
<Box marginTop={[2, 0]}>
<Button
onClick={createApplication}
data-testid="create-new-application"
>
{formatMessage(coreMessages.newApplication)}
{template.newApplicationButtonLabel
? formatMessage(template.newApplicationButtonLabel)
: formatMessage(coreMessages.newApplication)}
</Button>
</Box>
) : null}
Expand Down
Loading

0 comments on commit 413de25

Please sign in to comment.