From e31ec215fe55adfa98b469103f1be29988ee5529 Mon Sep 17 00:00:00 2001 From: Disa Date: Thu, 18 Nov 2021 11:17:28 +0000 Subject: [PATCH 001/156] feat: add sidebar menu state --- apps/service-portal/src/store/actions.ts | 5 +++++ apps/service-portal/src/store/store.ts | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/apps/service-portal/src/store/actions.ts b/apps/service-portal/src/store/actions.ts index 3ff36affb525..5d0bc4048100 100644 --- a/apps/service-portal/src/store/actions.ts +++ b/apps/service-portal/src/store/actions.ts @@ -15,6 +15,7 @@ export enum ActionType { SetMobileMenuState = 'setMobileMenuState', SetUserMenuState = 'setUserMenuState', SetRoutesFulfilled = 'setRoutesFulfilled', + SetSidebarMenuState = 'setSidebarMenuState', UpdateFulfilledRoutes = 'updateFulfilledRoutes', SetModulesList = 'setModulesList', } @@ -46,3 +47,7 @@ export type Action = type: ActionType.SetModulesList payload: Record } + | { + type: ActionType.SetSidebarMenuState + payload: MenuState + } diff --git a/apps/service-portal/src/store/store.ts b/apps/service-portal/src/store/store.ts index cbcdd3b5ec71..565b1c9d991b 100644 --- a/apps/service-portal/src/store/store.ts +++ b/apps/service-portal/src/store/store.ts @@ -11,6 +11,7 @@ export interface StoreState { modulesPending: boolean navigationState: AsyncActionState notificationMenuState: MenuState + sidebarState: MenuState mobileMenuState: MenuState userMenuState: MenuState routes: ServicePortalRoute[] @@ -20,6 +21,7 @@ export const initialState: StoreState = { modules, modulesPending: true, navigationState: 'passive', + sidebarState: 'open', notificationMenuState: 'closed', mobileMenuState: 'closed', userMenuState: 'closed', @@ -60,6 +62,11 @@ export const reducer = (state: StoreState, action: Action): StoreState => { modules: action.payload, modulesPending: false, } + case ActionType.SetSidebarMenuState: + return { + ...state, + sidebarState: action.payload, + } default: return state } From 6147fd03012b8fb0dd1ef40dcba2ce6fbe21f3f3 Mon Sep 17 00:00:00 2001 From: Disa Date: Thu, 18 Nov 2021 11:22:53 +0000 Subject: [PATCH 002/156] feat: sidebar fixed to left and hover/active state for nav items --- .../src/components/Header/Header.css.ts | 9 ++ .../src/components/Header/Header.tsx | 25 +--- .../src/components/Layout/Layout.tsx | 83 +++++++----- .../components/Sidebar/ModuleNavigation.tsx | 21 ++- .../components/Sidebar/NavItem/NavItem.css.ts | 12 +- .../components/Sidebar/NavItem/NavItem.tsx | 37 +++--- .../components/Sidebar/NavItem/SubNavItem.tsx | 3 +- .../src/components/Sidebar/Sidebar.css.ts | 37 +++++- .../src/components/Sidebar/Sidebar.tsx | 124 +++++++++++++----- .../src/lib/navigation/masterNavigation.ts | 58 +++++++- .../core/src/lib/service-portal-core.ts | 1 + 11 files changed, 293 insertions(+), 117 deletions(-) diff --git a/apps/service-portal/src/components/Header/Header.css.ts b/apps/service-portal/src/components/Header/Header.css.ts index 97ab0b478254..1aaddd73b9dd 100644 --- a/apps/service-portal/src/components/Header/Header.css.ts +++ b/apps/service-portal/src/components/Header/Header.css.ts @@ -13,6 +13,7 @@ export const header = style({ zIndex: zIndex.header, display: 'flex', alignItems: 'center', + justifyContent: 'flex-end', width: '100%', height: SERVICE_PORTAL_HEADER_HEIGHT_SM, backgroundColor: theme.color.white, @@ -31,3 +32,11 @@ export const placeholder = style({ }, }, }) + +export const menuBox = style({ + '@media': { + [`screen and (max-width: ${theme.breakpoints.lg}px)`]: { + display: 'flex', + }, + }, +}) diff --git a/apps/service-portal/src/components/Header/Header.tsx b/apps/service-portal/src/components/Header/Header.tsx index 7c55fe21d77a..d3ff2c547809 100644 --- a/apps/service-portal/src/components/Header/Header.tsx +++ b/apps/service-portal/src/components/Header/Header.tsx @@ -1,5 +1,4 @@ import React, { FC } from 'react' -import { Link } from 'react-router-dom' import { Box, Hidden, @@ -31,28 +30,10 @@ export const Header: FC<{}> = () => { <>
- + - - - - - - - - - - - - - + + diff --git a/apps/service-portal/src/components/Layout/Layout.tsx b/apps/service-portal/src/components/Layout/Layout.tsx index 0cee09785074..849dc48232be 100644 --- a/apps/service-portal/src/components/Layout/Layout.tsx +++ b/apps/service-portal/src/components/Layout/Layout.tsx @@ -1,39 +1,65 @@ -import React, { FC } from 'react' +import React, { FC, useEffect, useState } from 'react' import Header from '../Header/Header' import Sidebar from '../Sidebar/Sidebar' import { Box, - Columns, - Column, Hidden, - Footer, - ContentBlock, ToastContainer, + GridContainer, + GridColumn, + GridRow, + ResponsiveProp, + GridColumns, } from '@island.is/island-ui/core' import ContentBreadcrumbs from '../../components/ContentBreadcrumbs/ContentBreadcrumbs' import * as styles from './Layout.css' import AuthOverlay from '../Loaders/AuthOverlay/AuthOverlay' import useRoutes from '../../hooks/useRoutes/useRoutes' import { useModules } from '../../hooks/useModules/useModules' -import { getFooterProps } from './footerProps' import { useScrollTopOnUpdate } from '@island.is/service-portal/core' import { useLocation } from 'react-router-dom' import MobileMenu from '../MobileMenu/MobileMenu' -import { useFooterContent } from '@island.is/service-portal/graphql' -import { useLocale, useNamespaces } from '@island.is/localization' +import { useNamespaces } from '@island.is/localization' import { useStore } from '../../store/stateProvider' import { RemoveScroll } from 'react-remove-scroll' const Layout: FC = ({ children }) => { useRoutes() useModules() - const { locale, formatMessage } = useLocale() useNamespaces('service.portal') - const data = useFooterContent(locale) const { pathname } = useLocation() useScrollTopOnUpdate([pathname]) - const footerProps = getFooterProps(data, formatMessage) - const [{ mobileMenuState }] = useStore() + const [{ mobileMenuState, sidebarState }] = useStore() + const [span, setSpan] = useState>([ + '12/12', + '12/12', + '12/12', + '8/12', + '9/12', + ]) + const [offset, setOffset] = useState>([ + '0', + '0', + '0', + '4/12', + '3/12', + ]) + + useEffect(() => { + if (sidebarState === 'closed' && pathname.includes('fjarmal')) { + setSpan(['12/12', '12/12', '12/12', '11/12', '11/12']) + setOffset(['0', '0', '0', '1/12', '1/12']) + } else if (sidebarState === 'closed' && !pathname.includes('fjarmal')) { + setSpan(['12/12', '12/12', '12/12', '10/12', '10/12']) + setOffset(['0', '0', '0', '2/12', '2/12']) + } else if (sidebarState === 'open' && pathname.includes('fjarmal')) { + setSpan(['12/12', '12/12', '12/12', '9/12', '10/12']) + setOffset(['0', '0', '0', '3/12', '2/12']) + } else { + setSpan(['12/12', '12/12', '12/12', '8/12', '9/12']) + setOffset(['0', '0', '0', '4/12', '3/12']) + } + }, [sidebarState, pathname]) return ( <> @@ -46,27 +72,20 @@ const Layout: FC = ({ children }) => { - - - - - - - - - - - - -
{children}
-
-
-
-
-
- -
diff --git a/libs/shared/components/src/auth/UserMenu/ServicePortal/UserDropdownSP.tsx b/libs/shared/components/src/auth/UserMenu/ServicePortal/UserDropdownSP.tsx index 8d5a702a7677..2c7b5e80c19e 100644 --- a/libs/shared/components/src/auth/UserMenu/ServicePortal/UserDropdownSP.tsx +++ b/libs/shared/components/src/auth/UserMenu/ServicePortal/UserDropdownSP.tsx @@ -72,7 +72,7 @@ export const UserDropdown = ({ borderRadius="large" display="flex" flexDirection="column" - className={cn(styles.dropdown, styles.fullScreen)} + className={styles.fullScreen} > Date: Wed, 1 Dec 2021 10:29:20 +0000 Subject: [PATCH 048/156] fix: small logo disappearing when sidebar collapses --- .../src/components/Sidebar/Sidebar.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/apps/service-portal/src/components/Sidebar/Sidebar.tsx b/apps/service-portal/src/components/Sidebar/Sidebar.tsx index e23a35a13dd7..3323a689f06a 100644 --- a/apps/service-portal/src/components/Sidebar/Sidebar.tsx +++ b/apps/service-portal/src/components/Sidebar/Sidebar.tsx @@ -1,15 +1,16 @@ import React, { FC, useState } from 'react' import { Box, Stack, Logo, FocusableBox, Icon } from '@island.is/island-ui/core' import { BetaTag } from '../Logo/BetaTag' -import * as styles from './Sidebar.css' -import ModuleNavigation from './ModuleNavigation' -import useNavigation from '../../hooks/useNavigation/useNavigation' +import { ActionType } from '../../store/actions' import { ServicePortalPath } from '@island.is/service-portal/core' import { Link } from 'react-router-dom' import { useStore } from '../../store/stateProvider' -import { ActionType } from '../../store/actions' -import cn from 'classnames' +import ModuleNavigation from './ModuleNavigation' +import useNavigation from '../../hooks/useNavigation/useNavigation' import { useUpdateUnreadDocuments } from '@island.is/service-portal/core' +import * as styles from './Sidebar.css' +import cn from 'classnames' + // eslint-disable-next-line @typescript-eslint/ban-types export const Sidebar: FC<{}> = () => { const navigation = useNavigation() @@ -35,7 +36,11 @@ export const Sidebar: FC<{}> = () => { > - + From 73e721423eee87a0da20358777eefde03b7b4919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Wed, 1 Dec 2021 10:39:24 +0000 Subject: [PATCH 049/156] feat: headingVariant prop added to island-ui core ActionCard --- libs/island-ui/core/src/lib/ActionCard/ActionCard.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/island-ui/core/src/lib/ActionCard/ActionCard.tsx b/libs/island-ui/core/src/lib/ActionCard/ActionCard.tsx index e1719adc1641..7ac3b4c68b80 100644 --- a/libs/island-ui/core/src/lib/ActionCard/ActionCard.tsx +++ b/libs/island-ui/core/src/lib/ActionCard/ActionCard.tsx @@ -14,6 +14,7 @@ import { Icon } from '../IconRC/Icon' type ActionCardProps = { date?: string heading?: string + headingVariant?: 'h3' | 'h4' text?: string eyebrow?: string backgroundColor?: 'white' | 'blue' | 'red' @@ -74,6 +75,7 @@ const defaultUnavailable = { export const ActionCard: React.FC = ({ date, heading, + headingVariant = 'h3', text, eyebrow, backgroundColor = 'white', @@ -246,7 +248,9 @@ export const ActionCard: React.FC = ({ {eyebrow} - {heading} + + {heading} + {text} From 109949c93d95d712d400ecadf5e7155aabab244a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Wed, 1 Dec 2021 10:39:34 +0000 Subject: [PATCH 050/156] refactor: assets overview --- .../assets/src/components/AssetListCards/index.tsx | 5 +++-- .../assets/src/screens/AssetsOverview/AssetsOverview.tsx | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/service-portal/assets/src/components/AssetListCards/index.tsx b/libs/service-portal/assets/src/components/AssetListCards/index.tsx index f250e4041b0b..ae5b9fb2362c 100644 --- a/libs/service-portal/assets/src/components/AssetListCards/index.tsx +++ b/libs/service-portal/assets/src/components/AssetListCards/index.tsx @@ -23,13 +23,14 @@ const AssetListCards: FC = ({ assets, paginateCallback }) => { return ( {assets?.properties?.map((asset, i) => ( - 0 ? 4 : undefined}> + 0 ? 2 : undefined}> diff --git a/libs/service-portal/assets/src/screens/AssetsOverview/AssetsOverview.tsx b/libs/service-portal/assets/src/screens/AssetsOverview/AssetsOverview.tsx index 76430444a16a..792fc2e5a66a 100644 --- a/libs/service-portal/assets/src/screens/AssetsOverview/AssetsOverview.tsx +++ b/libs/service-portal/assets/src/screens/AssetsOverview/AssetsOverview.tsx @@ -95,13 +95,13 @@ export const AssetsOverview: ServicePortalModuleComponent = () => { defaultMessage: 'Hér færðu upplýsingar úr fasteignaskrá um fasteignir þínar, lönd og lóðir sem þú ert skráður eigandi að.', })} - img="./assets/images/sofa.svg" /> {loading && } {data && ( )} + {error && ( Date: Wed, 1 Dec 2021 10:46:11 +0000 Subject: [PATCH 051/156] fix: add bottom spacing to main content --- apps/service-portal/src/components/Layout/Layout.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/service-portal/src/components/Layout/Layout.tsx b/apps/service-portal/src/components/Layout/Layout.tsx index 5238d35f2e87..dc681c3e16fd 100644 --- a/apps/service-portal/src/components/Layout/Layout.tsx +++ b/apps/service-portal/src/components/Layout/Layout.tsx @@ -75,7 +75,7 @@ const Layout: FC = ({ children }) => { - + From 6e2aef9784d1a2dbf8ffa5015cd36ff3fce64544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Wed, 1 Dec 2021 10:48:42 +0000 Subject: [PATCH 052/156] fix: remove header from assetsDetail --- .../RealEstateAssetDetail.tsx | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/libs/service-portal/assets/src/screens/RealEstateAssetDetail/RealEstateAssetDetail.tsx b/libs/service-portal/assets/src/screens/RealEstateAssetDetail/RealEstateAssetDetail.tsx index 8b7f498b1a4b..85bbcfc7d49e 100644 --- a/libs/service-portal/assets/src/screens/RealEstateAssetDetail/RealEstateAssetDetail.tsx +++ b/libs/service-portal/assets/src/screens/RealEstateAssetDetail/RealEstateAssetDetail.tsx @@ -100,21 +100,6 @@ export const AssetsOverview: ServicePortalModuleComponent = () => { !ownersQuery?.data?.assetsPropertyOwners?.paging) return ( <> - - - From 241e2ec7899a1ac13343b7d2a4caa4a6d4289e0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Wed, 1 Dec 2021 10:53:09 +0000 Subject: [PATCH 053/156] refactor: smaller font for assetDisclaimer --- .../assets/src/components/AssetDisclaimer/index.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/service-portal/assets/src/components/AssetDisclaimer/index.tsx b/libs/service-portal/assets/src/components/AssetDisclaimer/index.tsx index 19bc056a5c7b..b469d2bdd943 100644 --- a/libs/service-portal/assets/src/components/AssetDisclaimer/index.tsx +++ b/libs/service-portal/assets/src/components/AssetDisclaimer/index.tsx @@ -7,8 +7,12 @@ const AssetDisclaimer = () => { const { formatMessage } = useLocale() return ( - {formatMessage(messages.disclaimerA)} - {formatMessage(messages.disclaimerB)} + + {formatMessage(messages.disclaimerA)} + + + {formatMessage(messages.disclaimerB)} + ) } From e5c2f63e4073caf7e27a1e3bbb0ca9b982974dd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Wed, 1 Dec 2021 14:12:31 +0000 Subject: [PATCH 054/156] refactor: refactoring unused stuff --- .../service-portal/src/components/Header/Header.css.ts | 9 --------- apps/service-portal/src/components/Header/Header.tsx | 1 - .../src/components/Sidebar/ModuleNavigation.tsx | 10 ++-------- .../src/components/Sidebar/Sidebar.css.ts | 5 ++--- 4 files changed, 4 insertions(+), 21 deletions(-) diff --git a/apps/service-portal/src/components/Header/Header.css.ts b/apps/service-portal/src/components/Header/Header.css.ts index f746b838e72e..ed77e579abaa 100644 --- a/apps/service-portal/src/components/Header/Header.css.ts +++ b/apps/service-portal/src/components/Header/Header.css.ts @@ -13,7 +13,6 @@ export const header = style({ zIndex: zIndex.header, display: 'flex', alignItems: 'center', - justifyContent: 'flex-end', width: '100%', height: SERVICE_PORTAL_HEADER_HEIGHT_SM, backgroundColor: theme.color.white, @@ -40,11 +39,3 @@ export const placeholder = style({ }, }, }) - -export const menuBox = style({ - '@media': { - [`screen and (max-width: ${theme.breakpoints.lg}px)`]: { - display: 'flex', - }, - }, -}) diff --git a/apps/service-portal/src/components/Header/Header.tsx b/apps/service-portal/src/components/Header/Header.tsx index 113bba8558e6..7e3872695c08 100644 --- a/apps/service-portal/src/components/Header/Header.tsx +++ b/apps/service-portal/src/components/Header/Header.tsx @@ -2,7 +2,6 @@ import React, { FC } from 'react' import { Box, Hidden, - ContentBlock, Button, Logo, FocusableBox, diff --git a/apps/service-portal/src/components/Sidebar/ModuleNavigation.tsx b/apps/service-portal/src/components/Sidebar/ModuleNavigation.tsx index 0f60f6ddcffc..7fcd2001d89c 100644 --- a/apps/service-portal/src/components/Sidebar/ModuleNavigation.tsx +++ b/apps/service-portal/src/components/Sidebar/ModuleNavigation.tsx @@ -41,17 +41,11 @@ const ModuleNavigation: FC = ({ setExpand(!expand) } const handleRootItemClick = (external?: boolean) => { - if (nav.path === undefined) { - handleExpand() - } + if (nav.path === undefined) handleExpand() if (onItemClick) onItemClick() - if (external) { - servicePortalOutboundLink() - } + if (external) servicePortalOutboundLink() } - // const unreadDocsCounter = useUnreadDocumentsCounter() - const navChildren = nav?.children?.filter((child) => !child.navHide) const navArray = Array.isArray(navChildren) && navChildren.length > 0 return ( diff --git a/apps/service-portal/src/components/Sidebar/Sidebar.css.ts b/apps/service-portal/src/components/Sidebar/Sidebar.css.ts index fbd674f44d1c..d51bde07aef2 100644 --- a/apps/service-portal/src/components/Sidebar/Sidebar.css.ts +++ b/apps/service-portal/src/components/Sidebar/Sidebar.css.ts @@ -7,16 +7,15 @@ export const sidebar = style({ left: 0, zIndex: 10, height: '100%', - minHeight: '100vh', marginBottom: theme.spacing['10'], transition: 'all 250ms ease-in-out', width: 252, - backgroundColor: `${theme.color.blue100}`, + backgroundColor: theme.color.blue100, }) export const collapsed = style({ left: '-125px', - backgroundColor: `${theme.color.transparent}`, + backgroundColor: theme.color.transparent, }) export const logoCollapsed = style({ From 57baf01964dd57b4c9b7fd9a457d5aa0d9b97d73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Wed, 1 Dec 2021 15:14:02 +0000 Subject: [PATCH 055/156] refactor: cleanup grid in Layout --- .../src/components/Layout/Layout.tsx | 55 ++++++++++--------- .../src/components/Layout/constants.ts | 51 +++++++++++++++++ 2 files changed, 79 insertions(+), 27 deletions(-) create mode 100644 apps/service-portal/src/components/Layout/constants.ts diff --git a/apps/service-portal/src/components/Layout/Layout.tsx b/apps/service-portal/src/components/Layout/Layout.tsx index dc681c3e16fd..b2968fd8b4b5 100644 --- a/apps/service-portal/src/components/Layout/Layout.tsx +++ b/apps/service-portal/src/components/Layout/Layout.tsx @@ -16,12 +16,16 @@ import * as styles from './Layout.css' import AuthOverlay from '../Loaders/AuthOverlay/AuthOverlay' import useRoutes from '../../hooks/useRoutes/useRoutes' import { useModules } from '../../hooks/useModules/useModules' -import { useScrollTopOnUpdate } from '@island.is/service-portal/core' +import { + ServicePortalPath, + useScrollTopOnUpdate, +} from '@island.is/service-portal/core' import { useLocation } from 'react-router-dom' import MobileMenu from '../MobileMenu/MobileMenu' import { useNamespaces } from '@island.is/localization' import { useStore } from '../../store/stateProvider' import { RemoveScroll } from 'react-remove-scroll' +import { gridlayout, wideScreens } from './constants' const Layout: FC = ({ children }) => { useRoutes() @@ -30,36 +34,33 @@ const Layout: FC = ({ children }) => { const { pathname } = useLocation() useScrollTopOnUpdate([pathname]) const [{ mobileMenuState, sidebarState }] = useStore() - const [span, setSpan] = useState>([ - '12/12', - '12/12', - '12/12', - '8/12', - '9/12', - ]) - const [offset, setOffset] = useState>([ - '0', - '0', - '0', - '4/12', - '3/12', - ]) + + const [span, setSpan] = useState>( + gridlayout.default.span, + ) + const [offset, setOffset] = useState>( + gridlayout.default.offset, + ) + const hasWideLayout = wideScreens.includes(pathname as ServicePortalPath) + const isDefaultClosed = sidebarState === 'closed' && !hasWideLayout + const isWideClosed = sidebarState === 'closed' && hasWideLayout + const isWide = sidebarState === 'open' && hasWideLayout useEffect(() => { - if (sidebarState === 'closed' && pathname.includes('fjarmal')) { - setSpan(['12/12', '12/12', '12/12', '11/12', '11/12']) - setOffset(['0', '0', '0', '1/12', '1/12']) - } else if (sidebarState === 'closed' && !pathname.includes('fjarmal')) { - setSpan(['12/12', '12/12', '12/12', '10/12', '10/12']) - setOffset(['0', '0', '0', '2/12', '2/12']) - } else if (sidebarState === 'open' && pathname.includes('fjarmal')) { - setSpan(['12/12', '12/12', '12/12', '9/12', '10/12']) - setOffset(['0', '0', '0', '3/12', '2/12']) + if (isWideClosed) { + setSpan(gridlayout.wideClosed.span) + setOffset(gridlayout.wideClosed.offset) + } else if (isDefaultClosed) { + setSpan(gridlayout.defaultClosed.span) + setOffset(gridlayout.defaultClosed.offset) + } else if (isWide) { + setSpan(gridlayout.wide.span) + setOffset(gridlayout.wide.offset) } else { - setSpan(['12/12', '12/12', '12/12', '9/12', '9/12']) - setOffset(['0', '0', '0', '3/12', '3/12']) + setSpan(gridlayout.default.span) + setOffset(gridlayout.default.offset) } - }, [sidebarState, pathname]) + }, [isDefaultClosed, isWide, isWideClosed]) return ( <> diff --git a/apps/service-portal/src/components/Layout/constants.ts b/apps/service-portal/src/components/Layout/constants.ts new file mode 100644 index 000000000000..01eda51a4895 --- /dev/null +++ b/apps/service-portal/src/components/Layout/constants.ts @@ -0,0 +1,51 @@ +import { GridColumns, ResponsiveProp } from '@island.is/island-ui/core/types' +import { ServicePortalPath } from '@island.is/service-portal/core' +type responsiveGridColumns = { + default: { + span: ResponsiveProp + offset: ResponsiveProp + } + wide: { + span: ResponsiveProp + offset: ResponsiveProp + } + defaultClosed: { + span: ResponsiveProp + offset: ResponsiveProp + } + wideClosed: { + span: ResponsiveProp + offset: ResponsiveProp + } +} + +export const gridlayout: responsiveGridColumns = { + default: { + span: ['12/12', '12/12', '12/12', '9/12', '9/12'], + offset: ['0', '0', '0', '3/12', '3/12'], + }, + wide: { + span: ['12/12', '12/12', '12/12', '9/12', '10/12'], + offset: ['0', '0', '0', '3/12', '2/12'], + }, + defaultClosed: { + span: ['12/12', '12/12', '12/12', '10/12', '10/12'], + offset: ['0', '0', '0', '2/12', '2/12'], + }, + wideClosed: { + span: ['12/12', '12/12', '12/12', '11/12', '11/12'], + offset: ['0', '0', '0', '1/12', '1/12'], + }, +} + +export const wideScreens = [ + ServicePortalPath.FinanceRoot, + ServicePortalPath.FinanceStatus, + ServicePortalPath.FinanceTransactions, + ServicePortalPath.FinanceVehicles, + ServicePortalPath.FinanceBills, + ServicePortalPath.FinanceEmployeeClaims, + ServicePortalPath.FinanceExternal, + ServicePortalPath.FinanceLocalTax, + ServicePortalPath.FinancePayments, +] From c147cebbb52de73cc61a61366caaca210cb0c770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Wed, 1 Dec 2021 15:34:49 +0000 Subject: [PATCH 056/156] fix: revert fixing lint warnings --- apps/service-portal/infra/service-portal.ts | 4 +--- .../components/ContentBreadcrumbs/ContentBreadcrumbs.tsx | 1 - apps/service-portal/src/components/Greeting/Greeting.tsx | 8 +++++--- apps/service-portal/src/components/Header/Header.tsx | 1 - apps/service-portal/src/components/Layout/footerProps.ts | 1 - .../src/components/Loaders/AuthOverlay/AuthOverlay.tsx | 2 +- .../NotificationMenuTrigger/NotificationMenuTrigger.tsx | 1 - .../src/components/Sidebar/ModuleNavigation.tsx | 2 +- apps/service-portal/src/components/Sidebar/Sidebar.tsx | 1 - .../components/UserProfileLocale/UserProfileLocale.tsx | 1 - apps/service-portal/src/hooks/useModules/useModules.ts | 3 ++- apps/service-portal/src/hooks/useRoutes/useRoutes.ts | 3 --- apps/service-portal/src/screens/Dashboard/Dashboard.tsx | 3 +-- .../src/screens/Dashboard/WidgetLoading/WidgetLoading.tsx | 2 +- apps/service-portal/src/screens/Modules/Modules.tsx | 1 - apps/service-portal/src/store/mockData.tsx | 1 - apps/service-portal/src/store/modules.ts | 1 + 17 files changed, 13 insertions(+), 23 deletions(-) diff --git a/apps/service-portal/infra/service-portal.ts b/apps/service-portal/infra/service-portal.ts index 4da09e9bd39a..09b6466d90ce 100644 --- a/apps/service-portal/infra/service-portal.ts +++ b/apps/service-portal/infra/service-portal.ts @@ -1,7 +1,5 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ -import { service, ServiceBuilder } from '../../../infra/src/dsl/dsl' +import { ref, service, ServiceBuilder } from '../../../infra/src/dsl/dsl' -// eslint-disable-next-line @typescript-eslint/ban-types export const serviceSetup = (services: {}): ServiceBuilder<'service-portal'> => service('service-portal') .namespace('service-portal') diff --git a/apps/service-portal/src/components/ContentBreadcrumbs/ContentBreadcrumbs.tsx b/apps/service-portal/src/components/ContentBreadcrumbs/ContentBreadcrumbs.tsx index 40eaf5b2aee4..c0165fed95e1 100644 --- a/apps/service-portal/src/components/ContentBreadcrumbs/ContentBreadcrumbs.tsx +++ b/apps/service-portal/src/components/ContentBreadcrumbs/ContentBreadcrumbs.tsx @@ -24,7 +24,6 @@ const reduce = ( return children.reduce((iAcc, n) => reduce(f, n, iAcc), newAcc) } -// eslint-disable-next-line @typescript-eslint/ban-types const ContentBreadcrumbs: FC<{}> = () => { const navigation = useNavigation() const location = useLocation() diff --git a/apps/service-portal/src/components/Greeting/Greeting.tsx b/apps/service-portal/src/components/Greeting/Greeting.tsx index 7e25ea4545f3..2b2a6ff7c8eb 100644 --- a/apps/service-portal/src/components/Greeting/Greeting.tsx +++ b/apps/service-portal/src/components/Greeting/Greeting.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/jsx-no-target-blank */ import React, { FC } from 'react' import { Box, @@ -23,7 +22,6 @@ const NationalRegistryUserQuery = gql` } ` -// eslint-disable-next-line @typescript-eslint/ban-types const Greeting: FC<{}> = () => { const { formatMessage } = useLocale() const { data } = useQuery(NationalRegistryUserQuery) @@ -74,7 +72,11 @@ const Greeting: FC<{}> = () => { {formatMessage(m.greetingIntro)}
- + - - - - - ) -} diff --git a/libs/shared/components/src/auth/UserMenu/UserDelegations.tsx b/libs/shared/components/src/auth/UserMenu/UserDelegations.tsx index ea3b579724a8..f4336ca5d1f0 100644 --- a/libs/shared/components/src/auth/UserMenu/UserDelegations.tsx +++ b/libs/shared/components/src/auth/UserMenu/UserDelegations.tsx @@ -1,16 +1,17 @@ -import React, { FC } from 'react' +import React from 'react' import { Stack, Text, - TopicCard, SkeletonLoader, + Divider, + Box, } from '@island.is/island-ui/core' import { User } from '@island.is/shared/types' import { useLocale } from '@island.is/localization' import { Features, useFeatureFlag } from '@island.is/react/feature-flags' import { userMessages } from '@island.is/shared/translations' -import * as styles from './UserMenu.css' import { useActorDelegationsQuery } from '../../../gen/graphql' +import { UserTopicCard } from './UserTopicCard' interface UserDelegationsProps { user: User @@ -23,14 +24,6 @@ interface Delegation { isCurrent: boolean } -const List: FC = ({ children }) => { - return ( -
- {children} -
- ) -} - const getInitialDelegations = (user: User): Delegation[] => { if (!user.profile.actor) { return [] @@ -70,31 +63,33 @@ export const UserDelegations = ({ ) } + const dataReady = !loading && !error // No data. - if (delegations.length === 0 && !loading && !error) { + if (delegations.length === 0 && dataReady) { return null } - const onClickDelegation = (delegation: Delegation) => { onSwitchUser(delegation.nationalId) } return ( - <> -
- + + {formatMessage(userMessages.delegationList)} - + + {dataReady && delegations.length > 0 && ( + onSwitchUser(user.profile.nationalId)} + > + {user.profile.name} + + )} {delegations.map((delegation) => ( - {delegation.name || delegation.nationalId} - + ))} {loading ? ( @@ -111,7 +106,10 @@ export const UserDelegations = ({ {formatMessage(userMessages.delegationError)} ) : null} - - + + + + + ) } diff --git a/libs/shared/components/src/auth/UserMenu/UserDropdown.tsx b/libs/shared/components/src/auth/UserMenu/UserDropdown.tsx index 3fcb9dea8d7c..acdd8a6b5ea9 100644 --- a/libs/shared/components/src/auth/UserMenu/UserDropdown.tsx +++ b/libs/shared/components/src/auth/UserMenu/UserDropdown.tsx @@ -1,24 +1,23 @@ import React, { Dispatch, SetStateAction } from 'react' - import { Box, - Button, - Select, Stack, Text, ModalBase, UserAvatar, Icon, GridContainer, - Option, + Divider, } from '@island.is/island-ui/core' -import { Locale, User } from '@island.is/shared/types' +import { User } from '@island.is/shared/types' import { sharedMessages, userMessages } from '@island.is/shared/translations' import { useLocale } from '@island.is/localization' import * as styles from './UserMenu.css' import { UserDelegations } from './UserDelegations' +import { UserDropdownItem } from './UserDropdownItem' import { UserProfileInfo } from './UserProfileInfo' -import { ValueType } from 'react-select' +import { useFeatureFlag } from '@island.is/react/feature-flags' +import * as kennitala from 'kennitala' interface UserDropdownProps { user: User @@ -35,9 +34,8 @@ export const UserDropdown = ({ onSwitchUser, onLogout, }: UserDropdownProps) => { - const { lang, formatMessage, changeLanguage } = useLocale() - const handleLanguageChange = (option: ValueType
- - + + {navChildren?.map((child, index) => ( = ({ type={active ? 'filled' : icon.type} icon={icon.icon} size="medium" - color={'blue400'} + color={'blue600'} /> ) : null} {children} {showChevron && ( - + )} {showLock && ( )} From ef1d4c5fcde1dcfe3824f1977f25b5cf0a31385d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Mon, 13 Dec 2021 10:48:23 +0000 Subject: [PATCH 079/156] fix: wrong tag color on access denied --- .../core/src/screens/AccessDenied/AccessDenied.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/service-portal/core/src/screens/AccessDenied/AccessDenied.tsx b/libs/service-portal/core/src/screens/AccessDenied/AccessDenied.tsx index a525f500fd66..6340e3711087 100644 --- a/libs/service-portal/core/src/screens/AccessDenied/AccessDenied.tsx +++ b/libs/service-portal/core/src/screens/AccessDenied/AccessDenied.tsx @@ -14,8 +14,8 @@ export const AccessDenied: ServicePortalModuleComponent = ({ return ( From 34cc4f3a3570995e8ae0186b2222e8cf7488bdc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Tue, 14 Dec 2021 10:02:45 +0000 Subject: [PATCH 080/156] feat: new collapsed sidebar --- .../components/Sidebar/ModuleNavigation.tsx | 63 +++++++++++-------- .../components/Sidebar/NavItem/NavItem.css.ts | 9 ++- .../components/Sidebar/NavItem/NavItem.tsx | 25 +++++--- .../src/components/Sidebar/NavItem/SubNav.tsx | 41 ++++++++++++ .../src/components/Sidebar/Sidebar.css.ts | 10 ++- .../src/components/Sidebar/Sidebar.tsx | 39 ++++++------ .../src/components/Sidebar/SubNavModal.css.ts | 19 ++++++ .../src/components/Sidebar/SubNavModal.tsx | 26 ++++++++ 8 files changed, 173 insertions(+), 59 deletions(-) create mode 100644 apps/service-portal/src/components/Sidebar/NavItem/SubNav.tsx create mode 100644 apps/service-portal/src/components/Sidebar/SubNavModal.css.ts create mode 100644 apps/service-portal/src/components/Sidebar/SubNavModal.tsx diff --git a/apps/service-portal/src/components/Sidebar/ModuleNavigation.tsx b/apps/service-portal/src/components/Sidebar/ModuleNavigation.tsx index 260c21c6b778..988f62239fa2 100644 --- a/apps/service-portal/src/components/Sidebar/ModuleNavigation.tsx +++ b/apps/service-portal/src/components/Sidebar/ModuleNavigation.tsx @@ -3,14 +3,15 @@ import { ServicePortalNavigationItem, ServicePortalPath, } from '@island.is/service-portal/core' -import * as styles from './Sidebar.css' -import { Box, Divider, Stack, Text } from '@island.is/island-ui/core' +import { Box, Divider, Text } from '@island.is/island-ui/core' import { useLocation } from 'react-router-dom' import AnimateHeight from 'react-animate-height' import { useLocale } from '@island.is/localization' import NavItem from './NavItem/NavItem' -import SubNavItem from './NavItem/SubNavItem' +import SubNavModal from './SubNavModal' import { servicePortalOutboundLink } from '@island.is/plausible' +import { useStore } from '../../store/stateProvider' +import SubNav from './NavItem/SubNav' interface Props { nav: ServicePortalNavigationItem @@ -26,6 +27,9 @@ const ModuleNavigation: FC = ({ badge, }) => { const [expand, setExpand] = useState(false) + const [hover, setHover] = useState(false) + const [{ sidebarState }] = useStore() + const { pathname } = useLocation() const isModuleActive = (nav.path && @@ -47,9 +51,29 @@ const ModuleNavigation: FC = ({ const navChildren = nav?.children?.filter((child) => !child.navHide) const navArray = Array.isArray(navChildren) && navChildren.length > 0 + const collapsed = sidebarState === 'closed' + const displaySubNavModal = navArray && collapsed return ( - + { + collapsed && setHover(true) + }} + onMouseLeave={() => { + collapsed && setHover(false) + }} + > + {displaySubNavModal && ( + + + + )} {nav.heading && ( = ({ { - handleRootItemClick(nav.external) + !collapsed && handleRootItemClick(nav.external) }} alwaysExpanded={alwaysExpanded} badge={badge} > {formatMessage(nav.name)} - {navArray && ( + {!collapsed && navArray && ( -
- - - {navChildren?.map((child, index) => ( - - {formatMessage(child.name)} - - ))} - - -
+
)}
diff --git a/apps/service-portal/src/components/Sidebar/NavItem/NavItem.css.ts b/apps/service-portal/src/components/Sidebar/NavItem/NavItem.css.ts index ecab3136c510..aa59debdaac5 100644 --- a/apps/service-portal/src/components/Sidebar/NavItem/NavItem.css.ts +++ b/apps/service-portal/src/components/Sidebar/NavItem/NavItem.css.ts @@ -9,8 +9,8 @@ export const navItem = style({}) export const navItemActive = styleVariants({ active: { - backgroundColor: '#E0ECFF', - border: '1px solid #E0ECFF', + backgroundColor: theme.color.blue200, + border: `1px solid ${theme.color.blue200}`, borderTopLeftRadius: '8px', borderBottomLeftRadius: '8px', }, @@ -24,6 +24,11 @@ export const navItemActive = styleVariants({ }, }, }, + activeCollapsed: { + backgroundColor: theme.color.blue200, + border: `1px solid ${theme.color.blue200}`, + borderRadius: '8px', + }, }) export const text = style({ diff --git a/apps/service-portal/src/components/Sidebar/NavItem/NavItem.tsx b/apps/service-portal/src/components/Sidebar/NavItem/NavItem.tsx index f66ca32ba9fa..379d83bd8514 100644 --- a/apps/service-portal/src/components/Sidebar/NavItem/NavItem.tsx +++ b/apps/service-portal/src/components/Sidebar/NavItem/NavItem.tsx @@ -3,6 +3,7 @@ import { ServicePortalPath } from '@island.is/service-portal/core' import React, { FC } from 'react' import * as styles from './NavItem.css' import { Link } from 'react-router-dom' +import { useStore } from '../../../store/stateProvider' interface Props { path?: ServicePortalPath @@ -27,11 +28,16 @@ const NavItemContent: FC = ({ alwaysExpanded = false, badge = false, }) => { + const [{ sidebarState }] = useStore() + const collapsed = sidebarState === 'closed' const chevron = active ? 'chevronUp' : 'chevronDown' const showLock = enabled === false - const showChevron = hasArray && !alwaysExpanded && !showLock + const showChevron = + hasArray && !alwaysExpanded && !showLock && sidebarState === 'open' const navItemActive: keyof typeof styles.navItemActive = active - ? 'active' + ? collapsed + ? 'activeCollapsed' + : 'active' : 'inactive' const badgeActive: keyof typeof styles.badge = badge ? 'active' : 'inactive' return ( @@ -39,17 +45,22 @@ const NavItemContent: FC = ({ className={styles.navItemActive[navItemActive]} display="flex" alignItems="center" - justifyContent="spaceBetween" + justifyContent={collapsed ? 'center' : 'spaceBetween'} cursor={showLock ? undefined : 'pointer'} position="relative" onClick={showLock ? (active ? onClick : undefined) : onClick} paddingY={1} - paddingLeft={3} - paddingRight={2} + paddingLeft={collapsed ? 1 : 3} + paddingRight={collapsed ? 1 : 2} > {icon ? ( - + = ({ /> ) : null} - {children} + {!collapsed ? {children} : ''} {showChevron && ( diff --git a/apps/service-portal/src/components/Sidebar/NavItem/SubNav.tsx b/apps/service-portal/src/components/Sidebar/NavItem/SubNav.tsx new file mode 100644 index 000000000000..b4ae5197388f --- /dev/null +++ b/apps/service-portal/src/components/Sidebar/NavItem/SubNav.tsx @@ -0,0 +1,41 @@ +import { Box, Stack } from '@island.is/island-ui/core' +import { useLocale } from '@island.is/localization' +import { ServicePortalNavigationItem } from '@island.is/service-portal/core' +import React, { FC } from 'react' +import SubNavItem from './SubNavItem' +import * as styles from '../Sidebar.css' +interface Props { + navChildren?: ServicePortalNavigationItem[] + pathname?: string + collapsed?: boolean + onClick?: () => void +} + +const SubNav = ({ navChildren, onClick, pathname, collapsed }: Props) => { + const { formatMessage } = useLocale() + + return ( + + + {navChildren?.map((child, index) => ( + onClick} + > + {formatMessage(child.name)} + + ))} + + + ) +} + +export default SubNav diff --git a/apps/service-portal/src/components/Sidebar/Sidebar.css.ts b/apps/service-portal/src/components/Sidebar/Sidebar.css.ts index d51bde07aef2..370b0b980d05 100644 --- a/apps/service-portal/src/components/Sidebar/Sidebar.css.ts +++ b/apps/service-portal/src/components/Sidebar/Sidebar.css.ts @@ -14,21 +14,25 @@ export const sidebar = style({ }) export const collapsed = style({ - left: '-125px', - backgroundColor: theme.color.transparent, + width: 138, }) export const logoCollapsed = style({ display: 'flex', justifyContent: 'flex-end', paddingTop: theme.spacing[3], + marginRight: -22, }) - export const subnav = style({ paddingLeft: 26, borderLeft: `1px solid ${theme.color.blue200}`, }) +export const subnavCollapsed = style({ + padding: 0, + borderLeft: 'none', +}) + export const navIcon = style({ position: 'absolute', right: '-28px', diff --git a/apps/service-portal/src/components/Sidebar/Sidebar.tsx b/apps/service-portal/src/components/Sidebar/Sidebar.tsx index acff9845b471..f91330e43d83 100644 --- a/apps/service-portal/src/components/Sidebar/Sidebar.tsx +++ b/apps/service-portal/src/components/Sidebar/Sidebar.tsx @@ -25,8 +25,8 @@ export const Sidebar: FC<{}> = () => { justifyContent="flexStart" marginBottom={3} background={collapsed ? 'transparent' : 'blue100'} - padding={3} - paddingRight={0} + padding={collapsed ? 6 : 3} + paddingRight={collapsed ? 6 : 0} > = () => { /> - {!collapsed && - navigation.map((rootItem, rootIndex) => ( - - {rootItem.children?.map( - (navRoot, index) => - navRoot.path !== ServicePortalPath.MinarSidurRoot && ( - 0 - } - /> - ), - )} - - ))} + {navigation.map((rootItem, rootIndex) => ( + + {rootItem.children?.map( + (navRoot, index) => + navRoot.path !== ServicePortalPath.MinarSidurRoot && ( + 0 + } + /> + ), + )} + + ))} ) diff --git a/apps/service-portal/src/components/Sidebar/SubNavModal.css.ts b/apps/service-portal/src/components/Sidebar/SubNavModal.css.ts new file mode 100644 index 000000000000..86fad7589c9b --- /dev/null +++ b/apps/service-portal/src/components/Sidebar/SubNavModal.css.ts @@ -0,0 +1,19 @@ +import { style } from '@vanilla-extract/css' +import { theme } from '@island.is/island-ui/theme' + +export const active = style({ + display: 'flex', + position: 'absolute', + top: 0, + left: 28, + width: 220, + height: 'max-content', + zIndex: 10, +}) + +export const inner = style({ + left: 64, + width: 183, + borderRadius: theme.border.radius.standard, + transition: 'all 250ms ease-in-out', +}) diff --git a/apps/service-portal/src/components/Sidebar/SubNavModal.tsx b/apps/service-portal/src/components/Sidebar/SubNavModal.tsx new file mode 100644 index 000000000000..7e36a58afbc1 --- /dev/null +++ b/apps/service-portal/src/components/Sidebar/SubNavModal.tsx @@ -0,0 +1,26 @@ +import { Box } from '@island.is/island-ui/core' +import React from 'react' +import * as styles from './SubNavModal.css' +interface Props { + active: boolean + children: React.ReactNode +} + +const SubNavModal = ({ active, children }: Props) => ( + + + {children} + + +) + +export default SubNavModal From fdc442bd7eaf4c3aab8ddcfaeb01824521bfbad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Tue, 14 Dec 2021 10:50:30 +0000 Subject: [PATCH 081/156] feat: add lock icon to subnav + hide if parent is disabled --- .../components/Sidebar/ModuleNavigation.tsx | 2 +- .../components/Sidebar/NavItem/SubNavItem.tsx | 32 +++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/apps/service-portal/src/components/Sidebar/ModuleNavigation.tsx b/apps/service-portal/src/components/Sidebar/ModuleNavigation.tsx index 988f62239fa2..7a7cb9bbc339 100644 --- a/apps/service-portal/src/components/Sidebar/ModuleNavigation.tsx +++ b/apps/service-portal/src/components/Sidebar/ModuleNavigation.tsx @@ -105,7 +105,7 @@ const ModuleNavigation: FC = ({ > {formatMessage(nav.name)} - {!collapsed && navArray && ( + {!collapsed && navArray && nav.enabled && ( = ({ {children} + {!enabled && ( + + )} ) @@ -48,13 +52,9 @@ const SubNavItem: FC = (props) => {
) : props.path ? ( - props.enabled === false ? ( + - ) : ( - - - - ) + ) : ( ) From 2ed53d578fd6885c9303a661e79d5d14f216fd8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Tue, 14 Dec 2021 11:25:00 +0000 Subject: [PATCH 082/156] fix: position of lock icons --- .../src/components/Sidebar/NavItem/NavItem.css.ts | 4 ++++ .../service-portal/src/components/Sidebar/NavItem/NavItem.tsx | 1 + apps/service-portal/src/components/Sidebar/Sidebar.tsx | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/service-portal/src/components/Sidebar/NavItem/NavItem.css.ts b/apps/service-portal/src/components/Sidebar/NavItem/NavItem.css.ts index aa59debdaac5..10358e2318fa 100644 --- a/apps/service-portal/src/components/Sidebar/NavItem/NavItem.css.ts +++ b/apps/service-portal/src/components/Sidebar/NavItem/NavItem.css.ts @@ -68,3 +68,7 @@ export const badge = styleVariants({ display: 'none', }, }) + +export const lock = style({ + marginRight: 4, +}) diff --git a/apps/service-portal/src/components/Sidebar/NavItem/NavItem.tsx b/apps/service-portal/src/components/Sidebar/NavItem/NavItem.tsx index 379d83bd8514..7b292a6178ac 100644 --- a/apps/service-portal/src/components/Sidebar/NavItem/NavItem.tsx +++ b/apps/service-portal/src/components/Sidebar/NavItem/NavItem.tsx @@ -84,6 +84,7 @@ const NavItemContent: FC = ({ icon={'lockClosed'} size="small" color={'blue600'} + className={styles.lock} /> )} diff --git a/apps/service-portal/src/components/Sidebar/Sidebar.tsx b/apps/service-portal/src/components/Sidebar/Sidebar.tsx index f91330e43d83..d99b3d25882e 100644 --- a/apps/service-portal/src/components/Sidebar/Sidebar.tsx +++ b/apps/service-portal/src/components/Sidebar/Sidebar.tsx @@ -64,7 +64,7 @@ export const Sidebar: FC<{}> = () => { From e879ec150a2e1c00d2a7834a793dbc60a1957188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9E=C3=B3r=C3=B0ur=20Hafli=C3=B0ason?= Date: Tue, 14 Dec 2021 11:33:36 +0000 Subject: [PATCH 083/156] Minor fixes --- apps/service-portal/src/screens/Modules/Modules.tsx | 6 +++++- libs/island-ui/core/src/lib/ActionCard/ActionCard.tsx | 2 +- .../core/src/components/UserInfoLine/UserInfoLine.tsx | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/service-portal/src/screens/Modules/Modules.tsx b/apps/service-portal/src/screens/Modules/Modules.tsx index 42f9d39ca095..e11c083bb138 100644 --- a/apps/service-portal/src/screens/Modules/Modules.tsx +++ b/apps/service-portal/src/screens/Modules/Modules.tsx @@ -44,7 +44,11 @@ const RouteLoader: FC<{ {routes.map((route) => route.enabled === false ? ( - + ) : ( = ({ {eyebrow} - + {heading} {text} diff --git a/libs/service-portal/core/src/components/UserInfoLine/UserInfoLine.tsx b/libs/service-portal/core/src/components/UserInfoLine/UserInfoLine.tsx index ec4f882afd28..b232b52e9dba 100644 --- a/libs/service-portal/core/src/components/UserInfoLine/UserInfoLine.tsx +++ b/libs/service-portal/core/src/components/UserInfoLine/UserInfoLine.tsx @@ -58,7 +58,7 @@ export const UserInfoLine: FC = ({ height="full" overflow="hidden" > - + {formatMessage(label)} From 02e330c23a11d75262b9d2e547b228385dbe6099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Tue, 14 Dec 2021 11:34:39 +0000 Subject: [PATCH 084/156] fix: subitems +1 pixel .... --- .../src/components/Sidebar/NavItem/NavItem.css.ts | 4 ++++ .../src/components/Sidebar/NavItem/SubNavItem.tsx | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/service-portal/src/components/Sidebar/NavItem/NavItem.css.ts b/apps/service-portal/src/components/Sidebar/NavItem/NavItem.css.ts index 10358e2318fa..f35ad263a709 100644 --- a/apps/service-portal/src/components/Sidebar/NavItem/NavItem.css.ts +++ b/apps/service-portal/src/components/Sidebar/NavItem/NavItem.css.ts @@ -72,3 +72,7 @@ export const badge = styleVariants({ export const lock = style({ marginRight: 4, }) + +export const subLock = style({ + marginRight: 5, +}) diff --git a/apps/service-portal/src/components/Sidebar/NavItem/SubNavItem.tsx b/apps/service-portal/src/components/Sidebar/NavItem/SubNavItem.tsx index 9a5216175088..0437a17584f4 100644 --- a/apps/service-portal/src/components/Sidebar/NavItem/SubNavItem.tsx +++ b/apps/service-portal/src/components/Sidebar/NavItem/SubNavItem.tsx @@ -2,7 +2,7 @@ import { Box, Icon, Text } from '@island.is/island-ui/core' import { ServicePortalPath } from '@island.is/service-portal/core' import React, { FC } from 'react' import { Link } from 'react-router-dom' - +import * as styles from '../NavItem/NavItem.css' interface Props { path?: ServicePortalPath active: boolean @@ -41,6 +41,7 @@ const SubNavItemContent: FC = ({ icon={'lockClosed'} size="small" color={'blue600'} + className={styles.subLock} /> )} From 1bce62075e261b69c4add2fa3c5111df6a39e2ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Tue, 14 Dec 2021 11:49:12 +0000 Subject: [PATCH 085/156] refactor: xs for Datepicker components --- .../document-provider/src/components/Forms/StatisticForm.tsx | 2 ++ .../src/screens/DocumentProviders/DocumentProviders.tsx | 2 ++ .../screens/SingleDocumentProvider/SingleDocumentProvider.tsx | 2 ++ .../endorsements/src/screens/ViewPetition/ViewPetition.tsx | 2 ++ .../src/screens/ViewPetitionAdmin/ViewPetitionAdmin.tsx | 2 ++ .../src/screens/Access/components/AccessItem/AccessItem.tsx | 2 +- 6 files changed, 11 insertions(+), 1 deletion(-) diff --git a/libs/service-portal/document-provider/src/components/Forms/StatisticForm.tsx b/libs/service-portal/document-provider/src/components/Forms/StatisticForm.tsx index 86bce6358112..7e720d515cac 100644 --- a/libs/service-portal/document-provider/src/components/Forms/StatisticForm.tsx +++ b/libs/service-portal/document-provider/src/components/Forms/StatisticForm.tsx @@ -125,6 +125,7 @@ export const StatisticForm: FC = ({ onSubmit }) => { selected={value} locale="is" handleChange={onChange} + size="xs" /> )} /> @@ -143,6 +144,7 @@ export const StatisticForm: FC = ({ onSubmit }) => { selected={value} locale="is" handleChange={onChange} + size="xs" /> )} /> diff --git a/libs/service-portal/document-provider/src/screens/DocumentProviders/DocumentProviders.tsx b/libs/service-portal/document-provider/src/screens/DocumentProviders/DocumentProviders.tsx index b1c6bdc645ab..dd5c851fd9ae 100644 --- a/libs/service-portal/document-provider/src/screens/DocumentProviders/DocumentProviders.tsx +++ b/libs/service-portal/document-provider/src/screens/DocumentProviders/DocumentProviders.tsx @@ -65,6 +65,7 @@ const DocumentProviders: ServicePortalModuleComponent = () => { minYear={2011} maxYear={today.getFullYear()} handleChange={(date: Date) => setFromDate(date)} + size="xs" /> @@ -84,6 +85,7 @@ const DocumentProviders: ServicePortalModuleComponent = () => { errorMessage={formatMessage( m.documentProvidersDateToErrorMessage, )} + size="xs" /> diff --git a/libs/service-portal/document-provider/src/screens/SingleDocumentProvider/SingleDocumentProvider.tsx b/libs/service-portal/document-provider/src/screens/SingleDocumentProvider/SingleDocumentProvider.tsx index 95a930b1605c..5fcad57ee611 100644 --- a/libs/service-portal/document-provider/src/screens/SingleDocumentProvider/SingleDocumentProvider.tsx +++ b/libs/service-portal/document-provider/src/screens/SingleDocumentProvider/SingleDocumentProvider.tsx @@ -70,6 +70,7 @@ const SingleDocumentProvider: ServicePortalModuleComponent = ({ userInfo }) => { minYear={2011} maxYear={today.getFullYear()} handleChange={(date: Date) => setFromDate(date)} + size="xs" /> @@ -89,6 +90,7 @@ const SingleDocumentProvider: ServicePortalModuleComponent = ({ userInfo }) => { errorMessage={formatMessage( m.documentProvidersDateToErrorMessage, )} + size="xs" /> diff --git a/libs/service-portal/endorsements/src/screens/ViewPetition/ViewPetition.tsx b/libs/service-portal/endorsements/src/screens/ViewPetition/ViewPetition.tsx index 87eb9ed2fc77..9e94e69031b7 100644 --- a/libs/service-portal/endorsements/src/screens/ViewPetition/ViewPetition.tsx +++ b/libs/service-portal/endorsements/src/screens/ViewPetition/ViewPetition.tsx @@ -252,6 +252,7 @@ const ViewPetition = () => { { handleChange={(date) => setSelectedDateToOpenList(date) } + size="xs" /> { label="Tímabil frá" locale="is" placeholderText="Veldu dagsetningu" + size="xs" /> @@ -167,6 +168,7 @@ const ViewPetitionAdmin = () => { label="Tímabil til" locale="is" placeholderText="Veldu dagsetningu" + size="xs" /> diff --git a/libs/service-portal/settings/access-control/src/screens/Access/components/AccessItem/AccessItem.tsx b/libs/service-portal/settings/access-control/src/screens/Access/components/AccessItem/AccessItem.tsx index 1b02f7dc0d96..193001507627 100644 --- a/libs/service-portal/settings/access-control/src/screens/Access/components/AccessItem/AccessItem.tsx +++ b/libs/service-portal/settings/access-control/src/screens/Access/components/AccessItem/AccessItem.tsx @@ -141,7 +141,7 @@ function AccessItem({ apiScopes, authDelegation }: PropTypes) {
Date: Tue, 14 Dec 2021 11:56:45 +0000 Subject: [PATCH 086/156] refactor: xs for Input & InputController components --- .../src/screens/SingleDocumentProvider/DocumentProviderInput.tsx | 1 + .../src/screens/ViewPetitionAdmin/ViewPetitionAdmin.tsx | 1 + .../src/components/Forms/PhoneForm/Steps/FormStep.tsx | 1 + .../src/components/UserOnboardingModal/Islykill/PhoneForm.tsx | 1 + 4 files changed, 4 insertions(+) diff --git a/libs/service-portal/document-provider/src/screens/SingleDocumentProvider/DocumentProviderInput.tsx b/libs/service-portal/document-provider/src/screens/SingleDocumentProvider/DocumentProviderInput.tsx index 12039aeeb1ac..bff87a3339bc 100644 --- a/libs/service-portal/document-provider/src/screens/SingleDocumentProvider/DocumentProviderInput.tsx +++ b/libs/service-portal/document-provider/src/screens/SingleDocumentProvider/DocumentProviderInput.tsx @@ -59,6 +59,7 @@ export const DocumentProviderInput: FC = ({ placeholder={placeholder} hasError={hasError} errorMessage={errorMessage} + size="xs" /> )} /> diff --git a/libs/service-portal/endorsements/src/screens/ViewPetitionAdmin/ViewPetitionAdmin.tsx b/libs/service-portal/endorsements/src/screens/ViewPetitionAdmin/ViewPetitionAdmin.tsx index 216b80c9fdb6..985d95f91a66 100644 --- a/libs/service-portal/endorsements/src/screens/ViewPetitionAdmin/ViewPetitionAdmin.tsx +++ b/libs/service-portal/endorsements/src/screens/ViewPetitionAdmin/ViewPetitionAdmin.tsx @@ -137,6 +137,7 @@ const ViewPetitionAdmin = () => { setTitle(e.target.value) }} label={formatMessage(m.viewPetition.listTitleHeader)} + size="xs" /> = ({ }} label={formatMessage(sharedMessages.phoneNumber)} error={errors.tel?.message} + size="xs" /> = ({ }} label={formatMessage(sharedMessages.phoneNumber)} error={errors.tel?.message} + size="xs" /> {(renderBackButton || renderSubmitButton) && ( From 26e199169d46824b998671c7c533cd3f1e354923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Tue, 14 Dec 2021 11:57:13 +0000 Subject: [PATCH 087/156] refactor: xs for Select component --- .../document-provider/src/components/Forms/StatisticForm.tsx | 2 ++ .../src/components/StatisticsSearch/StatisticsSearch.tsx | 2 ++ .../src/components/EditForm/EditForm.tsx | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/service-portal/document-provider/src/components/Forms/StatisticForm.tsx b/libs/service-portal/document-provider/src/components/Forms/StatisticForm.tsx index 7e720d515cac..44f95fed0fc5 100644 --- a/libs/service-portal/document-provider/src/components/Forms/StatisticForm.tsx +++ b/libs/service-portal/document-provider/src/components/Forms/StatisticForm.tsx @@ -81,6 +81,7 @@ export const StatisticForm: FC = ({ onSubmit }) => { { label: 'Fjármál', value: 'fjarmal' }, { label: 'Annað', value: 'annad' }, ]} + size="xs" /> )} /> @@ -104,6 +105,7 @@ export const StatisticForm: FC = ({ onSubmit }) => { { label: 'Greiðsluseðill', value: 'greidslusedill' }, { label: 'Tilkynning', value: 'tilkynning' }, ]} + size="xs" /> )} /> diff --git a/libs/service-portal/document-provider/src/components/StatisticsSearch/StatisticsSearch.tsx b/libs/service-portal/document-provider/src/components/StatisticsSearch/StatisticsSearch.tsx index aa6707f5b9a8..b09faf327ddd 100644 --- a/libs/service-portal/document-provider/src/components/StatisticsSearch/StatisticsSearch.tsx +++ b/libs/service-portal/document-provider/src/components/StatisticsSearch/StatisticsSearch.tsx @@ -69,6 +69,7 @@ export const StatisticsSearch = () => { { label: 'Fjármál', value: 'fjarmal' }, { label: 'Annað', value: 'annad' }, ]} + size="xs" /> @@ -86,6 +87,7 @@ export const StatisticsSearch = () => { { label: 'Fjármál', value: 'fjarmal' }, { label: 'Annað', value: 'annad' }, ]} + size="xs" /> diff --git a/libs/service-portal/icelandic-names-registry/src/components/EditForm/EditForm.tsx b/libs/service-portal/icelandic-names-registry/src/components/EditForm/EditForm.tsx index fadb65694562..672bc073b8ea 100644 --- a/libs/service-portal/icelandic-names-registry/src/components/EditForm/EditForm.tsx +++ b/libs/service-portal/icelandic-names-registry/src/components/EditForm/EditForm.tsx @@ -175,7 +175,7 @@ const EditForm: React.FC = ({ onChange={(option) => onChange(String((option as Option).value)) } - size="sm" + size="xs" hasError={Boolean(errors?.type?.message)} errorMessage={errors?.type?.message} backgroundColor="blue" @@ -205,7 +205,7 @@ const EditForm: React.FC = ({ onChange={(option) => onChange(String((option as Option).value)) } - size="sm" + size="xs" hasError={Boolean(errors?.status?.message)} errorMessage={errors?.status?.message} backgroundColor="blue" From 9626196083bf085cfc9639a6ed033790184a6186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Wed, 15 Dec 2021 08:52:00 +0000 Subject: [PATCH 088/156] refactor: add text medium and force styling on table --- .../assets/src/components/AssetGrid/index.tsx | 21 +++++---- .../src/components/TableUnits/index.tsx | 14 +++--- libs/service-portal/core/src/utils/utils.ts | 5 +++ .../DocumentLine/DocumentLine.css.ts | 7 +-- .../components/DocumentLine/DocumentLine.tsx | 10 ++--- .../src/screens/Overview/Overview.tsx | 6 +-- .../StudentAssessmentTable.tsx | 2 +- .../DocumentScreen/DocumentScreen.tsx | 45 +++++++++++-------- .../DropdownExport/DropdownExport.css.ts | 2 +- .../src/components/ExpandableTable/Header.tsx | 7 ++- .../src/components/ExpandableTable/Row.tsx | 7 ++- .../FinanceStatusDetailTable.tsx | 38 +++++++++++----- .../FinanceTransactionsDetail.tsx | 4 +- .../components/AccessItem/AccessItem.tsx | 6 ++- 14 files changed, 107 insertions(+), 67 deletions(-) diff --git a/libs/service-portal/assets/src/components/AssetGrid/index.tsx b/libs/service-portal/assets/src/components/AssetGrid/index.tsx index b3eff2354758..9d6ce7955dff 100644 --- a/libs/service-portal/assets/src/components/AssetGrid/index.tsx +++ b/libs/service-portal/assets/src/components/AssetGrid/index.tsx @@ -14,7 +14,7 @@ import { import { unitsArray } from '../../utils/createUnits' import { GET_UNITS_OF_USE_QUERY } from '../../lib/queries' import { DEFAULT_PAGING_ITEMS } from '../../utils/const' - +import { tableStyles } from '@island.is/service-portal/core' interface Props { units: UnitsOfUseModel locationData?: PropertyLocation | null @@ -85,11 +85,11 @@ const AssetGrid: FC = ({ title, units, assetId, locationData }) => { > - - + + {table?.header?.title} {' '} - + {table.header.value} @@ -99,19 +99,24 @@ const AssetGrid: FC = ({ title, units, assetId, locationData }) => { {table.rows.map((row, ii) => ( {row.map((rowitem, iii) => ( - + {rowitem.title} - + {rowitem.value} @@ -130,7 +135,7 @@ const AssetGrid: FC = ({ title, units, assetId, locationData }) => { justifyContent="center" display="flex" > - diff --git a/libs/service-portal/assets/src/components/TableUnits/index.tsx b/libs/service-portal/assets/src/components/TableUnits/index.tsx index d954dc273d18..8fea29ae2995 100644 --- a/libs/service-portal/assets/src/components/TableUnits/index.tsx +++ b/libs/service-portal/assets/src/components/TableUnits/index.tsx @@ -1,5 +1,5 @@ import React, { FC } from 'react' -import { m } from '@island.is/service-portal/core' +import { m, tableStyles } from '@island.is/service-portal/core' import { useLocale } from '@island.is/localization' import { Text, Box, Button, Table as T } from '@island.is/island-ui/core' @@ -36,8 +36,10 @@ const TableUnits: FC = ({ tables, title, paginateCallback }) => { {table.header.map((header, ii) => ( - - {header} + + + {header} + ))} @@ -46,13 +48,15 @@ const TableUnits: FC = ({ tables, title, paginateCallback }) => { {table.rows.map((row, iii) => ( {row.map((rowitem, iiii) => ( - {rowitem} + + {rowitem} + ))} ))} {table.paginate ? ( - + { return nationalId } } + +export const tableStyles = { + paddingTop: '16px', + paddingBottom: '16px', +} diff --git a/libs/service-portal/documents/src/components/DocumentLine/DocumentLine.css.ts b/libs/service-portal/documents/src/components/DocumentLine/DocumentLine.css.ts index 2df07950b329..3ea4ea85dec8 100644 --- a/libs/service-portal/documents/src/components/DocumentLine/DocumentLine.css.ts +++ b/libs/service-portal/documents/src/components/DocumentLine/DocumentLine.css.ts @@ -23,9 +23,9 @@ export const line = style({ export const button = style({ color: theme.color.blue400, - fontSize: theme.typography.baseFontSize, + fontSize: 16, fontWeight: theme.typography.regular, - lineHeight: 1.75, + lineHeight: 1.5, textAlign: 'left', ':hover': { textDecoration: 'underline', @@ -51,9 +51,6 @@ export const sender = style({ }) export const date = style({ - fontWeight: theme.typography.regular, - fontSize: theme.typography.baseFontSize, - color: theme.color.dark300, ...themeUtils.responsiveStyle({ sm: { paddingBottom: 0, diff --git a/libs/service-portal/documents/src/components/DocumentLine/DocumentLine.tsx b/libs/service-portal/documents/src/components/DocumentLine/DocumentLine.tsx index 55e4330c044e..5dc7d68e6f95 100644 --- a/libs/service-portal/documents/src/components/DocumentLine/DocumentLine.tsx +++ b/libs/service-portal/documents/src/components/DocumentLine/DocumentLine.tsx @@ -60,11 +60,10 @@ const DocumentLine: FC = ({ documentLine, userInfo, img }) => { display="flex" alignItems="center" justifyContent={['flexEnd', 'flexStart']} - height="full" paddingX={[0, 2]} - marginBottom={1} + paddingY={2} > - + {format(new Date(documentLine.date), dateFormat.is)} @@ -119,11 +118,10 @@ const DocumentLine: FC = ({ documentLine, userInfo, img }) => { alignItems="center" height="full" paddingX={[0, 2]} + paddingY={2} overflow="hidden" > - - {documentLine.senderName} - + {documentLine.senderName} diff --git a/libs/service-portal/documents/src/screens/Overview/Overview.tsx b/libs/service-portal/documents/src/screens/Overview/Overview.tsx index 99c772a80302..0ab616a78888 100644 --- a/libs/service-portal/documents/src/screens/Overview/Overview.tsx +++ b/libs/service-portal/documents/src/screens/Overview/Overview.tsx @@ -340,7 +340,7 @@ export const ServicePortalDocuments: ServicePortalModuleComponent = ({ - + {formatMessage({ id: 'sp.documents:table-header-date', defaultMessage: 'Dagsetning', @@ -350,7 +350,7 @@ export const ServicePortalDocuments: ServicePortalModuleComponent = ({ - + {formatMessage({ id: 'sp.documents:table-header-information', defaultMessage: 'Upplýsingar', @@ -360,7 +360,7 @@ export const ServicePortalDocuments: ServicePortalModuleComponent = ({ - + {formatMessage({ id: 'sp.documents:table-header-institution', defaultMessage: 'Stofnun', diff --git a/libs/service-portal/education-student-assessment/src/screens/EducationStudentAssessment/components/StudentAssessmentTable/StudentAssessmentTable.tsx b/libs/service-portal/education-student-assessment/src/screens/EducationStudentAssessment/components/StudentAssessmentTable/StudentAssessmentTable.tsx index cd751ce0c791..90a769767f1c 100644 --- a/libs/service-portal/education-student-assessment/src/screens/EducationStudentAssessment/components/StudentAssessmentTable/StudentAssessmentTable.tsx +++ b/libs/service-portal/education-student-assessment/src/screens/EducationStudentAssessment/components/StudentAssessmentTable/StudentAssessmentTable.tsx @@ -108,7 +108,7 @@ const StudentAssessmentTable = () => { )} {data?.educationExamResult.grades.map((studentAssessment, index) => ( - + Samræmd könnunarpróf {studentAssessment.studentYear}. bekkur diff --git a/libs/service-portal/finance/src/components/DocumentScreen/DocumentScreen.tsx b/libs/service-portal/finance/src/components/DocumentScreen/DocumentScreen.tsx index 4d4c2b41c425..a5c3f5b3760f 100644 --- a/libs/service-portal/finance/src/components/DocumentScreen/DocumentScreen.tsx +++ b/libs/service-portal/finance/src/components/DocumentScreen/DocumentScreen.tsx @@ -27,6 +27,7 @@ import amountFormat from '../../utils/amountFormat' import { billsFilter } from '../../utils/simpleFilter' import { formSubmit } from '../../utils/documentFormSubmission' import { User } from 'oidc-client' +import { tableStyles } from '@island.is/service-portal/core' const ITEMS_ON_PAGE = 20 @@ -215,28 +216,28 @@ const DocumentScreen: FC = ({ - - + + {formatMessage(m.date)} - - + + {formatMessage(m.transactionType)} - - + + {formatMessage(m.performingOrganization)} - - + + {formatMessage(m.amount)} - - + + {formatMessage(m.explanationNote)} @@ -247,14 +248,18 @@ const DocumentScreen: FC = ({ .slice(ITEMS_ON_PAGE * (page - 1), ITEMS_ON_PAGE * page) .map((listItem) => ( - - + + {format(new Date(listItem.date), dateFormat.is)} - + - + {' '} - {listItem.sender} + {listItem.sender} - - {amountFormat(listItem.amount)} + + + {amountFormat(listItem.amount)} + - - {listItem.note} + + {listItem.note} ))} diff --git a/libs/service-portal/finance/src/components/DropdownExport/DropdownExport.css.ts b/libs/service-portal/finance/src/components/DropdownExport/DropdownExport.css.ts index 28ef11b55f04..e7166abb0630 100644 --- a/libs/service-portal/finance/src/components/DropdownExport/DropdownExport.css.ts +++ b/libs/service-portal/finance/src/components/DropdownExport/DropdownExport.css.ts @@ -15,7 +15,7 @@ export const disabledItem = style({ paddingTop: theme.spacing[2], paddingBottom: theme.spacing[2], width: 'full', - fontSize: 14, + fontSize: 16, lineHeight: 1.5, fontWeight: 600, color: theme.color.blue300, diff --git a/libs/service-portal/finance/src/components/ExpandableTable/Header.tsx b/libs/service-portal/finance/src/components/ExpandableTable/Header.tsx index 3e195d84e911..0847df2a07f9 100644 --- a/libs/service-portal/finance/src/components/ExpandableTable/Header.tsx +++ b/libs/service-portal/finance/src/components/ExpandableTable/Header.tsx @@ -2,7 +2,7 @@ import React, { FC } from 'react' import { Text } from '@island.is/island-ui/core' import { Table as T } from '@island.is/island-ui/core' - +import { tableStyles } from '@island.is/service-portal/core' interface Props { data: Array<{ value: string; align?: 'left' | 'right' }> } @@ -16,8 +16,11 @@ const ExpandableLine: FC = ({ data }) => { box={item.align ? { textAlign: item.align } : undefined} scope="col" key={i} + style={tableStyles} > - {item.value} + + {item.value} + ))} diff --git a/libs/service-portal/finance/src/components/ExpandableTable/Row.tsx b/libs/service-portal/finance/src/components/ExpandableTable/Row.tsx index 9f784394d3af..b09d7d8403f6 100644 --- a/libs/service-portal/finance/src/components/ExpandableTable/Row.tsx +++ b/libs/service-portal/finance/src/components/ExpandableTable/Row.tsx @@ -12,6 +12,7 @@ import { } from '@island.is/island-ui/core' import { m } from '@island.is/service-portal/core' import * as styles from './ExpandableTable.css' +import { tableStyles } from '@island.is/service-portal/core' interface Props { data: Array<{ value: string | number; align?: 'left' | 'right' }> @@ -60,11 +61,12 @@ const ExpandableLine: FC = ({ borderColor: fullClose || loading ? 'blue200' : 'blue100', position: 'relative', }} + style={tableStyles} > {!fullClose && i === 0 && !loading ? (
) : null} - +
= ({ borderColor: fullClose || loading ? 'blue200' : 'blue100', printHidden: true, }} + style={tableStyles} > {!last && !loading && ( = ({ > diff --git a/libs/service-portal/finance/src/components/FinanceStatusDetailTable/FinanceStatusDetailTable.tsx b/libs/service-portal/finance/src/components/FinanceStatusDetailTable/FinanceStatusDetailTable.tsx index 2214bdfe2a25..ee3471f44541 100644 --- a/libs/service-portal/finance/src/components/FinanceStatusDetailTable/FinanceStatusDetailTable.tsx +++ b/libs/service-portal/finance/src/components/FinanceStatusDetailTable/FinanceStatusDetailTable.tsx @@ -13,7 +13,7 @@ import { useLocale } from '@island.is/localization' import { m } from '@island.is/service-portal/core' import cn from 'classnames' import * as styles from './FinanceStatusDetailTable.css' - +import { tableStyles } from '@island.is/service-portal/core' interface Props { organization: FinanceStatusOrganizationType financeStatusDetails: FinanceStatusDetailsType @@ -55,8 +55,11 @@ const FinanceStatusDetailTable: FC = ({ }} key={i} text={{ truncate: true }} + style={tableStyles} > - {item.value} + + {item.value} + ))} @@ -83,6 +86,7 @@ const FinanceStatusDetailTable: FC = ({ position: 'relative', }} key={ii} + style={tableStyles} > ) : ( - +
- {item.value} + {item.value}
), @@ -115,19 +123,23 @@ const FinanceStatusDetailTable: FC = ({ - {formatMessage(m.contactInfo)} + + {formatMessage(m.contactInfo)} + {organization.homepage && ( - {formatMessage(m.website)}:{' '} + + {formatMessage(m.website)}: + {' '} - + {organization.homepage} @@ -135,13 +147,15 @@ const FinanceStatusDetailTable: FC = ({ )} {organization.email && ( - {formatMessage(m.email)}:{' '} + + {formatMessage(m.email)}: + {' '} - + {organization.email} @@ -149,13 +163,15 @@ const FinanceStatusDetailTable: FC = ({ )} {organization.phone && ( - {formatMessage(m.phone)}:{' '} + + {formatMessage(m.phone)}: + {' '} - + {organization.phone} diff --git a/libs/service-portal/finance/src/components/FinanceTransactionsDetail/FinanceTransactionsDetail.tsx b/libs/service-portal/finance/src/components/FinanceTransactionsDetail/FinanceTransactionsDetail.tsx index 5ad8c29fcb41..83df0b54d9d4 100644 --- a/libs/service-portal/finance/src/components/FinanceTransactionsDetail/FinanceTransactionsDetail.tsx +++ b/libs/service-portal/finance/src/components/FinanceTransactionsDetail/FinanceTransactionsDetail.tsx @@ -20,12 +20,12 @@ const FinanceTransactionsDetail: FC = ({ data }) => { {data.map((item, i) => ( - + {item.title} - + {item.value} diff --git a/libs/service-portal/settings/access-control/src/screens/Access/components/AccessItem/AccessItem.tsx b/libs/service-portal/settings/access-control/src/screens/Access/components/AccessItem/AccessItem.tsx index 193001507627..7aaa0e94401a 100644 --- a/libs/service-portal/settings/access-control/src/screens/Access/components/AccessItem/AccessItem.tsx +++ b/libs/service-portal/settings/access-control/src/screens/Access/components/AccessItem/AccessItem.tsx @@ -12,6 +12,7 @@ import { useLocale } from '@island.is/localization' import type { Scope } from '../../Access' import * as styles from './AccessItem.css' +import { tableStyles } from '@island.is/service-portal/core' type TableDataProps = React.ComponentProps @@ -117,6 +118,7 @@ function AccessItem({ apiScopes, authDelegation }: PropTypes) { ...tdStyling, paddingLeft: isFirstItem ? 3 : 8, }} + style={tableStyles} > onSelect(item, value)} />
- + {item.description} - +
Date: Wed, 15 Dec 2021 08:59:51 +0000 Subject: [PATCH 089/156] feat: add missing tag variant mint --- libs/island-ui/core/src/lib/Tag/Tag.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/island-ui/core/src/lib/Tag/Tag.tsx b/libs/island-ui/core/src/lib/Tag/Tag.tsx index 4052fde0d86d..b8ba075f2832 100644 --- a/libs/island-ui/core/src/lib/Tag/Tag.tsx +++ b/libs/island-ui/core/src/lib/Tag/Tag.tsx @@ -14,6 +14,7 @@ export type TagVariant = | 'rose' | 'blueberry' | 'dark' + | 'mint' export interface TagProps { onClick?: () => void From cd9e2b066b2d685e492dbfdbc5a0e968627b4055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Wed, 15 Dec 2021 09:01:13 +0000 Subject: [PATCH 090/156] feat: add stories for Action Card using small heading --- .../core/src/lib/ActionCard/ActionCard.stories.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libs/island-ui/core/src/lib/ActionCard/ActionCard.stories.tsx b/libs/island-ui/core/src/lib/ActionCard/ActionCard.stories.tsx index 1b9e61ffd5d5..6946a3136f3e 100644 --- a/libs/island-ui/core/src/lib/ActionCard/ActionCard.stories.tsx +++ b/libs/island-ui/core/src/lib/ActionCard/ActionCard.stories.tsx @@ -15,6 +15,15 @@ export const Default = () => ( /> ) +export const SmallHeading = () => ( + +) + export const Unavailable = () => ( Date: Wed, 15 Dec 2021 09:05:28 +0000 Subject: [PATCH 091/156] feat: add stories for input --- libs/island-ui/core/src/lib/Input/Input.stories.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libs/island-ui/core/src/lib/Input/Input.stories.tsx b/libs/island-ui/core/src/lib/Input/Input.stories.tsx index 19f9ace3bd7e..1daa2476af19 100644 --- a/libs/island-ui/core/src/lib/Input/Input.stories.tsx +++ b/libs/island-ui/core/src/lib/Input/Input.stories.tsx @@ -90,3 +90,11 @@ ResponsiveBackgroundColor.args = { name: 'Test9', backgroundColor: ['white', 'blue', 'white', 'blue', 'white'], } + +export const WithLabelAbove = Template.bind({}) +WithLabelAbove.args = { + label: 'This is the above label', + placeholder: 'This is the placeholder', + name: 'Test10', + size: 'xs', +} From 53ec900fe33fb3f868b5aeaf2a8e10cd1bec6eda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Wed, 15 Dec 2021 09:07:30 +0000 Subject: [PATCH 092/156] feat: add stories to Select --- .../core/src/lib/Select/Select.stories.tsx | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/libs/island-ui/core/src/lib/Select/Select.stories.tsx b/libs/island-ui/core/src/lib/Select/Select.stories.tsx index 33c5e2e878f6..e74331a57fc5 100644 --- a/libs/island-ui/core/src/lib/Select/Select.stories.tsx +++ b/libs/island-ui/core/src/lib/Select/Select.stories.tsx @@ -33,6 +33,29 @@ Default.args = { noOptionsMessage: 'Enginn valmöguleiki', } +export const WithLabelAbove = Template.bind({}) +WithLabelAbove.args = { + name: 'select2', + label: 'Tegund valmöguleiga', + placeholder: 'Veldu tegund', + options: [ + { + label: 'Valmöguleiki 1', + value: '0', + }, + { + label: 'Valmöguleiki 2', + value: '1', + }, + { + label: 'Valmöguleiki 3', + value: '2', + }, + ], + noOptionsMessage: 'Enginn valmöguleiki', + size: 'xs', +} + export const TempTest = () => (

WIP

From dfaf6347bd8d89cc46c2ffd2a92f3f664046fe56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Wed, 15 Dec 2021 09:11:07 +0000 Subject: [PATCH 093/156] feat: add stories for DatePicker --- .../core/src/lib/DatePicker/DatePicker.stories.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libs/island-ui/core/src/lib/DatePicker/DatePicker.stories.tsx b/libs/island-ui/core/src/lib/DatePicker/DatePicker.stories.tsx index da085ad70091..92df3390f306 100644 --- a/libs/island-ui/core/src/lib/DatePicker/DatePicker.stories.tsx +++ b/libs/island-ui/core/src/lib/DatePicker/DatePicker.stories.tsx @@ -126,6 +126,19 @@ export const SizeSmall = () => { ) } +export const SizeExtraSmall = () => { + return ( +
+ console.log(date)} + /> +
+ ) +} + export const WithErrors = () => ( <> From 8a1bac56ffc83f6d23cbe3fc1664b7835a3f14a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Wed, 15 Dec 2021 11:59:02 +0000 Subject: [PATCH 094/156] refactor: cleanup --- .../src/components/Header/Header.css.ts | 8 ------ .../src/components/Header/Header.tsx | 8 +++++- .../src/lib/ActionCard/ActionCard.stories.tsx | 2 +- .../components/UserInfoLine/UserInfoLine.tsx | 2 +- .../DocumentScreen/DocumentScreen.tsx | 1 - .../src/auth/UserMenu/UserDropdown.tsx | 28 ++----------------- 6 files changed, 11 insertions(+), 38 deletions(-) diff --git a/apps/service-portal/src/components/Header/Header.css.ts b/apps/service-portal/src/components/Header/Header.css.ts index ed77e579abaa..97ab0b478254 100644 --- a/apps/service-portal/src/components/Header/Header.css.ts +++ b/apps/service-portal/src/components/Header/Header.css.ts @@ -23,14 +23,6 @@ export const header = style({ }, }) -export const headerWrapper = style({ - justifyContent: 'space-between', - '@media': { - [`screen and (min-width: ${theme.breakpoints.lg}px)`]: { - justifyContent: 'flex-end', - }, - }, -}) export const placeholder = style({ height: SERVICE_PORTAL_HEADER_HEIGHT_SM, '@media': { diff --git a/apps/service-portal/src/components/Header/Header.tsx b/apps/service-portal/src/components/Header/Header.tsx index ed0a514656cd..860c5f73fdbd 100644 --- a/apps/service-portal/src/components/Header/Header.tsx +++ b/apps/service-portal/src/components/Header/Header.tsx @@ -32,8 +32,14 @@ export const Header: FC<{}> = () => {
( export const SmallHeading = () => ( = ({ const { formatMessage } = useLocale() return ( - + = ({ - {' '} {listItem.sender} diff --git a/libs/shared/components/src/auth/UserMenu/UserDropdown.tsx b/libs/shared/components/src/auth/UserMenu/UserDropdown.tsx index 7f4d096e43d0..6aa83f8a38df 100644 --- a/libs/shared/components/src/auth/UserMenu/UserDropdown.tsx +++ b/libs/shared/components/src/auth/UserMenu/UserDropdown.tsx @@ -8,18 +8,15 @@ import { Icon, GridContainer, Divider, - Option, } from '@island.is/island-ui/core' -import { User, Locale } from '@island.is/shared/types' +import { User } from '@island.is/shared/types' import { sharedMessages, userMessages } from '@island.is/shared/translations' import { useLocale } from '@island.is/localization' -import { useUpdateUserProfileMutation } from '../../../gen/graphql' import * as styles from './UserMenu.css' import { UserDelegations } from './UserDelegations' import { UserDropdownItem } from './UserDropdownItem' import { UserProfileInfo } from './UserProfileInfo' import * as kennitala from 'kennitala' -import { ValueType } from 'react-select' import { Features, useFeatureFlag } from '@island.is/react/feature-flags' import { useActorDelegationsQuery } from '../../../gen/graphql' import { QueryResult } from '@apollo/client' @@ -39,33 +36,12 @@ export const UserDropdown = ({ onSwitchUser, onLogout, }: UserDropdownProps) => { - const { lang, formatMessage, changeLanguage } = useLocale() + const { formatMessage } = useLocale() const isVisible = dropdownState === 'open' const onClose = () => { setDropdownState('closed') } - const [updateUserProfileMutation] = useUpdateUserProfileMutation() - - // const handleLanguageChange = async (option: ValueType - + {`skrautmynd ) diff --git a/libs/service-portal/core/src/components/EducationCard/EducationCard.tsx b/libs/service-portal/core/src/components/EducationCard/EducationCard.tsx index 0d1cb9ad5313..d3d882a7bfb1 100644 --- a/libs/service-portal/core/src/components/EducationCard/EducationCard.tsx +++ b/libs/service-portal/core/src/components/EducationCard/EducationCard.tsx @@ -30,7 +30,13 @@ export const EducationCard = ({ borderRadius="large" > - {img && } + {img && ( + {`skrautmynd + )} {imgPlaceholder && !img && ( - + {`skrautmynd diff --git a/libs/service-portal/core/src/screens/NavigationOverviewScreen/NavigationOverviewScreen.tsx b/libs/service-portal/core/src/screens/NavigationOverviewScreen/NavigationOverviewScreen.tsx index 0e1faeb7a23a..b804fc9595bc 100644 --- a/libs/service-portal/core/src/screens/NavigationOverviewScreen/NavigationOverviewScreen.tsx +++ b/libs/service-portal/core/src/screens/NavigationOverviewScreen/NavigationOverviewScreen.tsx @@ -62,7 +62,7 @@ export const NavigationOverviewScreen: FC = ({ marginLeft={[4, 0]} className={styles.image} > - + {`skrautmynd diff --git a/libs/service-portal/documents/src/components/DocumentLine/DocumentLine.tsx b/libs/service-portal/documents/src/components/DocumentLine/DocumentLine.tsx index 5dc7d68e6f95..c3d55cd28b73 100644 --- a/libs/service-portal/documents/src/components/DocumentLine/DocumentLine.tsx +++ b/libs/service-portal/documents/src/components/DocumentLine/DocumentLine.tsx @@ -84,7 +84,7 @@ const DocumentLine: FC = ({ documentLine, userInfo, img }) => { {documentLine.subject} )} {documentLine.fileType === 'url' && documentLine.url ? ( diff --git a/libs/service-portal/eligibility/src/screens/Eligibility/Eligibility.tsx b/libs/service-portal/eligibility/src/screens/Eligibility/Eligibility.tsx index e01c62cdf3e0..a9656786ebe7 100644 --- a/libs/service-portal/eligibility/src/screens/Eligibility/Eligibility.tsx +++ b/libs/service-portal/eligibility/src/screens/Eligibility/Eligibility.tsx @@ -113,7 +113,10 @@ function Eligibility(): JSX.Element { alignItems="center" marginBottom={[3, 3, 0]} > - Skrautmynd + {`skrautmynd diff --git a/libs/service-portal/family/src/components/UserInfoItem/UserInfoItem.tsx b/libs/service-portal/family/src/components/UserInfoItem/UserInfoItem.tsx index cbe7cbb1a271..b47b46aa7f1d 100644 --- a/libs/service-portal/family/src/components/UserInfoItem/UserInfoItem.tsx +++ b/libs/service-portal/family/src/components/UserInfoItem/UserInfoItem.tsx @@ -56,7 +56,7 @@ const UserInfoOverviewItem: FC = ({ alignItems="center" marginBottom={[3, 3, 0]} > - Skrautmynd + {`skrautmynd From 8cb5c6149afa2be2bcc2de4ae7fea74671be691e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Wed, 15 Dec 2021 15:25:12 +0000 Subject: [PATCH 099/156] refactor: remove {} wrapping when using string values --- .../src/components/Greeting/Greeting.tsx | 4 ++-- .../src/components/Sidebar/NavItem/NavItem.tsx | 10 +++++----- .../components/Sidebar/NavItem/SubNavItem.tsx | 10 +++++----- .../components/EducationCard/EducationCard.tsx | 2 +- .../src/screens/AccessDenied/AccessDenied.tsx | 2 +- .../core/src/screens/NotFound/NotFound.tsx | 4 ++-- .../src/components/StatisticBox/StatisticBox.tsx | 4 ++-- .../StatisticsSearch/StatisticsSearch.tsx | 6 +++--- .../src/components/EditForm/EditForm.tsx | 16 ++++++++-------- .../islykill/src/screens/Islykill/Islykill.tsx | 2 +- .../Forms/PhoneForm/Steps/ConfirmationStep.tsx | 2 +- .../Forms/PhoneForm/Steps/FormStep.tsx | 2 +- .../UserOnboardingModal/Islykill/PhoneForm.tsx | 2 +- 13 files changed, 33 insertions(+), 33 deletions(-) diff --git a/apps/service-portal/src/components/Greeting/Greeting.tsx b/apps/service-portal/src/components/Greeting/Greeting.tsx index 105959d058d2..d924854d6b1f 100644 --- a/apps/service-portal/src/components/Greeting/Greeting.tsx +++ b/apps/service-portal/src/components/Greeting/Greeting.tsx @@ -91,8 +91,8 @@ const Greeting: FC<{}> = () => { {`skrautmynd diff --git a/apps/service-portal/src/components/Sidebar/NavItem/NavItem.tsx b/apps/service-portal/src/components/Sidebar/NavItem/NavItem.tsx index 7b292a6178ac..f4437e4399ce 100644 --- a/apps/service-portal/src/components/Sidebar/NavItem/NavItem.tsx +++ b/apps/service-portal/src/components/Sidebar/NavItem/NavItem.tsx @@ -69,21 +69,21 @@ const NavItemContent: FC = ({ type={active ? 'filled' : icon.type} icon={icon.icon} size="medium" - color={'blue600'} + color="blue600" /> ) : null} {!collapsed ? {children} : ''} {showChevron && ( - + )} {showLock && ( )} diff --git a/apps/service-portal/src/components/Sidebar/NavItem/SubNavItem.tsx b/apps/service-portal/src/components/Sidebar/NavItem/SubNavItem.tsx index 0437a17584f4..8668fe6bf3df 100644 --- a/apps/service-portal/src/components/Sidebar/NavItem/SubNavItem.tsx +++ b/apps/service-portal/src/components/Sidebar/NavItem/SubNavItem.tsx @@ -22,10 +22,10 @@ const SubNavItemContent: FC = ({ = ({ {!enabled && ( )} diff --git a/libs/service-portal/core/src/components/EducationCard/EducationCard.tsx b/libs/service-portal/core/src/components/EducationCard/EducationCard.tsx index d3d882a7bfb1..fc88195d31c4 100644 --- a/libs/service-portal/core/src/components/EducationCard/EducationCard.tsx +++ b/libs/service-portal/core/src/components/EducationCard/EducationCard.tsx @@ -70,7 +70,7 @@ export const EducationCard = ({ > {eyebrow && {eyebrow}} {CTA && ( - + {CTA} )} diff --git a/libs/service-portal/core/src/screens/AccessDenied/AccessDenied.tsx b/libs/service-portal/core/src/screens/AccessDenied/AccessDenied.tsx index 6340e3711087..c0fa6f6f1cf8 100644 --- a/libs/service-portal/core/src/screens/AccessDenied/AccessDenied.tsx +++ b/libs/service-portal/core/src/screens/AccessDenied/AccessDenied.tsx @@ -15,7 +15,7 @@ export const AccessDenied: ServicePortalModuleComponent = ({ return ( diff --git a/libs/service-portal/core/src/screens/NotFound/NotFound.tsx b/libs/service-portal/core/src/screens/NotFound/NotFound.tsx index be9d3cda961b..b6c38791bdf8 100644 --- a/libs/service-portal/core/src/screens/NotFound/NotFound.tsx +++ b/libs/service-portal/core/src/screens/NotFound/NotFound.tsx @@ -15,8 +15,8 @@ export const NotFound: FC = ({ title }) => { return ( diff --git a/libs/service-portal/document-provider/src/components/StatisticBox/StatisticBox.tsx b/libs/service-portal/document-provider/src/components/StatisticBox/StatisticBox.tsx index 3353bcd11e0b..8b6e2983b168 100644 --- a/libs/service-portal/document-provider/src/components/StatisticBox/StatisticBox.tsx +++ b/libs/service-portal/document-provider/src/components/StatisticBox/StatisticBox.tsx @@ -26,13 +26,13 @@ export const StatisticBox: FC = ({ name, value }) => { - {name} + {name} {displayValue} - {displayText} + {displayText} diff --git a/libs/service-portal/document-provider/src/components/StatisticsSearch/StatisticsSearch.tsx b/libs/service-portal/document-provider/src/components/StatisticsSearch/StatisticsSearch.tsx index b09faf327ddd..729d9d23cb1e 100644 --- a/libs/service-portal/document-provider/src/components/StatisticsSearch/StatisticsSearch.tsx +++ b/libs/service-portal/document-provider/src/components/StatisticsSearch/StatisticsSearch.tsx @@ -47,7 +47,7 @@ export const StatisticsSearch = () => { option.label.includes(searchTerm)} - size={'large'} + size="large" placeholder={formatMessage(m.StatisticsSearchPlaceholder)} inputValue={searchTerm} onInputValueChange={setSearchTerm} @@ -59,7 +59,7 @@ export const StatisticsSearch = () => { { console.log(args) }} diff --git a/libs/service-portal/icelandic-names-registry/src/components/EditForm/EditForm.tsx b/libs/service-portal/icelandic-names-registry/src/components/EditForm/EditForm.tsx index 672bc073b8ea..95d6fde721c2 100644 --- a/libs/service-portal/icelandic-names-registry/src/components/EditForm/EditForm.tsx +++ b/libs/service-portal/icelandic-names-registry/src/components/EditForm/EditForm.tsx @@ -122,7 +122,7 @@ const EditForm: React.FC = ({ > - + {!isUpdating ? 'Skráning íslensks nafns' @@ -132,7 +132,7 @@ const EditForm: React.FC = ({ - + = ({ - + { @@ -241,7 +241,7 @@ const EditForm: React.FC = ({ - + { @@ -262,7 +262,7 @@ const EditForm: React.FC = ({ /> - + { @@ -285,7 +285,7 @@ const EditForm: React.FC = ({ - + = ({ > - + - + ) : ( - ) : null} -
- - - - + validate: { + value: (value: number) => { + if ( + value.toString().length === 10 && + !kennitala.isValid(value) + ) { + return formatMessage({ + id: + 'service.portal.settings.accessControl:grant-invalid-ssn', + defaultMessage: + 'Kennitalan er ekki gild kennitala', + }) + } + }, + }, + } as ValidationRules + } + type="tel" + format="######-####" + label={formatMessage(sharedMessages.nationalId)} + placeholder={formatMessage(sharedMessages.nationalId)} + error={errors.toNationalId?.message} + onChange={(value) => { + requestDelegation(value) + }} + size="xs" + /> + + {queryLoading ? ( + + + + ) : name ? ( + + ) : null} +
+ + + + +
From 243d9660fbba3b6483179a7f25e7e23a81278050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Mon, 20 Dec 2021 13:58:36 +0000 Subject: [PATCH 114/156] refactor: smaller text on access table --- .../src/screens/Access/components/AccessItem/AccessItem.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/service-portal/settings/access-control/src/screens/Access/components/AccessItem/AccessItem.tsx b/libs/service-portal/settings/access-control/src/screens/Access/components/AccessItem/AccessItem.tsx index 7aaa0e94401a..a6a61d0082c0 100644 --- a/libs/service-portal/settings/access-control/src/screens/Access/components/AccessItem/AccessItem.tsx +++ b/libs/service-portal/settings/access-control/src/screens/Access/components/AccessItem/AccessItem.tsx @@ -123,7 +123,7 @@ function AccessItem({ apiScopes, authDelegation }: PropTypes) { - + {item.description} From c0726d2c199adf1cb222634d2e360b02bd013cdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Mon, 20 Dec 2021 13:58:58 +0000 Subject: [PATCH 115/156] fix: forgot to commit checkox changes --- libs/island-ui/core/src/lib/Checkbox/Checkbox.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/island-ui/core/src/lib/Checkbox/Checkbox.tsx b/libs/island-ui/core/src/lib/Checkbox/Checkbox.tsx index b30af4b66957..a98075916d93 100644 --- a/libs/island-ui/core/src/lib/Checkbox/Checkbox.tsx +++ b/libs/island-ui/core/src/lib/Checkbox/Checkbox.tsx @@ -22,7 +22,7 @@ export interface CheckboxProps { filled?: boolean large?: boolean backgroundColor?: InputBackgroundColor - labelVariant?: 'default' | 'small' + labelVariant?: 'default' | 'small' | 'medium' /** subLabel can only be used if the 'large' prop set to true */ subLabel?: string } From 027794ce4010fb620c4c03891a0a6ef8aaccc538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Mon, 20 Dec 2021 13:59:15 +0000 Subject: [PATCH 116/156] refactor: input sizes on documents datepicker --- .../documents/src/screens/Overview/Overview.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/service-portal/documents/src/screens/Overview/Overview.tsx b/libs/service-portal/documents/src/screens/Overview/Overview.tsx index b253dddb0591..f6957dc2918c 100644 --- a/libs/service-portal/documents/src/screens/Overview/Overview.tsx +++ b/libs/service-portal/documents/src/screens/Overview/Overview.tsx @@ -253,7 +253,7 @@ export const ServicePortalDocuments: ServicePortalModuleComponent = ({ - + - + Date: Mon, 20 Dec 2021 14:04:30 +0000 Subject: [PATCH 117/156] refactor: text changes --- .../src/screens/EducationLicense/EducationLicense.tsx | 2 +- .../StudentAssessmentTable/StudentAssessmentTable.tsx | 3 ++- .../family/src/screens/UserInfoOverview/UserInfoOverview.tsx | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/service-portal/education-license/src/screens/EducationLicense/EducationLicense.tsx b/libs/service-portal/education-license/src/screens/EducationLicense/EducationLicense.tsx index 304f6fd06be2..3610e679ce4e 100644 --- a/libs/service-portal/education-license/src/screens/EducationLicense/EducationLicense.tsx +++ b/libs/service-portal/education-license/src/screens/EducationLicense/EducationLicense.tsx @@ -17,7 +17,7 @@ function EducationLicense(): JSX.Element { intro={defineMessage({ id: 'sp.education-license:education-license-intro', defaultMessage: - 'Hér getur þú fundið yfirlit yfir leyfisbréf og vottorð til starfsréttinda.', + 'Hér er markmiðið að þú getir fundið yfirlit yfir leyfisbréf og vottorð til starfsréttinda. Unnið er að því að koma öllum leyfisbréfum og vottorðum um starfsréttindi á einn stað. Núna birtast leyfisbréf kennara sem hafa verið útskrifaðir frá 1988 sem sótt eru til Menntamálastofnunar.', })} /> diff --git a/libs/service-portal/education-student-assessment/src/screens/EducationStudentAssessment/components/StudentAssessmentTable/StudentAssessmentTable.tsx b/libs/service-portal/education-student-assessment/src/screens/EducationStudentAssessment/components/StudentAssessmentTable/StudentAssessmentTable.tsx index 90a769767f1c..754251fb87b1 100644 --- a/libs/service-portal/education-student-assessment/src/screens/EducationStudentAssessment/components/StudentAssessmentTable/StudentAssessmentTable.tsx +++ b/libs/service-portal/education-student-assessment/src/screens/EducationStudentAssessment/components/StudentAssessmentTable/StudentAssessmentTable.tsx @@ -101,7 +101,8 @@ const StudentAssessmentTable = () => { {formatMessage({ id: 'sp.education-student-assessment:education-student-assessment-intro', - defaultMessage: 'Hér getur þú skoðað námsmat.', + defaultMessage: + 'Hér birtast einkunnir þínar og barna þinna úr samræmdum prófum frá árinu 2020 sem sóttar eru til Menntamálastofnunar. Unnið er að því að því að koma öllum einkunnum úr menntakerfi Íslands á einn stað.', })} diff --git a/libs/service-portal/family/src/screens/UserInfoOverview/UserInfoOverview.tsx b/libs/service-portal/family/src/screens/UserInfoOverview/UserInfoOverview.tsx index 5fa42e02b4cb..92855b1c2a42 100644 --- a/libs/service-portal/family/src/screens/UserInfoOverview/UserInfoOverview.tsx +++ b/libs/service-portal/family/src/screens/UserInfoOverview/UserInfoOverview.tsx @@ -46,7 +46,7 @@ const UserInfoOverview: ServicePortalModuleComponent = ({ userInfo }) => { {formatMessage({ id: 'sp.family:user-info-description', defaultMessage: - 'Hér eru þín gögn frá þjóðskrá. Þú hefur kost á að gera breytingar á þessum gögnum.', + 'Hér eru gögn um þig og fjölskyldu þína sem sótt eru til Þjóðskrár. Með því að smella á skoða nánar er hægt að óska eftir breytingum á þeim upplýsingum.', })} From aebfebdda315e9b7a4dfb704d6358886829910b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Mon, 20 Dec 2021 14:08:39 +0000 Subject: [PATCH 118/156] refactor: smaller padding on mobile logo --- apps/service-portal/src/components/Sidebar/Sidebar.css.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/service-portal/src/components/Sidebar/Sidebar.css.ts b/apps/service-portal/src/components/Sidebar/Sidebar.css.ts index 370b0b980d05..9923ef41cdfe 100644 --- a/apps/service-portal/src/components/Sidebar/Sidebar.css.ts +++ b/apps/service-portal/src/components/Sidebar/Sidebar.css.ts @@ -20,7 +20,7 @@ export const collapsed = style({ export const logoCollapsed = style({ display: 'flex', justifyContent: 'flex-end', - paddingTop: theme.spacing[3], + paddingTop: 0, marginRight: -22, }) export const subnav = style({ From 1e8255ad7744f376e95694a3084c246cb010a363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Mon, 20 Dec 2021 15:56:26 +0000 Subject: [PATCH 119/156] fix: delete endorsments like on main --- .../src/screens/Endorsements/Endorsements.tsx | 348 ------------------ 1 file changed, 348 deletions(-) delete mode 100644 libs/service-portal/endorsements/src/screens/Endorsements/Endorsements.tsx diff --git a/libs/service-portal/endorsements/src/screens/Endorsements/Endorsements.tsx b/libs/service-portal/endorsements/src/screens/Endorsements/Endorsements.tsx deleted file mode 100644 index 048f49d59340..000000000000 --- a/libs/service-portal/endorsements/src/screens/Endorsements/Endorsements.tsx +++ /dev/null @@ -1,348 +0,0 @@ -import React from 'react' -import { Box, Text, ActionCard, Stack } from '@island.is/island-ui/core' -import { useLocale } from '@island.is/localization' -import { formatDate } from '@island.is/judicial-system/formatters' -import { useMutation, useQuery } from '@apollo/client' -import gql from 'graphql-tag' -import { m } from '../../lib/messages' -import { - Endorsement, - EndorsementList, - EndorsementListOpenTagsEnum, - TemporaryVoterRegistry, -} from '../../types/schema' -import { getSlugFromType } from '@island.is/application/core' - -export type UserEndorsement = Pick< - Endorsement, - 'id' | 'created' | 'endorsementList' -> -export type RegionsEndorsementList = Pick< - EndorsementList, - 'id' | 'title' | 'description' | 'meta' | 'closedDate' -> & { tags: EndorsementListOpenTagsEnum[] } - -export type UserVoterRegion = Pick< - TemporaryVoterRegistry, - 'regionNumber' | 'regionName' -> -interface UserEndorsementsResponse { - endorsementSystemUserEndorsements: UserEndorsement[] -} -interface EndorsementListResponse { - endorsementSystemFindEndorsementLists: RegionsEndorsementList[] -} -interface UserVoterRegionResponse { - temporaryVoterRegistryGetVoterRegion: UserVoterRegion -} - -const GET_USER_ENDORSEMENTS = gql` - query endorsementSystemUserEndorsements { - endorsementSystemUserEndorsements { - id - endorser - endorsementList { - id - title - description - tags - closedDate - } - meta { - fullName - address - } - created - modified - } - } -` -const GET_REGION_ENDORSEMENTS = gql` - query endorsementSystemFindEndorsementLists( - $input: FindEndorsementListByTagsDto! - ) { - endorsementSystemFindEndorsementLists(input: $input) { - id - title - description - tags - meta - closedDate - } - } -` - -const UNENDORSE_LIST = gql` - mutation unendorseList($input: FindEndorsementListInput!) { - endorsementSystemUnendorseList(input: $input) - } -` - -const USER_VOTER_REGION = gql` - query getVoterRegion { - temporaryVoterRegistryGetVoterRegion { - regionNumber - regionName - } - } -` - -const endorsementListTagNameMap = { - [EndorsementListOpenTagsEnum.GeneralPetition]: 'General Petition', - [EndorsementListOpenTagsEnum.PartyLetter2021]: 'Listabókstafur', - [EndorsementListOpenTagsEnum.PartyApplicationNordausturkjordaemi2021]: - 'Alþingiskosningar 2021 - Norðausturkjördæmi', - [EndorsementListOpenTagsEnum.PartyApplicationNordvesturkjordaemi2021]: - 'Alþingiskosningar 2021 - Norðvesturkjördæmi', - [EndorsementListOpenTagsEnum.PartyApplicationReykjavikurkjordaemiNordur2021]: - 'Alþingiskosningar 2021 - Reykjavíkurkjördæmi Norður', - [EndorsementListOpenTagsEnum.PartyApplicationReykjavikurkjordaemiSudur2021]: - 'Alþingiskosningar 2021 - Reykjavíkurkjördæmi Suður', - [EndorsementListOpenTagsEnum.PartyApplicationSudurkjordaemi2021]: - 'Alþingiskosningar 2021 - Suðurkjördæmi', - [EndorsementListOpenTagsEnum.PartyApplicationSudvesturkjordaemi2021]: - 'Alþingiskosningar 2021 - Suðvesturkjördæmi', -} -const getEndorsementListTagNames = (tags: EndorsementListOpenTagsEnum[]) => - tags.map((tag) => endorsementListTagNameMap[tag]) - -const regionNumberEndorsementListTagMap = { - 1: EndorsementListOpenTagsEnum.PartyApplicationReykjavikurkjordaemiSudur2021, - 2: EndorsementListOpenTagsEnum.PartyApplicationReykjavikurkjordaemiNordur2021, - 3: EndorsementListOpenTagsEnum.PartyApplicationSudvesturkjordaemi2021, - 4: EndorsementListOpenTagsEnum.PartyApplicationNordvesturkjordaemi2021, - 5: EndorsementListOpenTagsEnum.PartyApplicationNordausturkjordaemi2021, - 6: EndorsementListOpenTagsEnum.PartyApplicationSudurkjordaemi2021, -} - -const isLocalhost = window.location.origin.includes('localhost') -const isDev = window.location.origin.includes('beta.dev01.devland.is') -const isStaging = window.location.origin.includes('beta.staging01.devland.is') - -const baseUrlForm = isLocalhost - ? 'http://localhost:4242/umsoknir' - : isDev - ? 'https://beta.dev01.devland.is/umsoknir' - : isStaging - ? 'https://beta.staging01.devland.is/umsoknir' - : 'https://island.is/umsoknir' - -const Endorsements = () => { - const { formatMessage } = useLocale() - - // get user voter region - const { data: userVoterRegionResponse } = useQuery( - USER_VOTER_REGION, - ) - const userVoterRegion = - userVoterRegionResponse?.temporaryVoterRegistryGetVoterRegion - - const endorsementListTags = [EndorsementListOpenTagsEnum.PartyLetter2021] - - if (userVoterRegion && userVoterRegion.regionNumber > 0) { - endorsementListTags.push( - regionNumberEndorsementListTagMap[ - userVoterRegion.regionNumber as keyof typeof regionNumberEndorsementListTagMap - ], - ) - } - - // get all endorsement lists this user should see - const { - data: endorsementResponse, - refetch: refetchUserEndorsements, - } = useQuery(GET_USER_ENDORSEMENTS) - const { data: endorsementListsResponse } = useQuery( - GET_REGION_ENDORSEMENTS, - { - variables: { - input: { - tags: endorsementListTags, - }, - }, - pollInterval: 20000, - }, - ) - - const [unendorseList] = useMutation(UNENDORSE_LIST, { - onCompleted: () => { - refetchUserEndorsements() - }, - }) - - const allEndorsementLists = - endorsementListsResponse?.endorsementSystemFindEndorsementLists ?? [] - const endorsements = - endorsementResponse?.endorsementSystemUserEndorsements ?? [] - const signedLists = endorsements.map( - ({ endorsementList }) => endorsementList?.id, - ) - - // all endorsement lists that are not signed and still open - const endorsementLists = allEndorsementLists.filter( - ({ id, closedDate }) => !signedLists.includes(id) && closedDate === null, - ) - - // party-application lists - const applicationLists = endorsementLists.filter( - (list) => - getEndorsementListTagNames(list.tags).join(' ') !== - getEndorsementListTagNames([ - EndorsementListOpenTagsEnum.PartyLetter2021, - ]).join(' '), - ) - - // party-letter application lists - const partyLetterLists = endorsementLists.filter( - (list) => - getEndorsementListTagNames(list.tags).join(' ') === - getEndorsementListTagNames([ - EndorsementListOpenTagsEnum.PartyLetter2021, - ]).join(' '), - ) - - return ( - - - - {formatMessage(m.endorsement.introTitle)} - - - - {formatMessage(m.endorsement.intro)} - - - {endorsements && endorsements.length > 0 && ( - <> - - {formatMessage(m.endorsement.myEndorsements)} - - - {endorsements.map((endorsement) => { - const tagLabel = getEndorsementListTagNames( - endorsement.endorsementList?.tags ?? [], - ).join(' ') - return ( - - unendorseList({ - variables: { - input: { listId: endorsement.endorsementList?.id }, - }, - }), - disabled: endorsement.endorsementList?.closedDate !== null, - }} - /> - ) - })} - - - )} - {applicationLists && applicationLists.length > 0 && ( - <> - - {formatMessage(m.endorsement.availablePartyApplicationEndorsements)} - - - {applicationLists.map((endorsementList) => ( - { - window.open( - `${baseUrlForm}/${ - getSlugFromType( - endorsementList.meta.applicationTypeId, - ) as string - }/${endorsementList.meta.applicationId}`, - ) - }, - }} - /> - ))} - - - )} - {partyLetterLists && partyLetterLists.length > 0 && ( - <> - - {formatMessage(m.endorsement.availablePartyLetterEndorsements)} - - - {partyLetterLists.map((endorsementList) => ( - { - window.open( - `${baseUrlForm}/${ - getSlugFromType( - endorsementList.meta.applicationTypeId, - ) as string - }/${endorsementList.meta.applicationId}`, - ) - }, - }} - /> - ))} - - - )} - - ) -} - -export default Endorsements From 50bbaec7d7d9176f38ca48b155a3ba04c6c284e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Tue, 21 Dec 2021 21:18:20 +0000 Subject: [PATCH 120/156] fix: back to SM input for access detail table --- .../src/screens/Access/components/AccessItem/AccessItem.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/service-portal/settings/access-control/src/screens/Access/components/AccessItem/AccessItem.tsx b/libs/service-portal/settings/access-control/src/screens/Access/components/AccessItem/AccessItem.tsx index a6a61d0082c0..23b55a97749d 100644 --- a/libs/service-portal/settings/access-control/src/screens/Access/components/AccessItem/AccessItem.tsx +++ b/libs/service-portal/settings/access-control/src/screens/Access/components/AccessItem/AccessItem.tsx @@ -143,7 +143,7 @@ function AccessItem({ apiScopes, authDelegation }: PropTypes) {
Date: Tue, 21 Dec 2021 21:18:52 +0000 Subject: [PATCH 121/156] fix: link not working outside service portal --- .../components/src/auth/UserMenu/UserDropdownItem.tsx | 8 ++++++-- libs/shared/components/src/auth/UserMenu/UserMenu.tsx | 2 +- .../components/src/auth/UserMenu/UserProfileInfo.tsx | 11 +++++++---- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/libs/shared/components/src/auth/UserMenu/UserDropdownItem.tsx b/libs/shared/components/src/auth/UserMenu/UserDropdownItem.tsx index bca9b7175af2..9fa99ffd1615 100644 --- a/libs/shared/components/src/auth/UserMenu/UserDropdownItem.tsx +++ b/libs/shared/components/src/auth/UserMenu/UserDropdownItem.tsx @@ -37,9 +37,13 @@ export const UserDropdownItem = ({ {link ? ( - + {text} - + ) : ( )} diff --git a/libs/shared/components/src/auth/UserMenu/UserMenu.tsx b/libs/shared/components/src/auth/UserMenu/UserMenu.tsx index c9dae8aa3066..b799410197b5 100644 --- a/libs/shared/components/src/auth/UserMenu/UserMenu.tsx +++ b/libs/shared/components/src/auth/UserMenu/UserMenu.tsx @@ -39,7 +39,7 @@ export const UserMenu = ({ setDropdownState('closed') switchUser(nationalId) }} - > + /> ) } diff --git a/libs/shared/components/src/auth/UserMenu/UserProfileInfo.tsx b/libs/shared/components/src/auth/UserMenu/UserProfileInfo.tsx index dc65638dc1d4..3c276ee4c2a2 100644 --- a/libs/shared/components/src/auth/UserMenu/UserProfileInfo.tsx +++ b/libs/shared/components/src/auth/UserMenu/UserProfileInfo.tsx @@ -2,11 +2,14 @@ import React from 'react' import { Box, Text } from '@island.is/island-ui/core' import { useLocale } from '@island.is/localization' import { UserDropdownItem } from './UserDropdownItem' -import { ServicePortalPath, m } from '@island.is/service-portal/core' +import { m } from '@island.is/service-portal/core' export const UserProfileInfo = ({ onClick }: { onClick: () => void }) => { const { formatMessage } = useLocale() - + const isDev = process.env.NODE_ENV !== 'development' + const baseUrl = isDev + ? 'http://localhost:4200/minarsidur/stillingar' + : 'https://island.is/minarsidur/stillingar' return ( @@ -16,7 +19,7 @@ export const UserProfileInfo = ({ onClick }: { onClick: () => void }) => { onClick()} /> @@ -24,7 +27,7 @@ export const UserProfileInfo = ({ onClick }: { onClick: () => void }) => { onClick()} /> From 7c06910e64702d0487351494a5369eb2e02ae7e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Tue, 21 Dec 2021 21:31:49 +0000 Subject: [PATCH 122/156] fix: remove table styling on access items --- .../src/screens/Access/components/AccessItem/AccessItem.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libs/service-portal/settings/access-control/src/screens/Access/components/AccessItem/AccessItem.tsx b/libs/service-portal/settings/access-control/src/screens/Access/components/AccessItem/AccessItem.tsx index 23b55a97749d..437277c67b64 100644 --- a/libs/service-portal/settings/access-control/src/screens/Access/components/AccessItem/AccessItem.tsx +++ b/libs/service-portal/settings/access-control/src/screens/Access/components/AccessItem/AccessItem.tsx @@ -118,7 +118,6 @@ function AccessItem({ apiScopes, authDelegation }: PropTypes) { ...tdStyling, paddingLeft: isFirstItem ? 3 : 8, }} - style={tableStyles} > onSelect(item, value)} /> - + {item.description} - +
Date: Tue, 21 Dec 2021 21:32:07 +0000 Subject: [PATCH 123/156] fix: revert changes on grant access component --- .../src/screens/GrantAccess/GrantAccess.tsx | 185 +++++++++--------- 1 file changed, 92 insertions(+), 93 deletions(-) diff --git a/libs/service-portal/settings/access-control/src/screens/GrantAccess/GrantAccess.tsx b/libs/service-portal/settings/access-control/src/screens/GrantAccess/GrantAccess.tsx index 52982601f467..aa50a48c9b46 100644 --- a/libs/service-portal/settings/access-control/src/screens/GrantAccess/GrantAccess.tsx +++ b/libs/service-portal/settings/access-control/src/screens/GrantAccess/GrantAccess.tsx @@ -155,100 +155,99 @@ function GrantAccess() { })} - - -
- {name && ( - - )} - - +
+ {name && ( + + )} + + { + if ( + value.toString().length === 10 && + !kennitala.isValid(value) + ) { + return formatMessage({ + id: + 'service.portal.settings.accessControl:grant-invalid-ssn', + defaultMessage: + 'Kennitalan er ekki gild kennitala', + }) + } }, - validate: { - value: (value: number) => { - if ( - value.toString().length === 10 && - !kennitala.isValid(value) - ) { - return formatMessage({ - id: - 'service.portal.settings.accessControl:grant-invalid-ssn', - defaultMessage: - 'Kennitalan er ekki gild kennitala', - }) - } - }, - }, - } as ValidationRules - } - type="tel" - format="######-####" - label={formatMessage(sharedMessages.nationalId)} - placeholder={formatMessage(sharedMessages.nationalId)} - error={errors.toNationalId?.message} - onChange={(value) => { - requestDelegation(value) - }} - size="xs" - /> - - {queryLoading ? ( - - - - ) : name ? ( - - ) : null} -
- - - - -
+ }, + } as ValidationRules + } + type="tel" + format="######-####" + label={formatMessage(sharedMessages.nationalId)} + placeholder={formatMessage(sharedMessages.nationalId)} + error={errors.toNationalId?.message} + onChange={(value) => { + requestDelegation(value) + }} + size="md" + /> + + {queryLoading ? ( + + + + ) : name ? ( + + ) : null} +
+
+ + +
From 5f0930dda9eefeb64ef367b9d9281eb27e2a89d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Wed, 22 Dec 2021 09:43:27 +0000 Subject: [PATCH 124/156] fix: userMenu not responsive + other comments --- .../src/components/Header/Header.tsx | 2 +- .../core/src/lib/UserAvatar/UserAvatar.css.ts | 4 + .../core/src/lib/UserAvatar/UserAvatar.tsx | 2 +- .../src/auth/UserMenu/UserDelegations.tsx | 6 +- .../src/auth/UserMenu/UserDropdown.tsx | 128 +++++++++--------- .../src/auth/UserMenu/UserMenu.css.ts | 28 ++-- .../components/src/auth/UserMenu/UserMenu.tsx | 3 + .../src/auth/UserMenu/UserProfileInfo.tsx | 2 +- .../src/auth/UserMenu/UserTopicCard.tsx | 2 +- 9 files changed, 95 insertions(+), 82 deletions(-) diff --git a/apps/service-portal/src/components/Header/Header.tsx b/apps/service-portal/src/components/Header/Header.tsx index 860c5f73fdbd..079c642bdacf 100644 --- a/apps/service-portal/src/components/Header/Header.tsx +++ b/apps/service-portal/src/components/Header/Header.tsx @@ -54,7 +54,7 @@ export const Header: FC<{}> = () => { - + + + )} + {/* End of user settings */} + {/* Logout */} + + + {/* End of Logout */} - + + ) } diff --git a/libs/shared/components/src/auth/UserMenu/UserMenu.css.ts b/libs/shared/components/src/auth/UserMenu/UserMenu.css.ts index dbc71360570a..1fcdcc161ec7 100644 --- a/libs/shared/components/src/auth/UserMenu/UserMenu.css.ts +++ b/libs/shared/components/src/auth/UserMenu/UserMenu.css.ts @@ -1,7 +1,8 @@ import { style } from '@vanilla-extract/css' import { spacing, theme, themeUtils } from '@island.is/island-ui/theme' +import { StyleWithSelectors } from '@vanilla-extract/css/dist/declarations/src/types' -export const dropdown = style({ +const dropdownBase: StyleWithSelectors = { position: 'fixed', top: spacing[3], right: spacing[3], @@ -9,7 +10,10 @@ export const dropdown = style({ maxHeight: `calc(100vh - ${spacing[6]}px)`, filter: 'drop-shadow(0px 4px 70px rgba(0, 97, 255, 0.1))', +} +export const dropdown = style({ + ...dropdownBase, ...themeUtils.responsiveStyle({ md: { left: 'auto', @@ -20,24 +24,21 @@ export const dropdown = style({ }) export const fullScreen = style({ - position: 'fixed', - top: spacing[4], - right: spacing[4], - maxHeight: `calc(100vh - ${spacing[6]}px)`, - filter: 'drop-shadow(0px 4px 70px rgba(0, 97, 255, 0.1))', - + ...dropdownBase, ...themeUtils.responsiveStyle({ md: { - top: spacing[4], - right: spacing[4], + left: 'auto', width: 358, }, - xl: { - right: spacing[6], - }, }), }) +export const wrapper = style({ + maxHeight: `calc(100vh - ${spacing[12]}px)`, + overflowY: 'auto', + overflowX: 'hidden', +}) + export const closeButton = style({ display: 'flex', justifyContent: 'center', @@ -125,8 +126,9 @@ export const companyIconSize = style({ height: 40, }) export const userDelegationWrapper = style({ - maxHeight: 240, overflowY: 'auto', + overflowX: 'hidden', + maxHeight: 210, }) export const userDelegationsText = style({ fontSize: 16, diff --git a/libs/shared/components/src/auth/UserMenu/UserMenu.tsx b/libs/shared/components/src/auth/UserMenu/UserMenu.tsx index b799410197b5..3a0172be4ceb 100644 --- a/libs/shared/components/src/auth/UserMenu/UserMenu.tsx +++ b/libs/shared/components/src/auth/UserMenu/UserMenu.tsx @@ -7,8 +7,10 @@ import { UserLanguageSwitcher } from './UserLanguageSwitcher' export const UserMenu = ({ showLanguageButton = false, + fullscreen = false, }: { showLanguageButton?: boolean + fullscreen?: boolean }) => { const [dropdownState, setDropdownState] = useState<'closed' | 'open'>( 'closed', @@ -39,6 +41,7 @@ export const UserMenu = ({ setDropdownState('closed') switchUser(nationalId) }} + fullscreen={fullscreen} /> ) diff --git a/libs/shared/components/src/auth/UserMenu/UserProfileInfo.tsx b/libs/shared/components/src/auth/UserMenu/UserProfileInfo.tsx index 3c276ee4c2a2..5d9f93bab2b2 100644 --- a/libs/shared/components/src/auth/UserMenu/UserProfileInfo.tsx +++ b/libs/shared/components/src/auth/UserMenu/UserProfileInfo.tsx @@ -11,7 +11,7 @@ export const UserProfileInfo = ({ onClick }: { onClick: () => void }) => { ? 'http://localhost:4200/minarsidur/stillingar' : 'https://island.is/minarsidur/stillingar' return ( - + {formatMessage(m.settings)} diff --git a/libs/shared/components/src/auth/UserMenu/UserTopicCard.tsx b/libs/shared/components/src/auth/UserMenu/UserTopicCard.tsx index 3f1d276d3736..3df7b9395245 100644 --- a/libs/shared/components/src/auth/UserMenu/UserTopicCard.tsx +++ b/libs/shared/components/src/auth/UserMenu/UserTopicCard.tsx @@ -55,7 +55,7 @@ export const UserTopicCard: React.FC = ({ > {!icon ? ( From 248ccada0f43e69c87649a3a4ed41955cc27a72a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Wed, 22 Dec 2021 10:37:40 +0000 Subject: [PATCH 125/156] fix: base url for settings --- .../components/src/auth/UserMenu/UserDropdown.tsx | 3 ++- .../components/src/auth/UserMenu/UserMenu.css.ts | 7 ++++++- .../components/src/auth/UserMenu/UserProfileInfo.tsx | 12 ++++++++++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/libs/shared/components/src/auth/UserMenu/UserDropdown.tsx b/libs/shared/components/src/auth/UserMenu/UserDropdown.tsx index 5d915f4d1d8e..6e502a5d25ad 100644 --- a/libs/shared/components/src/auth/UserMenu/UserDropdown.tsx +++ b/libs/shared/components/src/auth/UserMenu/UserDropdown.tsx @@ -139,8 +139,9 @@ export const UserDropdown = ({ )} {/* End of user settings */} + {/* Logout */} - + void }) => { const { formatMessage } = useLocale() - const isDev = process.env.NODE_ENV !== 'development' + const isDev = process.env.NODE_ENV === 'development' const baseUrl = isDev ? 'http://localhost:4200/minarsidur/stillingar' : 'https://island.is/minarsidur/stillingar' @@ -24,7 +24,7 @@ export const UserProfileInfo = ({ onClick }: { onClick: () => void }) => { onClick={() => onClick()} /> - + void }) => { onClick={() => onClick()} /> + + onClick()} + /> + ) } From 97636d33593d73140c1f3f3ec90f7928da517435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Wed, 22 Dec 2021 10:53:41 +0000 Subject: [PATCH 126/156] fix: remove temp data --- .../components/src/auth/UserMenu/UserProfileInfo.tsx | 8 -------- 1 file changed, 8 deletions(-) diff --git a/libs/shared/components/src/auth/UserMenu/UserProfileInfo.tsx b/libs/shared/components/src/auth/UserMenu/UserProfileInfo.tsx index f38f404439cd..3aa30212a459 100644 --- a/libs/shared/components/src/auth/UserMenu/UserProfileInfo.tsx +++ b/libs/shared/components/src/auth/UserMenu/UserProfileInfo.tsx @@ -32,14 +32,6 @@ export const UserProfileInfo = ({ onClick }: { onClick: () => void }) => { onClick={() => onClick()} /> - - onClick()} - /> - ) } From a3929f4ebaefaf6b04d0aacad63e0da92ac874e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Wed, 22 Dec 2021 14:14:55 +0000 Subject: [PATCH 127/156] fix: layout --- apps/service-portal/src/components/Layout/helpers.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/service-portal/src/components/Layout/helpers.ts b/apps/service-portal/src/components/Layout/helpers.ts index 5c057464fdf1..02de425ab0cf 100644 --- a/apps/service-portal/src/components/Layout/helpers.ts +++ b/apps/service-portal/src/components/Layout/helpers.ts @@ -10,21 +10,22 @@ type responsiveGridColumns = Record< offset: ResponsiveProp } > + export const gridlayout: responsiveGridColumns = { default: { - span: ['12/12', '12/12', '12/12', '9/12', '9/12'], + span: ['12/12', '12/12', '12/12', '8/12', '8/12'], offset: ['0', '0', '0', '3/12', '3/12'], }, wide: { - span: ['12/12', '12/12', '12/12', '9/12', '10/12'], + span: ['12/12', '12/12', '12/12', '8/12', '9/12'], offset: ['0', '0', '0', '3/12', '2/12'], }, defaultClosed: { - span: ['12/12', '12/12', '12/12', '10/12', '10/12'], + span: ['12/12', '12/12', '12/12', '9/12', '9/12'], offset: ['0', '0', '0', '2/12', '2/12'], }, wideClosed: { - span: ['12/12', '12/12', '12/12', '11/12', '11/12'], + span: ['12/12', '12/12', '12/12', '10/12', '10/12'], offset: ['0', '0', '0', '1/12', '1/12'], }, } From 6ba2616c28d7352e801c17ffd6f44cb4cf5ee60b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Wed, 22 Dec 2021 14:15:21 +0000 Subject: [PATCH 128/156] fix: remove text on plus button for finance tables --- .../src/components/ExpandableTable/Row.tsx | 37 ++++++------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/libs/service-portal/finance/src/components/ExpandableTable/Row.tsx b/libs/service-portal/finance/src/components/ExpandableTable/Row.tsx index b09d7d8403f6..6e74c71ff69a 100644 --- a/libs/service-portal/finance/src/components/ExpandableTable/Row.tsx +++ b/libs/service-portal/finance/src/components/ExpandableTable/Row.tsx @@ -94,31 +94,18 @@ const ExpandableLine: FC = ({ onClick={onExpandButton} cursor="pointer" > - - - {expanded - ? formatMessage(m.closeFinanceDetail) - : formatMessage(m.openFinanceDetail)} - - - - - {/* End of Logout */} - - + ) } From 72ab3aec2a77eea466ec2907f933cb2b0582cd09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Wed, 22 Dec 2021 15:51:33 +0000 Subject: [PATCH 130/156] fix: sidebar animation --- .../src/components/Sidebar/NavItem/NavItem.css.ts | 3 +++ .../src/components/Sidebar/NavItem/NavItem.tsx | 2 +- apps/service-portal/src/components/Sidebar/Sidebar.css.ts | 1 - apps/service-portal/src/components/Sidebar/Sidebar.tsx | 5 ++++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/service-portal/src/components/Sidebar/NavItem/NavItem.css.ts b/apps/service-portal/src/components/Sidebar/NavItem/NavItem.css.ts index ba3edb1aa094..0a75682d569e 100644 --- a/apps/service-portal/src/components/Sidebar/NavItem/NavItem.css.ts +++ b/apps/service-portal/src/components/Sidebar/NavItem/NavItem.css.ts @@ -35,10 +35,13 @@ export const text = style({ fontSize: 16, lineHeight: '26px', color: theme.color.blue600, + whiteSpace: 'nowrap', + overflow: 'hidden', }) export const icon = style({ pointerEvents: 'none', + height: '26px', }) export const dot = style({ diff --git a/apps/service-portal/src/components/Sidebar/NavItem/NavItem.tsx b/apps/service-portal/src/components/Sidebar/NavItem/NavItem.tsx index 6714fcbff5b4..ef2282bf0e48 100644 --- a/apps/service-portal/src/components/Sidebar/NavItem/NavItem.tsx +++ b/apps/service-portal/src/components/Sidebar/NavItem/NavItem.tsx @@ -53,7 +53,7 @@ const NavItemContent: FC = ({ paddingLeft={collapsed ? 1 : 3} paddingRight={collapsed ? 1 : 2} > - + {icon ? ( = () => { justifyContent="flexStart" marginBottom={3} background={collapsed ? 'transparent' : 'blue100'} - padding={collapsed ? 6 : 3} + paddingLeft={collapsed ? 6 : 3} + paddingBottom={collapsed ? 6 : 3} paddingRight={collapsed ? 6 : 0} + paddingTop={3} > = () => { From 18008e59617a30600d9dce5979a171dc20031dc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Tue, 28 Dec 2021 08:42:09 +0000 Subject: [PATCH 131/156] fix: revert changes for small input --- .../access-control/src/screens/GrantAccess/GrantAccess.css.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/service-portal/settings/access-control/src/screens/GrantAccess/GrantAccess.css.ts b/libs/service-portal/settings/access-control/src/screens/GrantAccess/GrantAccess.css.ts index bf7880d05441..9220a50deb79 100644 --- a/libs/service-portal/settings/access-control/src/screens/GrantAccess/GrantAccess.css.ts +++ b/libs/service-portal/settings/access-control/src/screens/GrantAccess/GrantAccess.css.ts @@ -9,8 +9,8 @@ export const inputWrapper = style({ export const icon = style({ position: 'absolute', lineHeight: 0, - top: '67%', - right: 8, + top: '50%', + right: 26, transform: 'translateY(-50%)', }) From 2e5989b558a9954c3d3da47ef37233578a8f2f41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Tue, 28 Dec 2021 08:52:09 +0000 Subject: [PATCH 132/156] fix: relative links on userDropdown --- .../components/src/auth/UserMenu/UserProfileInfo.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libs/shared/components/src/auth/UserMenu/UserProfileInfo.tsx b/libs/shared/components/src/auth/UserMenu/UserProfileInfo.tsx index 3aa30212a459..3ddfc563769c 100644 --- a/libs/shared/components/src/auth/UserMenu/UserProfileInfo.tsx +++ b/libs/shared/components/src/auth/UserMenu/UserProfileInfo.tsx @@ -6,12 +6,10 @@ import { m } from '@island.is/service-portal/core' export const UserProfileInfo = ({ onClick }: { onClick: () => void }) => { const { formatMessage } = useLocale() - const isDev = process.env.NODE_ENV === 'development' - const baseUrl = isDev - ? 'http://localhost:4200/minarsidur/stillingar' - : 'https://island.is/minarsidur/stillingar' + const origin = window.location.origin + const baseUrl = `${origin}/minarsidur/stillingar` return ( - + {formatMessage(m.settings)} From becee6a514059513cc29520a2934318b5990f334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Tue, 28 Dec 2021 10:32:59 +0000 Subject: [PATCH 133/156] feat: fixes after comment + dropdown lang for mobile --- .../src/components/Header/Header.tsx | 2 +- .../src/auth/UserMenu/UserDelegations.tsx | 32 +++++++----- .../src/auth/UserMenu/UserDropdown.tsx | 15 +++++- .../auth/UserMenu/UserLanguageSwitcher.tsx | 32 ++++++++++-- .../src/auth/UserMenu/UserMenu.css.ts | 51 ++++++++++++++----- .../src/auth/UserMenu/UserMenu.spec.tsx | 2 +- .../components/src/auth/UserMenu/UserMenu.tsx | 14 ++--- 7 files changed, 106 insertions(+), 42 deletions(-) diff --git a/apps/service-portal/src/components/Header/Header.tsx b/apps/service-portal/src/components/Header/Header.tsx index 079c642bdacf..0bde27a6dd72 100644 --- a/apps/service-portal/src/components/Header/Header.tsx +++ b/apps/service-portal/src/components/Header/Header.tsx @@ -54,7 +54,7 @@ export const Header: FC<{}> = () => { - +