Skip to content

Commit

Permalink
Merge branch 'main' into app-universal-links
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Sep 16, 2024
2 parents 3c11e85 + a88bbcf commit aa5dd2d
Show file tree
Hide file tree
Showing 397 changed files with 6,492 additions and 2,100 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ libs/clients/rsk/relationships/
/libs/service-portal/sessions @island-is/aranja
/apps/native/app/ @island-is/aranja-app
codemagic.yaml @island-is/aranja-app
/apps/web/public/.well-known/ @island-is/aranja-app

/apps/judicial-system/ @island-is/kolibri-justice-league
/libs/judicial-system/ @island-is/kolibri-justice-league
Expand Down Expand Up @@ -227,6 +228,7 @@ codemagic.yaml
/libs/application/template-api-modules/src/lib/modules/templates/data-protection-complaint/ @island-is/norda
/libs/shared/form-fields/ @island-is/norda @island-is/island-ui

/libs/service-portal/applications/ @island-is/norda-applications
/libs/portals/admin/application-system/ @island-is/norda-applications
/libs/api/domains/application/ @island-is/norda-applications
/libs/api/domains/payment/ @island-is/norda-applications
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,13 @@ jobs:
# See this for more information:
# https://github.blog/changelog/2020-10-08-github-actions-ability-to-change-retention-days-for-artifacts-and-logs/
- name: Keep PR run event
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@b18b1d32f3f31abcdc29dee3f2484801fe7822f4
with:
name: pr-event
path: event.json
retention-days: 90
include-hidden-files: true
if-no-files-found: error

- name: Get cache
id: get-cache
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,14 @@ jobs:
# See this for more information:
# https://github.blog/changelog/2020-10-08-github-actions-ability-to-change-retention-days-for-artifacts-and-logs/
- name: Keep PR run event
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@b18b1d32f3f31abcdc29dee3f2484801fe7822f4
if: needs.pre-checks.outputs.PRE_CHECK && needs.pre-checks.outputs.PRE_CHECK == 'feature-deploy'
with:
name: pr-event
path: event.json
retention-days: 90
include-hidden-files: true
if-no-files-found: error

