Skip to content

Commit

Permalink
Update styling. Update presigned query
Browse files Browse the repository at this point in the history
  • Loading branch information
thordurhhh committed Sep 13, 2024
1 parent a811680 commit 535628f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 22 deletions.
2 changes: 1 addition & 1 deletion apps/web/components/Regulations/RegulationTexts.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export type RegulationPageTexts = Partial<
| 'historyTitle' // 'Breytingasaga reglugerðar ${name}'
| 'historyStart' // 'Stofnreglugerð gefin út'
| 'historyStartAmending' // 'Reglugerðin gefin út'
| 'historyChange' // 'Breytt af ${name}'
| 'historyChange' // 'Breytt með ${name}'
| 'historyCancel' // 'Brottfelld af ${name}'
| 'historyCurrentVersion' // 'Núgildandi útgáfa'
| 'historyPastSplitter' // 'Gildandi breytingar'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { Args, Mutation, Query, Resolver } from '@nestjs/graphql'
import graphqlTypeJson from 'graphql-type-json'

import { UseGuards } from '@nestjs/common'
import { RegulationsService } from '@island.is/clients/regulations'
import { IdsUserGuard, ScopesGuard } from '@island.is/auth-nest-tools'
import {
RegulationSearchResults,
RegulationYears,
RegulationListItem,
} from '@island.is/regulations/web'
import { Audit } from '@island.is/nest/audit'
import {
Regulation,
RegulationDiff,
Expand All @@ -24,12 +25,14 @@ import { CreatePresignedPostInput } from './dto/createPresignedPost.input'
import { PresignedPostResults } from '@island.is/regulations/admin'

const validPage = (page: number | undefined) => (page && page >= 1 ? page : 1)

@Audit({ namespace: '@island.is/api/regulations' })
@Resolver()
export class RegulationsResolver {
constructor(private regulationsService: RegulationsService) {}

@Mutation(() => graphqlTypeJson)
@Audit()
@UseGuards(IdsUserGuard, ScopesGuard)
@Mutation(() => graphqlTypeJson, { name: 'regulationCreatePresignedPost' })
createPresignedPost(
@Args('input') input: CreatePresignedPostInput,
): Promise<PresignedPostResults | null> {
Expand Down
34 changes: 19 additions & 15 deletions libs/portals/admin/regulations-admin/src/components/TaskList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,37 @@ export const TaskList = () => {

if (loading) {
return (
<Box marginBottom={[4, 4, 8]}>
<Box paddingTop={1} marginBottom={[4, 4, 8]}>
<SkeletonLoader height={80} repeat={3} space={3} />
</Box>
)
}

if (error) {
return (
<ContentBlock>
<AlertMessage
type="error"
title={t(msg.errorTitle)}
message={t(msg.errorText)}
/>
</ContentBlock>
<Box paddingTop={1}>
<ContentBlock>
<AlertMessage
type="error"
title={t(msg.errorTitle)}
message={t(msg.errorText)}
/>
</ContentBlock>
</Box>
)
}

if (drafts && drafts.length === 0) {
return (
<ContentBlock>
<AlertMessage
type="default"
title={t(msg.noDataTitle)}
message={t(msg.noDataText)}
/>
</ContentBlock>
<Box paddingTop={1}>
<ContentBlock>
<AlertMessage
type="default"
title={t(msg.noDataTitle)}
message={t(msg.noDataText)}
/>
</ContentBlock>
</Box>
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const ImpactListItem = (props: ImpactListItemProps) => {
variant="small"
color={getCurrentEffect(effect) ? 'mint800' : 'blueberry600'}
>
Breytt af{' '}
Breytt með{' '}
{getCurrentEffect(effect) ? 'núverandi reglugerð' : effect.name}
</Text>
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type QueryResult<T> =

export const CreatePresignedPostMutation = gql`
mutation CreatePresignedPostMutation($input: CreatePresignedPostInput!) {
createPresignedPost(input: $input)
regulationCreatePresignedPost(input: $input)
}
`
export type UploadingState =
Expand Down

0 comments on commit 535628f

Please sign in to comment.