Skip to content

Commit

Permalink
Merge branch 'main' into j-s/spokesperson-access
Browse files Browse the repository at this point in the history
  • Loading branch information
unakb committed Oct 17, 2024
2 parents a4a3160 + 17e1369 commit 3575125
Show file tree
Hide file tree
Showing 335 changed files with 9,567 additions and 4,191 deletions.
4 changes: 1 addition & 3 deletions apps/air-discount-scheme/api/infra/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ export const serviceSetup = (services: {
extraAnnotations: {
dev: {},
staging: {},
prod: {
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
},
prod: {},
},
paths: ['/api/graphql'],
public: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,9 @@ export const serviceSetup = (): ServiceBuilder<'air-discount-scheme-backend'> =>
prod: 'loftbru',
},
extraAnnotations: {
dev: {
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
},
staging: {
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
},
prod: {
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
},
dev: {},
staging: {},
prod: {},
},
paths: ['/api/swagger', '/api/public'],
},
Expand Down
1 change: 0 additions & 1 deletion apps/air-discount-scheme/web/infra/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export const serviceSetup = (services: {
prod: {
'nginx.ingress.kubernetes.io/proxy-buffering': 'on',
'nginx.ingress.kubernetes.io/proxy-buffer-size': '8k',
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
'nginx.ingress.kubernetes.io/configuration-snippet':
'rewrite /$ https://island.is/loftbru; rewrite /en$ https://island.is/en/lower-airfares-for-residents-in-rural-areas;',
},
Expand Down
4 changes: 1 addition & 3 deletions apps/api/infra/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,9 +452,7 @@ export const serviceSetup = (services: {
paths: ['/api'],
extraAnnotations: {
dev: {},
staging: {
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
},
staging: {},
prod: {},
},
public: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ export class TemplateApiApplicationService extends BaseTemplateApiApplicationSer
const s3key = `${application.id}/${attachmentKey}`
const url = await this.awsService.uploadFile(
buffer,
uploadBucket,
s3key,
{ bucket: uploadBucket, key: s3key },
uploadParameters,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export const serviceSetup = (services: {
'nginx.ingress.kubernetes.io/proxy-buffer-size': '8k',
},
staging: {
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
'nginx.ingress.kubernetes.io/proxy-buffering': 'on',
'nginx.ingress.kubernetes.io/proxy-buffer-size': '8k',
},
Expand Down
39 changes: 39 additions & 0 deletions apps/consultation-portal/components/svg/RSSFeedIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React from 'react'

const RSSIcon = (
props: React.JSX.IntrinsicAttributes & React.SVGProps<SVGSVGElement>,
) => {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
enableBackground="new 0 0 512 512"
version="1.1"
viewBox="0 0 512 512"
xmlSpace="preserve"
{...props}
>
<g>
<rect
width="512"
height="512"
x="-512"
y="-512"
fill="#ea7819"
fillOpacity="1"
stroke="none"
rx="70"
ry="70"
transform="scale(-1)"
></rect>
<path
fill="#fff"
d="M81.056 267.05c43.705 0 84.79 17.072 115.665 48.124 30.931 31.051 47.961 72.411 47.961 116.44h67.35c0-127.885-103.62-231.921-230.976-231.921v67.357zm.106-119.4c155.76 0 282.488 127.42 282.488 284.049H431C431 237.925 274.054 80.301 81.162 80.301v67.35zm93.135 236.998c0 25.757-20.892 46.649-46.649 46.649-25.756 0-46.648-20.885-46.648-46.649C81 358.878 101.885 338 127.641 338c25.757 0 46.656 20.878 46.656 46.648z"
></path>
</g>
</svg>
)
}

export default RSSIcon
1 change: 1 addition & 0 deletions apps/consultation-portal/components/svg/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { default as HeroImage } from './HeroImage'
export { default as RSSIcon } from './RSSFeedIcon'
1 change: 0 additions & 1 deletion apps/consultation-portal/infra/samradsgatt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const serviceSetup = (services: {
'nginx.ingress.kubernetes.io/proxy-buffer-size': '8k',
},
staging: {
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
'nginx.ingress.kubernetes.io/proxy-buffering': 'on',
'nginx.ingress.kubernetes.io/proxy-buffer-size': '8k',
},
Expand Down
61 changes: 61 additions & 0 deletions apps/consultation-portal/pages/api/rss.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { NextApiRequest } from 'next'
import initApollo from '../../graphql/client'
import { SUB_GET_CASES } from '../../graphql/queries.graphql'
import { SubGetCasesQuery } from '../../graphql/queries.graphql.generated'
import { SUB_PAGE_SIZE, SUB_STATUSES_TO_FETCH } from '../../utils/consts/consts'

type CaseItem = {
id?: number | null
caseNumber?: string | null
name?: string | null
institutionName?: string | null
policyAreaName?: string | null
}

export default async function handler(req: NextApiRequest, res) {
const client = initApollo()
try {
const {
data: { consultationPortalGetCases },
} = await client.query<SubGetCasesQuery>({
query: SUB_GET_CASES,
variables: {
input: {
caseStatuses: SUB_STATUSES_TO_FETCH,
pageSize: SUB_PAGE_SIZE,
},
},
})

const host: string = req.headers.host
const protocol = `http${host.startsWith('localhost') ? '' : 's'}://`
const baseUrl = `${protocol}${host}`

const getCases = (post: CaseItem) => {
return `<item>
<title>${post.name}</title>
<description>${post.name}</description>
<link>${baseUrl}/samradsgatt/mal/${post.id}</link>
</item>`
}

const feed = `<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title>Samráðsgátt - Áskriftir RSS Veita</title>
<description>Island.is</description>
${consultationPortalGetCases.cases.map((i) => getCases(i)).join('')}
</channel>
</rss>`

res.set('Content-Type', 'text/xml;charset=UTF-8')
return res.status(200).send(feed)
} catch (error) {
if (error.networkError) {
res.status(500).send('Network error')
return
} else {
res.status(500).send('Internal Server Error')
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@
"text": " Hægt er að afskrá sig hér",
"href": "/minaraskriftir"
},
"rssFeedSubscription": {
"description": "Áskrift að RSS veitir þér aðgang að nýjustu málum í Samráðsgátt.",
"text": "Hér er hægt að skrá sig í áskrift að RSS veitu"
},
"tabsLabel": "Veldu tegund áskrifta"
},
"subscriptionTable": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import Link from 'next/link'
import { useUser } from '../../../../hooks/useUser'
import localization from '../../Subscriptions.json'
import { useFetchEmail, useIsMobile } from '../../../../hooks'
import { RSSIcon } from '../../../../components/svg'

interface Props {
children: ReactNode
Expand All @@ -28,6 +29,7 @@ interface Props {
const loc = localization['subscriptionSkeleton']
const locSubs = loc['subscriptions']
const locMySubs = loc['mySubscriptions']
const locRss = loc['rssFeedSubscription']

const BREADCRUMBS_LIST = [
{ title: loc.breadcrumbs[0].title, href: loc.breadcrumbs[0].href },
Expand Down Expand Up @@ -135,6 +137,15 @@ const SubscriptionsSkeleton = ({
<></>
)}
</Box>
<Stack space={1}>
<Box display="flex" alignItems="center" columnGap={1}>
<Text variant="default">{locRss.text}</Text>
<Link href="/api/rss" target="_blank">
<RSSIcon />
</Link>
</Box>
<Text variant="small">{locRss.description}</Text>
</Stack>
</GridContainer>
</Layout>
)
Expand Down
4 changes: 1 addition & 3 deletions apps/contentful-apps/infra/contentful-apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ export const serviceSetup = (): ServiceBuilder<'contentful-apps'> =>
},
paths: ['/'],
extraAnnotations: {
dev: {
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
},
dev: {},
staging: {},
prod: {},
},
Expand Down
4 changes: 1 addition & 3 deletions apps/download-service/infra/download-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ export const serviceSetup = (services: {
paths: ['/download'],
extraAnnotations: {
dev: {},
staging: {
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
},
staging: {},
prod: {},
},
public: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const AidAmountModal = ({
onVisibilityChange,
calculations,
}: Props) => {
const closeModal = (): void => {
const closeModal = () => {
onVisibilityChange(false)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useMemo, useContext } from 'react'
import React, { useState, useMemo } from 'react'
import cn from 'classnames'
import format from 'date-fns/format'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ export class Defendant {
@Field(() => DefenderChoice, { nullable: true })
readonly defenderChoice?: DefenderChoice

@Field(() => DefenderChoice, { nullable: true })
readonly requestedDefenderChoice?: DefenderChoice

@Field(() => String, { nullable: true })
readonly requestedDefenderNationalId?: string

@Field(() => String, { nullable: true })
readonly requestedDefenderName?: string

@Field(() => SubpoenaType, { nullable: true })
readonly subpoenaType?: SubpoenaType

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.sequelize.transaction(async (t) => {
await queryInterface.addColumn(
'defendant',
'requested_defender_choice',
{
type: Sequelize.STRING,
allowNull: true,
},
{ transaction: t },
)
await queryInterface.addColumn(
'defendant',
'requested_defender_national_id',
{
type: Sequelize.STRING,
allowNull: true,
},
{ transaction: t },
)
await queryInterface.addColumn(
'defendant',
'requested_defender_name',
{
type: Sequelize.STRING,
allowNull: true,
},
{ transaction: t },
)

await queryInterface.sequelize.query(
`UPDATE "defendant" SET requested_defender_choice = defender_choice`,
{ transaction: t },
)

await queryInterface.sequelize.query(
`UPDATE "defendant" SET requested_defender_national_id = defender_national_id`,
{ transaction: t },
)

await queryInterface.sequelize.query(
`UPDATE "defendant" SET requested_defender_name = defender_name`,
{ transaction: t },
)
})
},
down: (queryInterface) => {
return queryInterface.sequelize.transaction(async (t) => {
await queryInterface.removeColumn(
'defendant',
'requested_defender_choice',
{
transaction: t,
},
)
await queryInterface.removeColumn(
'defendant',
'requested_defender_national_id',
{
transaction: t,
},
)
await queryInterface.removeColumn(
'defendant',
'requested_defender_name',
{
transaction: t,
},
)
})
},
}
Loading

0 comments on commit 3575125

Please sign in to comment.