- name: Generate nodejs image tag
id: nodejs_image
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ If you want to contribute to the repository, please make sure to follow [this gu
- You have [gcc](https://gcc.gnu.org/) installed (Linux MacOs).
- You have [g++](https://gcc.gnu.org/) installed (Linux MacOs).

{% hint style="info" %}
If you are running on Windows we recommend using [Docker and WSL2](https://docs.docker.com/desktop/windows/wsl/)
{% endhint %}
> [!NOTE]
> If you are running on Windows we recommend using [Docker and WSL2](https://docs.docker.com/desktop/windows/wsl/)
### For fetching secrets

Expand Down
5 changes: 5 additions & 0 deletions apps/api/infra/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ export const serviceSetup = (services: {
FISKISTOFA_ZENTER_CLIENT_ID: '1114',
HSN_WEB_FORM_ID: '1dimJFHLFYtnhoYEA3JxRK',
SESSIONS_API_URL: ref((h) => `http://${h.svc(services.sessionsApi)}`),
AUTH_ADMIN_API_PATH: {
dev: 'https://identity-server.dev01.devland.is/backend',
staging: 'https://identity-server.staging01.devland.is/backend',
prod: 'https://innskra.island.is/backend',
},
AUTH_ADMIN_API_PATHS: {
dev: json({
development: 'https://identity-server.dev01.devland.is/backend',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const workerSetup =
})
.resources({
limits: { cpu: '400m', memory: '768Mi' },
requests: { cpu: '100m', memory: '384Mi' },
requests: { cpu: '150m', memory: '384Mi' },
})

export const serviceSetup = (services: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { User } from '@island.is/auth-nest-tools'
import { Application } from '@island.is/application/types'

export function isNewActor(
export const isNewActor = (
application: Pick<Application, 'applicantActors' | 'applicant'>,
user: User,
) {
) => {
if (!user.actor) {
return false
} else if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import jwt from 'jsonwebtoken'

import { environment } from '../../../../environments'

export function verifyToken<T>(token: string): T | null {
export const verifyToken = <T>(token: string): T | null => {
try {
const decoded = jwt.verify(
token,
Expand Down
4 changes: 2 additions & 2 deletions apps/application-system/form/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
* - https://github.com/airbnb/lottie-web/issues/360#issuecomment-320243980
*
*/
export function fixSvgUrls(_baseUrl: string) {
function fixForAttribute(attrib: string) {
export const fixSvgUrls = (_baseUrl: string) => {
const fixForAttribute = (attrib: string) => {
const baseUrl = window.location.href

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export const GenericListEditor = () => {
skip,
'fields.internalTitle[match]': searchValue,
'fields.genericList.sys.id': sdk.entry.getSys().id,
'sys.archivedAt[exists]': false,
},
})
if (
Expand Down
180 changes: 180 additions & 0 deletions apps/contentful-apps/pages/fields/generic-tag-group-items-field.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
import { useEffect, useRef, useState } from 'react'
import { useDebounce } from 'react-use'
import type { FieldExtensionSDK } from '@contentful/app-sdk'
import {
Box,
Button,
EntryCard,
Pagination,
Spinner,
Stack,
Text,
TextInput,
} from '@contentful/f36-components'
import { PlusIcon } from '@contentful/f36-icons'
import { useCMA, useSDK } from '@contentful/react-apps-toolkit'

const LIST_ITEMS_PER_PAGE = 4
const SEARCH_DEBOUNCE_TIME_IN_MS = 300

const GenericTagGroupItemsField = () => {
const [page, setPage] = useState(0)
const pageRef = useRef(0)
const [searchValue, setSearchValue] = useState('')
const searchValueRef = useRef('')
const [listItemResponse, setListItemResponse] = useState(null)
const [isLoading, setIsLoading] = useState(false)

const [counter, setCounter] = useState(0)

const sdk = useSDK<FieldExtensionSDK>()
const cma = useCMA()

const skip = LIST_ITEMS_PER_PAGE * page

const createGenericTag = async () => {
const tag = await cma.entry.create(
{
contentTypeId: 'genericTag',
environmentId: sdk.ids.environment,
spaceId: sdk.ids.space,
},
{
fields: {
genericTagGroup: {
[sdk.locales.default]: {
sys: {
id: sdk.entry.getSys().id,
linkType: 'Entry',
type: 'Link',
},
},
},
},
},
)
sdk.navigator
.openEntry(tag.sys.id, {
slideIn: { waitForClose: true },
})
.then(() => {
setCounter((c) => c + 1)
})
}

useDebounce(
async () => {
setIsLoading(true)
try {
const response = await cma.entry.getMany({
query: {
content_type: 'genericTag',
limit: LIST_ITEMS_PER_PAGE,
skip,
'fields.internalTitle[match]': searchValue,
'fields.genericTagGroup.sys.id': sdk.entry.getSys().id,
'sys.archivedAt[exists]': false,
},
})

if (
searchValueRef.current === searchValue &&
pageRef.current === page
) {
setListItemResponse(response)
}
} finally {
setIsLoading(false)
}
},
SEARCH_DEBOUNCE_TIME_IN_MS,
[page, searchValue, counter],
)

useEffect(() => {
sdk.window.startAutoResizer()
return () => {
sdk.window.stopAutoResizer()
}
}, [sdk.window])

return (
<div style={{ display: 'flex', flexDirection: 'column', gap: '24px' }}>
<Box>
<Box
onClick={createGenericTag}
style={{ display: 'flex', justifyContent: 'flex-end' }}
>
<Button startIcon={<PlusIcon />}>Create tag</Button>
</Box>
</Box>
<Box style={{ display: 'flex', flexFlow: 'column nowrap', gap: '24px' }}>
<TextInput
placeholder="Search for a generic tag"
value={searchValue}
onChange={(ev) => {
searchValueRef.current = ev.target.value
setSearchValue(ev.target.value)
setPage(0)
pageRef.current = 0
}}
/>

<Box
style={{
display: 'flex',
justifyContent: 'center',
visibility: isLoading ? 'visible' : 'hidden',
}}
>
<Spinner />
</Box>

{listItemResponse?.items?.length > 0 && (
<>
<Box style={{ minHeight: '440px' }}>
<Stack flexDirection="column" spacing="spacingL">
{listItemResponse.items.map((item) => (
<EntryCard
key={item.sys.id}
contentType="Generic Tag"
title={
item.fields.internalTitle?.[sdk.locales.default] ??
'Untitled'
}
onClick={() => {
sdk.navigator
.openEntry(item.sys.id, {
slideIn: { waitForClose: true },
})
.then(() => {
setCounter((c) => c + 1)
})
}}
/>
))}
</Stack>
</Box>
<Pagination
activePage={page}
itemsPerPage={LIST_ITEMS_PER_PAGE}
totalItems={listItemResponse.total}
onPageChange={(newPage) => {
pageRef.current = newPage
setPage(newPage)
}}
/>
</>
)}

{listItemResponse?.items?.length === 0 && (
<Box style={{ display: 'flex', justifyContent: 'center' }}>
<Text>No item was found</Text>
</Box>
)}
</Box>
</div>
)
}

export default GenericTagGroupItemsField
Loading

0 comments on commit aa5dd2d

Please sign in to comment.