Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(regulations-admin): Update styling. Update presigned query. #16007

Merged
merged 5 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
thordurhhh marked this conversation as resolved.
Show resolved Hide resolved
}
`
export type UploadingState =
Expand Down