Skip to content

Commit

Permalink
TS-936 Municipality
Browse files Browse the repository at this point in the history
- Fix after review
  • Loading branch information
birkirkristmunds committed Jan 9, 2025
1 parent d302107 commit e53196f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
1 change: 1 addition & 0 deletions apps/skilavottord/web/auth/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type Page =

export const hasDeveloperRole = (role: Role | undefined) =>
role === Role.developer

export const hasMunicipalityRole = (role: Role | undefined) =>
role === Role.municipality

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ interface AccessControlModalProps
nationalIdDisabled?: boolean
partnerIdRequired?: boolean
municipalities?: Option[]

currentPartner?: AccessControl
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useMutation, useQuery } from '@apollo/client'
import gql from 'graphql-tag'
import NextLink from 'next/link'
import { useRouter } from 'next/router'
import React, { FC, useContext } from 'react'
import React, { FC, useContext, useEffect } from 'react'
import { useForm } from 'react-hook-form'

import {
Expand Down Expand Up @@ -126,7 +126,7 @@ const RecyclingCompanyUpdate: FC<React.PropsWithChildren<unknown>> = () => {
let activeSection = 2
let route = routes.recyclingCompanies.baseRoute

React.useEffect(() => {
useEffect(() => {
setValue('isMunicipality', isMunicipalityPage)
}, [isMunicipalityPage, setValue])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ const RecyclingCompanyForm: FC<
/>
</GridColumn>
</GridRow>

<GridRow>
<GridColumn
span={['12/12', '12/12', '12/12', '6/12']}
Expand Down Expand Up @@ -284,7 +283,6 @@ const RecyclingCompanyForm: FC<
/>
</GridColumn>
</GridRow>

{!isMunicipalityPage && (
<GridRow>
<GridColumn span="12/12">
Expand Down Expand Up @@ -344,7 +342,7 @@ const RecyclingCompanyForm: FC<
/>
</GridColumn>
</GridRow>
<div
<Box
style={{
display:
user?.role && hasDeveloperRole(user.role) ? 'block' : 'none',
Expand All @@ -369,7 +367,7 @@ const RecyclingCompanyForm: FC<
/>
</GridColumn>
</GridRow>
</div>
</Box>
</Stack>
</GridContainer>
<Box display="flex" justifyContent="spaceBetween" marginTop={7}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export class AccessControlService {
// Get all sub recycling partners of the municipality
// else get all
if (partnerId) {
// Get all sub recycling partners of the municipality
const subRecyclingPartners = await RecyclingPartnerModel.findAll({
where: { municipalityId: partnerId },
})
Expand Down

0 comments on commit e53196f

Please sign in to comment.