From e53196f19ee31e9b364dc5f3265c62b7010c25df Mon Sep 17 00:00:00 2001 From: bkristmundsson Date: Thu, 9 Jan 2025 14:36:25 +0000 Subject: [PATCH] TS-936 Municipality - Fix after review --- apps/skilavottord/web/auth/utils.ts | 1 + .../components/AccessControlModal/AccessControlModal.tsx | 1 - .../RecyclingCompanyUpdate/RecyclingCompanyUpdate.tsx | 4 ++-- .../RecyclingCompanyForm/RecyclingCompanyForm.tsx | 6 ++---- .../src/app/modules/accessControl/accessControl.service.ts | 1 - 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/apps/skilavottord/web/auth/utils.ts b/apps/skilavottord/web/auth/utils.ts index 1139cc8f8ed2..0207e7b6fc8c 100644 --- a/apps/skilavottord/web/auth/utils.ts +++ b/apps/skilavottord/web/auth/utils.ts @@ -12,6 +12,7 @@ type Page = export const hasDeveloperRole = (role: Role | undefined) => role === Role.developer + export const hasMunicipalityRole = (role: Role | undefined) => role === Role.municipality diff --git a/apps/skilavottord/web/screens/AccessControl/components/AccessControlModal/AccessControlModal.tsx b/apps/skilavottord/web/screens/AccessControl/components/AccessControlModal/AccessControlModal.tsx index 6d6344ee4426..b8281f6e418c 100644 --- a/apps/skilavottord/web/screens/AccessControl/components/AccessControlModal/AccessControlModal.tsx +++ b/apps/skilavottord/web/screens/AccessControl/components/AccessControlModal/AccessControlModal.tsx @@ -40,7 +40,6 @@ interface AccessControlModalProps nationalIdDisabled?: boolean partnerIdRequired?: boolean municipalities?: Option[] - currentPartner?: AccessControl } diff --git a/apps/skilavottord/web/screens/RecyclingCompanies/RecyclingCompanyUpdate/RecyclingCompanyUpdate.tsx b/apps/skilavottord/web/screens/RecyclingCompanies/RecyclingCompanyUpdate/RecyclingCompanyUpdate.tsx index aa2889870733..ad991868b447 100644 --- a/apps/skilavottord/web/screens/RecyclingCompanies/RecyclingCompanyUpdate/RecyclingCompanyUpdate.tsx +++ b/apps/skilavottord/web/screens/RecyclingCompanies/RecyclingCompanyUpdate/RecyclingCompanyUpdate.tsx @@ -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 { @@ -126,7 +126,7 @@ const RecyclingCompanyUpdate: FC> = () => { let activeSection = 2 let route = routes.recyclingCompanies.baseRoute - React.useEffect(() => { + useEffect(() => { setValue('isMunicipality', isMunicipalityPage) }, [isMunicipalityPage, setValue]) diff --git a/apps/skilavottord/web/screens/RecyclingCompanies/components/RecyclingCompanyForm/RecyclingCompanyForm.tsx b/apps/skilavottord/web/screens/RecyclingCompanies/components/RecyclingCompanyForm/RecyclingCompanyForm.tsx index a3f79cd05825..e65c0b2378b4 100644 --- a/apps/skilavottord/web/screens/RecyclingCompanies/components/RecyclingCompanyForm/RecyclingCompanyForm.tsx +++ b/apps/skilavottord/web/screens/RecyclingCompanies/components/RecyclingCompanyForm/RecyclingCompanyForm.tsx @@ -206,7 +206,6 @@ const RecyclingCompanyForm: FC< /> - - {!isMunicipalityPage && ( @@ -344,7 +342,7 @@ const RecyclingCompanyForm: FC< /> -
-
+ diff --git a/apps/skilavottord/ws/src/app/modules/accessControl/accessControl.service.ts b/apps/skilavottord/ws/src/app/modules/accessControl/accessControl.service.ts index 9fd855b53af6..e9d68cb09c84 100644 --- a/apps/skilavottord/ws/src/app/modules/accessControl/accessControl.service.ts +++ b/apps/skilavottord/ws/src/app/modules/accessControl/accessControl.service.ts @@ -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 }, })