diff --git a/apps/web/components/Charts/v2/hooks/chart.ts b/apps/web/components/Charts/v2/hooks/chart.ts index ed78a60d15c0..803624015e87 100644 --- a/apps/web/components/Charts/v2/hooks/chart.ts +++ b/apps/web/components/Charts/v2/hooks/chart.ts @@ -7,7 +7,7 @@ import { PieChart, } from 'recharts' -import { Chart } from '@island.is/api/schema' +import { Chart } from '@island.is/web/graphql/schema' import { ChartComponentWithRenderProps, ChartType } from '../types' import { decideChartBase } from '../utils' diff --git a/apps/web/components/OfficialJournalOfIceland/OJOIAdvertCards.tsx b/apps/web/components/OfficialJournalOfIceland/OJOIAdvertCards.tsx index 6d1992a3ac6d..8390420abb98 100644 --- a/apps/web/components/OfficialJournalOfIceland/OJOIAdvertCards.tsx +++ b/apps/web/components/OfficialJournalOfIceland/OJOIAdvertCards.tsx @@ -1,6 +1,6 @@ -import { OfficialJournalOfIcelandAdvertsResponse } from '@island.is/api/schema' import { Stack } from '@island.is/island-ui/core' import { Locale } from '@island.is/shared/types' +import { OfficialJournalOfIcelandAdvertsResponse } from '@island.is/web/graphql/schema' import { linkResolver } from '@island.is/web/hooks' import { OJOIAdvertCard } from './OJOIAdvertCard' diff --git a/apps/web/components/ServiceWeb/Forms/StandardForm/StandardForm.tsx b/apps/web/components/ServiceWeb/Forms/StandardForm/StandardForm.tsx index 3054bbc88e70..ffbb0de1e941 100644 --- a/apps/web/components/ServiceWeb/Forms/StandardForm/StandardForm.tsx +++ b/apps/web/components/ServiceWeb/Forms/StandardForm/StandardForm.tsx @@ -10,7 +10,6 @@ import { useDebounce } from 'react-use' import { useLazyQuery } from '@apollo/client' import slugify from '@sindresorhus/slugify' -import { Organizations, SupportCategory } from '@island.is/api/schema' import { Box, Button, @@ -35,7 +34,9 @@ import { ContentLanguage, GetSupportSearchResultsQuery, GetSupportSearchResultsQueryVariables, + Organizations, SearchableContentTypes, + SupportCategory, SupportQna, } from '@island.is/web/graphql/schema' import { useNamespace } from '@island.is/web/hooks' diff --git a/apps/web/components/TableOfContents/TableOfContents.tsx b/apps/web/components/TableOfContents/TableOfContents.tsx index ca369e5327a4..0a2c3a607cf6 100644 --- a/apps/web/components/TableOfContents/TableOfContents.tsx +++ b/apps/web/components/TableOfContents/TableOfContents.tsx @@ -1,7 +1,7 @@ import { FC, useMemo } from 'react' -import { Slice } from '@island.is/api/schema' import { TableOfContents } from '@island.is/island-ui/core' +import { Slice } from '@island.is/web/graphql/schema' import { scrollTo } from '@island.is/web/hooks/useScrollSpy' export const TOC: FC< diff --git a/apps/web/components/connected/electronicRegistrationStatistics/MonthlyStatistics/MonthlyStatistics.tsx b/apps/web/components/connected/electronicRegistrationStatistics/MonthlyStatistics/MonthlyStatistics.tsx index d908a790f705..4c7774129788 100644 --- a/apps/web/components/connected/electronicRegistrationStatistics/MonthlyStatistics/MonthlyStatistics.tsx +++ b/apps/web/components/connected/electronicRegistrationStatistics/MonthlyStatistics/MonthlyStatistics.tsx @@ -3,7 +3,6 @@ import { Bar, BarChart, Legend, Tooltip, XAxis, YAxis } from 'recharts' import { useQuery } from '@apollo/client' import { BrokenDownRegistrationStatisticResponse } from '@island.is/api/domains/electronic-registration-statistics' -import { ConnectedComponent } from '@island.is/api/schema' import { Box, GridColumn, @@ -12,13 +11,13 @@ import { LoadingDots, Select, } from '@island.is/island-ui/core' +import { ConnectedComponent } from '@island.is/web/graphql/schema' import { useNamespace } from '@island.is/web/hooks' import { GET_BROKEN_DOWN_ELECTRONIC_REGISTRATION_STATISTICS_QUERY } from '../queries' +import { CustomLegend } from './CustomLegend' import { CustomTooltip } from './CustomTooltip' import { extractRegistrationTypesFromData } from './utils' -import { CustomLegend } from './CustomLegend' - import * as styles from './MonthlyStatistics.css' type QueryType = { diff --git a/apps/web/components/connected/fiskistofa/ShipSearch/ShipSearch.tsx b/apps/web/components/connected/fiskistofa/ShipSearch/ShipSearch.tsx index 1b0b913f9bd7..01c60d44f4fc 100644 --- a/apps/web/components/connected/fiskistofa/ShipSearch/ShipSearch.tsx +++ b/apps/web/components/connected/fiskistofa/ShipSearch/ShipSearch.tsx @@ -3,11 +3,6 @@ import { useIntl } from 'react-intl' import { useRouter } from 'next/router' import { useLazyQuery } from '@apollo/client' -import { - FiskistofaShipBasicInfo as ShipBasicInfo, - FiskistofaShipBasicInfoResponse, - QueryFiskistofaGetShipsArgs as QueryGetShipsArgs, -} from '@island.is/api/schema' import { Box, Button, @@ -17,6 +12,11 @@ import { Text, } from '@island.is/island-ui/core' import { shouldLinkOpenInNewWindow } from '@island.is/shared/utils' +import { + FiskistofaShipBasicInfo as ShipBasicInfo, + FiskistofaShipBasicInfoResponse, + QueryFiskistofaGetShipsArgs as QueryGetShipsArgs, +} from '@island.is/web/graphql/schema' import { GET_SHIPS_QUERY } from './queries' import { translation as translationStrings } from './translation.strings' diff --git a/apps/web/components/connected/fiskistofa/calculators/CatchQuotaCalculator/CatchQuotaCalculator.tsx b/apps/web/components/connected/fiskistofa/calculators/CatchQuotaCalculator/CatchQuotaCalculator.tsx index 9908a6482890..0ee7127ceaef 100644 --- a/apps/web/components/connected/fiskistofa/calculators/CatchQuotaCalculator/CatchQuotaCalculator.tsx +++ b/apps/web/components/connected/fiskistofa/calculators/CatchQuotaCalculator/CatchQuotaCalculator.tsx @@ -4,7 +4,6 @@ import cn from 'classnames' import { useRouter } from 'next/router' import { useMachine } from '@xstate/react' -import { FiskistofaExtendedCatchQuotaCategory as ExtendedCatchQuotaCategory } from '@island.is/api/schema' import { Box, Button, @@ -14,6 +13,7 @@ import { Tag, Text, } from '@island.is/island-ui/core' +import { FiskistofaExtendedCatchQuotaCategory as ExtendedCatchQuotaCategory } from '@island.is/web/graphql/schema' import { formattedNumberStringToNumber, diff --git a/apps/web/components/connected/fiskistofa/calculators/CatchQuotaCalculator/machine.ts b/apps/web/components/connected/fiskistofa/calculators/CatchQuotaCalculator/machine.ts index 37a303719bc7..128ab7f88c19 100644 --- a/apps/web/components/connected/fiskistofa/calculators/CatchQuotaCalculator/machine.ts +++ b/apps/web/components/connected/fiskistofa/calculators/CatchQuotaCalculator/machine.ts @@ -1,19 +1,21 @@ +import { assign, createMachine } from 'xstate' import { ApolloClient } from '@apollo/client' -import { createMachine, assign } from 'xstate' + +import { sortAlpha } from '@island.is/shared/utils' +import initApollo from '@island.is/web/graphql/client' import { FiskistofaCatchQuotaCategory as CatchQuotaCategory, FiskistofaExtendedCatchQuotaCategory as ExtendedCatchQuotaCategory, - QueryFiskistofaUpdateShipStatusForTimePeriodArgs as QueryUpdateShipStatusForTimePeriodArgs, - QueryFiskistofaGetShipStatusForTimePeriodArgs as QueryGetShipStatusForTimePeriodArgs, - FiskistofaQuotaType as QuotaType, - FiskistofaShip as Ship, - QueryFiskistofaUpdateShipQuotaStatusForTimePeriodArgs as QueryUpdateShipQuotaStatusForTimePeriodArgs, FiskistofaExtendedShipStatusInformationResponse, - FiskistofaQuotaTypeResponse, FiskistofaExtendedShipStatusInformationUpdateResponse, FiskistofaQuotaStatusResponse, -} from '@island.is/api/schema' -import { sortAlpha } from '@island.is/shared/utils' + FiskistofaQuotaType as QuotaType, + FiskistofaQuotaTypeResponse, + FiskistofaShip as Ship, + QueryFiskistofaGetShipStatusForTimePeriodArgs as QueryGetShipStatusForTimePeriodArgs, + QueryFiskistofaUpdateShipQuotaStatusForTimePeriodArgs as QueryUpdateShipQuotaStatusForTimePeriodArgs, + QueryFiskistofaUpdateShipStatusForTimePeriodArgs as QueryUpdateShipStatusForTimePeriodArgs, +} from '@island.is/web/graphql/schema' import { GET_QUOTA_TYPES_FOR_TIME_PERIOD, @@ -21,7 +23,6 @@ import { UPDATE_SHIP_QUOTA_STATUS_FOR_TIME_PERIOD, UPDATE_SHIP_STATUS_FOR_TIME_PERIOD, } from '../queries' -import initApollo from '@island.is/web/graphql/client' type ContextData = { shipInformation?: Ship diff --git a/apps/web/components/connected/fiskistofa/calculators/StraddlingStockCalculator/StraddlingStockCalculator.tsx b/apps/web/components/connected/fiskistofa/calculators/StraddlingStockCalculator/StraddlingStockCalculator.tsx index c9645a528052..3c1b664de956 100644 --- a/apps/web/components/connected/fiskistofa/calculators/StraddlingStockCalculator/StraddlingStockCalculator.tsx +++ b/apps/web/components/connected/fiskistofa/calculators/StraddlingStockCalculator/StraddlingStockCalculator.tsx @@ -4,7 +4,6 @@ import cn from 'classnames' import { useRouter } from 'next/router' import { useMachine } from '@xstate/react' -import { FiskistofaCatchQuotaCategory as CatchQuotaCategory } from '@island.is/api/schema' import { Box, Button, @@ -14,6 +13,7 @@ import { Tag, Text, } from '@island.is/island-ui/core' +import { FiskistofaCatchQuotaCategory as CatchQuotaCategory } from '@island.is/web/graphql/schema' import { getYearOptions, diff --git a/apps/web/components/connected/fiskistofa/calculators/StraddlingStockCalculator/machine.ts b/apps/web/components/connected/fiskistofa/calculators/StraddlingStockCalculator/machine.ts index de2824bdd3f2..8aa16c587930 100644 --- a/apps/web/components/connected/fiskistofa/calculators/StraddlingStockCalculator/machine.ts +++ b/apps/web/components/connected/fiskistofa/calculators/StraddlingStockCalculator/machine.ts @@ -1,16 +1,18 @@ +import { assign, createMachine } from 'xstate' import { ApolloClient } from '@apollo/client' + +import { sortAlpha } from '@island.is/shared/utils' +import initApollo from '@island.is/web/graphql/client' import { FiskistofaCatchQuotaCategory as CatchQuotaCategory, - QueryFiskistofaUpdateShipStatusForCalendarYearArgs as QueryUpdateShipStatusForCalendarYearArgs, - QueryFiskistofaGetShipStatusForCalendarYearArgs as QueryGetShipStatusForCalendarYearArgs, FiskistofaQuotaType as QuotaType, + FiskistofaQuotaTypeResponse, FiskistofaShip as Ship, FiskistofaShipStatusInformationResponse, - FiskistofaQuotaTypeResponse, -} from '@island.is/api/schema' -import { sortAlpha } from '@island.is/shared/utils' -import initApollo from '@island.is/web/graphql/client' -import { createMachine, assign } from 'xstate' + QueryFiskistofaGetShipStatusForCalendarYearArgs as QueryGetShipStatusForCalendarYearArgs, + QueryFiskistofaUpdateShipStatusForCalendarYearArgs as QueryUpdateShipStatusForCalendarYearArgs, +} from '@island.is/web/graphql/schema' + import { GET_QUOTA_TYPES_FOR_CALENDAR_YEAR, GET_SHIP_STATUS_FOR_CALENDAR_YEAR, diff --git a/apps/web/components/connected/syslumenn/TableLists/BrokersList/BrokersList.tsx b/apps/web/components/connected/syslumenn/TableLists/BrokersList/BrokersList.tsx index e8a12bb7bc0f..2e31ca599676 100644 --- a/apps/web/components/connected/syslumenn/TableLists/BrokersList/BrokersList.tsx +++ b/apps/web/components/connected/syslumenn/TableLists/BrokersList/BrokersList.tsx @@ -2,7 +2,6 @@ import { CSSProperties, FC, useState } from 'react' import { useIntl } from 'react-intl' import { useQuery } from '@apollo/client/react' -import { ConnectedComponent, Query } from '@island.is/api/schema' import { AlertMessage, Box, @@ -13,6 +12,7 @@ import { Text, } from '@island.is/island-ui/core' import { sortAlpha } from '@island.is/shared/utils' +import { ConnectedComponent, Query } from '@island.is/web/graphql/schema' import { GET_BROKERS_QUERY } from './queries' import { translation as t } from './translation.strings' diff --git a/apps/web/components/connected/syslumenn/TableLists/JourneymanList/JourneymanList.tsx b/apps/web/components/connected/syslumenn/TableLists/JourneymanList/JourneymanList.tsx index 23162b629e9b..d9c09ee629ee 100644 --- a/apps/web/components/connected/syslumenn/TableLists/JourneymanList/JourneymanList.tsx +++ b/apps/web/components/connected/syslumenn/TableLists/JourneymanList/JourneymanList.tsx @@ -3,7 +3,6 @@ import { useIntl } from 'react-intl' import { useQueryState } from 'next-usequerystate' import { useQuery } from '@apollo/client/react' -import { ConnectedComponent, Query } from '@island.is/api/schema' import { AlertMessage, Box, @@ -19,7 +18,11 @@ import { } from '@island.is/island-ui/core' import { sortAlpha } from '@island.is/shared/utils' import { SyslumennListCsvExport } from '@island.is/web/components' -import { JourneymanLicence } from '@island.is/web/graphql/schema' +import { + ConnectedComponent, + JourneymanLicence, + Query, +} from '@island.is/web/graphql/schema' import { useDateUtils } from '@island.is/web/i18n/useDateUtils' import { diff --git a/apps/web/components/connected/syslumenn/TableLists/MasterList/MasterList.tsx b/apps/web/components/connected/syslumenn/TableLists/MasterList/MasterList.tsx index 6977134bfa54..bd7a11b81aea 100644 --- a/apps/web/components/connected/syslumenn/TableLists/MasterList/MasterList.tsx +++ b/apps/web/components/connected/syslumenn/TableLists/MasterList/MasterList.tsx @@ -3,7 +3,6 @@ import { useIntl } from 'react-intl' import { useQueryState } from 'next-usequerystate' import { useQuery } from '@apollo/client/react' -import { ConnectedComponent, Query } from '@island.is/api/schema' import { AlertMessage, Box, @@ -19,6 +18,7 @@ import { } from '@island.is/island-ui/core' import { sortAlpha } from '@island.is/shared/utils' import { SyslumennListCsvExport } from '@island.is/web/components' +import { ConnectedComponent, Query } from '@island.is/web/graphql/schema' import { MasterLicence } from '@island.is/web/graphql/schema' import { useDateUtils } from '@island.is/web/i18n/useDateUtils' diff --git a/apps/web/components/connected/syslumenn/utils/search.ts b/apps/web/components/connected/syslumenn/utils/search.ts index 835f4f63c8f5..0e7c0b50d9b5 100644 --- a/apps/web/components/connected/syslumenn/utils/search.ts +++ b/apps/web/components/connected/syslumenn/utils/search.ts @@ -19,9 +19,7 @@ export const textSearch = ( ) } -export const getSortedAndFilteredList = < - T extends Record, ->( +export const getSortedAndFilteredList = ( list: T[], searchTerms: string[], keys: (keyof T)[], @@ -30,13 +28,15 @@ export const getSortedAndFilteredList = < const startsWithFullSearchString = (item: T): boolean => { return keys.some((key) => - item[key]?.trim().toLowerCase().startsWith(fullSearchString), + (item[key] as string)?.trim().toLowerCase().startsWith(fullSearchString), ) } const containsAllTerms = (item: T): boolean => { return searchTerms.every((searchTerm) => - keys.some((key) => item[key]?.trim().toLowerCase().includes(searchTerm)), + keys.some((key) => + (item[key] as string)?.trim().toLowerCase().includes(searchTerm), + ), ) } diff --git a/apps/web/screens/Adgerdir/Article.tsx b/apps/web/screens/Adgerdir/Article.tsx index 7ed5c8ae8f8b..d714ab838c9f 100644 --- a/apps/web/screens/Adgerdir/Article.tsx +++ b/apps/web/screens/Adgerdir/Article.tsx @@ -1,43 +1,44 @@ /* eslint-disable jsx-a11y/anchor-is-valid */ -import React, { useRef, useState, useEffect } from 'react' +import React, { useEffect, useRef, useState } from 'react' import { createPortal } from 'react-dom' import NextLink from 'next/link' + +import { richText, Slice as SliceType } from '@island.is/island-ui/contentful' import { - ContentBlock, Box, - Stack, + ContentBlock, Inline, + Stack, Text, } from '@island.is/island-ui/core' -import { richText, Slice as SliceType } from '@island.is/island-ui/contentful' +import { HeadWithSocialSharing } from '@island.is/web/components' import { - Query, - QueryGetNamespaceArgs, ContentLanguage, + Query, QueryGetAdgerdirPageArgs, QueryGetAdgerdirPagesArgs, QueryGetAdgerdirTagsArgs, -} from '@island.is/api/schema' + QueryGetNamespaceArgs, +} from '@island.is/web/graphql/schema' +import { useNamespace } from '@island.is/web/hooks' +import { useI18n } from '@island.is/web/i18n' import { withMainLayout } from '@island.is/web/layouts/main' -import { HeadWithSocialSharing } from '@island.is/web/components' -import AdgerdirArticles from './components/AdgerdirArticles/AdgerdirArticles' -import { Tag } from './components/UI/Tag/Tag' -import { ProcessEntry } from './components/UI/ProcessEntry/ProcessEntry' -import { Breadcrumbs } from './components/UI/Breadcrumbs/Breadcrumbs' -import { ColorSchemeContext } from './components/UI/ColorSchemeContext/ColorSchemeContext' +import { SidebarLayout } from '@island.is/web/screens/Layouts/SidebarLayout' +import { Screen } from '@island.is/web/types' +import { CustomNextError } from '@island.is/web/units/errors' + +import { LinkType, useLinkResolver } from '../../hooks/useLinkResolver' import { GET_ADGERDIR_PAGE_QUERY, - GET_NAMESPACE_QUERY, GET_ADGERDIR_PAGES_QUERY, GET_ADGERDIR_TAGS_QUERY, + GET_NAMESPACE_QUERY, } from '../queries' -import { SidebarLayout } from '@island.is/web/screens/Layouts/SidebarLayout' -import { Screen } from '@island.is/web/types' -import { useI18n } from '@island.is/web/i18n' -import { CustomNextError } from '@island.is/web/units/errors' -import { useNamespace } from '@island.is/web/hooks' -import { LinkType, useLinkResolver } from '../../hooks/useLinkResolver' - +import AdgerdirArticles from './components/AdgerdirArticles/AdgerdirArticles' +import { Breadcrumbs } from './components/UI/Breadcrumbs/Breadcrumbs' +import { ColorSchemeContext } from './components/UI/ColorSchemeContext/ColorSchemeContext' +import { ProcessEntry } from './components/UI/ProcessEntry/ProcessEntry' +import { Tag } from './components/UI/Tag/Tag' import * as covidStyles from './components/UI/styles/styles.css' interface AdgerdirArticleProps { diff --git a/apps/web/screens/Adgerdir/Home.tsx b/apps/web/screens/Adgerdir/Home.tsx index a997a093eab5..753f584f4722 100644 --- a/apps/web/screens/Adgerdir/Home.tsx +++ b/apps/web/screens/Adgerdir/Home.tsx @@ -1,62 +1,61 @@ /* eslint-disable jsx-a11y/anchor-is-valid */ import React from 'react' import NextLink from 'next/link' + +import { Slice as SliceType } from '@island.is/island-ui/contentful' import { Box, + ColorSchemeContext, ContentBlock, - Text, - Stack, GridColumn, - Hidden, - GridRow, GridContainer, - ColorSchemeContext, + GridRow, + Hidden, + Stack, + Text, } from '@island.is/island-ui/core' -import { withMainLayout } from '@island.is/web/layouts/main' -import { Slice as SliceType } from '@island.is/island-ui/contentful' +import { Locale } from '@island.is/shared/types' import { - RichText, - HeadWithSocialSharing, Header, + HeadWithSocialSharing, Main, + RichText, } from '@island.is/web/components' -import AdgerdirArticles from './components/AdgerdirArticles/AdgerdirArticles' -import GroupedPages from './components/GroupedPages/GroupedPages' -import CardsSlider from './components/CardsSlider/CardsSlider' -import FeaturedNews from './components/FeaturedNews/FeaturedNews' -import { ColorSchemeContext as CovidColorSchemeContext } from './components/UI/ColorSchemeContext/ColorSchemeContext' -import { useI18n } from '@island.is/web/i18n' import { - Query, - QueryGetNamespaceArgs, ContentLanguage, - QueryGetAdgerdirPagesArgs, - QueryGetAdgerdirTagsArgs, - QueryGetGroupedMenuArgs, -} from '@island.is/api/schema' -import { - GET_ADGERDIR_TAGS_QUERY, - GET_NAMESPACE_QUERY, - GET_ADGERDIR_PAGES_QUERY, - GET_ADGERDIR_FRONTPAGE_QUERY, - GET_CATEGORIES_QUERY, -} from '../queries' -import { Screen } from '../../types' -import { useNamespace } from '@island.is/web/hooks' -import { Breadcrumbs } from './components/UI/Breadcrumbs/Breadcrumbs' -import { GetArticleCategoriesQuery, GetGroupedMenuQuery, + Query, + QueryGetAdgerdirPagesArgs, + QueryGetAdgerdirTagsArgs, QueryGetArticleCategoriesArgs, + QueryGetGroupedMenuArgs, + QueryGetNamespaceArgs, } from '@island.is/web/graphql/schema' -import { GET_GROUPED_MENU_QUERY } from '../queries/Menu' -import { Locale } from '@island.is/shared/types' +import { useNamespace } from '@island.is/web/hooks' +import { LinkType, useLinkResolver } from '@island.is/web/hooks/useLinkResolver' +import { useI18n } from '@island.is/web/i18n' +import { withMainLayout } from '@island.is/web/layouts/main' import { formatMegaMenuCategoryLinks, formatMegaMenuLinks, } from '@island.is/web/utils/processMenuData' -import { useLinkResolver, LinkType } from '@island.is/web/hooks/useLinkResolver' +import { Screen } from '../../types' +import { + GET_ADGERDIR_FRONTPAGE_QUERY, + GET_ADGERDIR_PAGES_QUERY, + GET_ADGERDIR_TAGS_QUERY, + GET_CATEGORIES_QUERY, + GET_NAMESPACE_QUERY, +} from '../queries' +import { GET_GROUPED_MENU_QUERY } from '../queries/Menu' +import AdgerdirArticles from './components/AdgerdirArticles/AdgerdirArticles' +import CardsSlider from './components/CardsSlider/CardsSlider' +import FeaturedNews from './components/FeaturedNews/FeaturedNews' +import GroupedPages from './components/GroupedPages/GroupedPages' +import { Breadcrumbs } from './components/UI/Breadcrumbs/Breadcrumbs' +import { ColorSchemeContext as CovidColorSchemeContext } from './components/UI/ColorSchemeContext/ColorSchemeContext' import * as covidStyles from './components/UI/styles/styles.css' interface HomeProps { diff --git a/apps/web/screens/Adgerdir/components/AdgerdirArticles/AdgerdirArticles.tsx b/apps/web/screens/Adgerdir/components/AdgerdirArticles/AdgerdirArticles.tsx index e4de43c24734..c2d100eda6a4 100644 --- a/apps/web/screens/Adgerdir/components/AdgerdirArticles/AdgerdirArticles.tsx +++ b/apps/web/screens/Adgerdir/components/AdgerdirArticles/AdgerdirArticles.tsx @@ -1,36 +1,37 @@ import React, { FC, - useState, - useContext, useCallback, + useContext, useEffect, useRef, + useState, } from 'react' -import uniq from 'lodash/uniq' import intersection from 'lodash/intersection' +import uniq from 'lodash/uniq' + import { Box, - Tiles, - Stack, - Text, - Inline, Icon, + Inline, LoadingDots, + Stack, + Text, + Tiles, } from '@island.is/island-ui/core' -import { AdgerdirPage, AdgerdirTag } from '@island.is/api/schema' -import { useNamespace } from '@island.is/web/hooks' -import { Card } from '../UI/Card/Card' -import { Button } from '../UI/Button/Button' -import { Tag } from '../UI/Tag/Tag' -import { ColorSchemeContext } from '../UI/ColorSchemeContext/ColorSchemeContext' import { - ADGERDIR_INDIVIDUALS_TAG_ID, ADGERDIR_COMPANIES_TAG_ID, + ADGERDIR_INDIVIDUALS_TAG_ID, } from '@island.is/web/constants' +import { AdgerdirPage, AdgerdirTag } from '@island.is/web/graphql/schema' +import { useNamespace } from '@island.is/web/hooks' +import { useLinkResolver } from '@island.is/web/hooks/useLinkResolver' -import * as styles from './AdgerdirArticles.css' +import { Button } from '../UI/Button/Button' +import { Card } from '../UI/Card/Card' +import { ColorSchemeContext } from '../UI/ColorSchemeContext/ColorSchemeContext' +import { Tag } from '../UI/Tag/Tag' import * as covidStyles from '../UI/styles/styles.css' -import { useLinkResolver } from '@island.is/web/hooks/useLinkResolver' +import * as styles from './AdgerdirArticles.css' const FILTER_TIMER = 300 const ITEMS_PER_SHOW = 9 diff --git a/apps/web/screens/Adgerdir/components/CardsSlider/CardsSlider.tsx b/apps/web/screens/Adgerdir/components/CardsSlider/CardsSlider.tsx index d9bf856ba838..b1b0cebc776e 100644 --- a/apps/web/screens/Adgerdir/components/CardsSlider/CardsSlider.tsx +++ b/apps/web/screens/Adgerdir/components/CardsSlider/CardsSlider.tsx @@ -1,23 +1,25 @@ import React, { FC, - useState, - useEffect, - useRef, useCallback, useContext, + useEffect, + useRef, + useState, } from 'react' -import cn from 'classnames' import AliceCarousel, { EventObject } from 'react-alice-carousel' -import { Icon, Inline, Hidden } from '@island.is/island-ui/core' -import { AdgerdirPage } from '@island.is/api/schema' +import cn from 'classnames' + +import { Hidden, Icon, Inline } from '@island.is/island-ui/core' +import { AdgerdirPage } from '@island.is/web/graphql/schema' +import { useLinkResolver } from '@island.is/web/hooks/useLinkResolver' + +import { Card } from '../UI/Card/Card' import { ColorSchemeContext, ColorSchemes, } from '../UI/ColorSchemeContext/ColorSchemeContext' -import { Card } from '../UI/Card/Card' import 'react-alice-carousel/lib/alice-carousel.css' import * as styles from './CardsSlider.css' -import { useLinkResolver } from '@island.is/web/hooks/useLinkResolver' interface StagePaddingProps { paddingLeft: number diff --git a/apps/web/screens/Adgerdir/components/FeaturedNews/FeaturedNews.tsx b/apps/web/screens/Adgerdir/components/FeaturedNews/FeaturedNews.tsx index 08cef8518b28..b521a73659a5 100644 --- a/apps/web/screens/Adgerdir/components/FeaturedNews/FeaturedNews.tsx +++ b/apps/web/screens/Adgerdir/components/FeaturedNews/FeaturedNews.tsx @@ -1,21 +1,22 @@ import React, { FC } from 'react' import format from 'date-fns/format' import is from 'date-fns/locale/is' + import { Box, + Button, + GridColumn, GridContainer, GridRow, - GridColumn, - Stack, - Button, Link, + Stack, } from '@island.is/island-ui/core' -import { News } from '@island.is/api/schema' import { BackgroundImage } from '@island.is/web/components' -import AdgerdirHeading from '../AdgerdirHeading/AdgerdirHeading' +import { News } from '@island.is/web/graphql/schema' +import { useLinkResolver } from '@island.is/web/hooks/useLinkResolver' +import AdgerdirHeading from '../AdgerdirHeading/AdgerdirHeading' import * as styles from './FeaturedNews.css' -import { useLinkResolver } from '@island.is/web/hooks/useLinkResolver' interface FeaturedNewsProps { items: Array diff --git a/apps/web/screens/Adgerdir/components/LatestNews/LatestNews.tsx b/apps/web/screens/Adgerdir/components/LatestNews/LatestNews.tsx index 91cc3f50b757..75e627b127e6 100644 --- a/apps/web/screens/Adgerdir/components/LatestNews/LatestNews.tsx +++ b/apps/web/screens/Adgerdir/components/LatestNews/LatestNews.tsx @@ -1,7 +1,9 @@ import React, { FC } from 'react' -import { Text, Box, Stack, Tiles } from '@island.is/island-ui/core' + +import { Box, Stack, Text, Tiles } from '@island.is/island-ui/core' +import { Image } from '@island.is/web/graphql/schema' import { useDateUtils } from '@island.is/web/i18n/useDateUtils' -import { Image } from '@island.is/api/schema' + import * as styles from './LatestNews.css' export interface LatestNewsItem { diff --git a/apps/web/screens/Home/Home.tsx b/apps/web/screens/Home/Home.tsx index 98bd37bb102a..a6b9087537ea 100644 --- a/apps/web/screens/Home/Home.tsx +++ b/apps/web/screens/Home/Home.tsx @@ -1,34 +1,36 @@ import React, { useContext } from 'react' -import { Box, GridContainer } from '@island.is/island-ui/core' -import { useI18n } from '@island.is/web/i18n' -import { Screen } from '@island.is/web/types' -import { useNamespace } from '@island.is/web/hooks' + +import { Box } from '@island.is/island-ui/core' +import { Locale } from '@island.is/shared/types' +import { + CategoryItems, + LifeEventsSection, + NewsItems, + SearchSection, + WatsonChatPanel, +} from '@island.is/web/components' +import { FRONTPAGE_NEWS_TAG_ID } from '@island.is/web/constants' +import { GlobalContext } from '@island.is/web/context' import { ContentLanguage, - QueryGetArticleCategoriesArgs, GetArticleCategoriesQuery, GetFrontpageQuery, - QueryGetFrontpageArgs, GetNewsQuery, + LifeEventPage, + QueryGetArticleCategoriesArgs, + QueryGetFrontpageArgs, + QueryGetNewsArgs, } from '@island.is/web/graphql/schema' +import { useNamespace } from '@island.is/web/hooks' +import { useI18n } from '@island.is/web/i18n' +import { withMainLayout } from '@island.is/web/layouts/main' import { GET_CATEGORIES_QUERY, GET_FRONTPAGE_QUERY, GET_NEWS_QUERY, } from '@island.is/web/screens/queries' -import { - SearchSection, - CategoryItems, - NewLinks, - NewsItems, - LifeEventsSection, - WatsonChatPanel, -} from '@island.is/web/components' -import { withMainLayout } from '@island.is/web/layouts/main' -import { GlobalContext } from '@island.is/web/context' -import { LifeEventPage, QueryGetNewsArgs } from '@island.is/api/schema' -import { FRONTPAGE_NEWS_TAG_ID } from '@island.is/web/constants' -import { Locale } from '@island.is/shared/types' +import { Screen } from '@island.is/web/types' + import { watsonConfig } from './config' interface HomeProps { diff --git a/apps/web/screens/LifeEvents/LifeEvents.tsx b/apps/web/screens/LifeEvents/LifeEvents.tsx index addb8d04ed0e..3a09ba86d373 100644 --- a/apps/web/screens/LifeEvents/LifeEvents.tsx +++ b/apps/web/screens/LifeEvents/LifeEvents.tsx @@ -1,9 +1,5 @@ import Head from 'next/head' -import { - ContentLanguage, - QueryGetLifeEventsForOverviewArgs, -} from '@island.is/api/schema' import { Breadcrumbs, GridColumn, @@ -13,8 +9,10 @@ import { } from '@island.is/island-ui/core' import { CardWithFeaturedItems, GridItems } from '@island.is/web/components' import { + ContentLanguage, type GetLifeEventsForOverviewQuery, type GetNamespaceQuery, + QueryGetLifeEventsForOverviewArgs, type QueryGetNamespaceArgs, } from '@island.is/web/graphql/schema' import { diff --git a/apps/web/screens/Login/Login.tsx b/apps/web/screens/Login/Login.tsx index 67801a360987..40bbe2f4dd2e 100644 --- a/apps/web/screens/Login/Login.tsx +++ b/apps/web/screens/Login/Login.tsx @@ -1,23 +1,25 @@ import React from 'react' + import { - GridContainer, Box, + Bullet, + BulletList, + Button, + ContentBlock, GridColumn, + GridContainer, GridRow, - Text, - ContentBlock, - Button, Hidden, - BulletList, - Bullet, + Text, } from '@island.is/island-ui/core' +import { webLoginButtonSelect } from '@island.is/plausible' import { SvgLogin } from '@island.is/web/components' import { LoginPageTexts } from '@island.is/web/components' -import { Screen } from '@island.is/web/types' -import { withMainLayout } from '@island.is/web/layouts/main' +import { Query, QueryGetNamespaceArgs } from '@island.is/web/graphql/schema' import { useNamespaceStrict as useNamespace } from '@island.is/web/hooks' -import { Query, QueryGetNamespaceArgs } from '@island.is/api/schema' -import { webLoginButtonSelect } from '@island.is/plausible' +import { withMainLayout } from '@island.is/web/layouts/main' +import { Screen } from '@island.is/web/types' + import { GET_NAMESPACE_QUERY } from '../queries' import * as styles from './Login.css' diff --git a/apps/web/screens/OfficialJournalOfIceland/hooks/useAdverts.ts b/apps/web/screens/OfficialJournalOfIceland/hooks/useAdverts.ts index 235c26397441..97b20131365b 100644 --- a/apps/web/screens/OfficialJournalOfIceland/hooks/useAdverts.ts +++ b/apps/web/screens/OfficialJournalOfIceland/hooks/useAdverts.ts @@ -3,7 +3,7 @@ import { useQuery } from '@apollo/client' import { OfficialJournalOfIcelandAdvert, OfficialJournalOfIcelandAdvertsResponse, -} from '@island.is/api/schema' +} from '@island.is/web/graphql/schema' import { ADVERTS_QUERY } from '../../queries/OfficialJournalOfIceland' import { getAdvertParams } from '../lib/advert-params.mapper' diff --git a/apps/web/screens/Organization/SocialInsuranceAdministration/PensionCalculator.tsx b/apps/web/screens/Organization/SocialInsuranceAdministration/PensionCalculator.tsx index 2dfab0c78d4e..b22fcf8e8255 100644 --- a/apps/web/screens/Organization/SocialInsuranceAdministration/PensionCalculator.tsx +++ b/apps/web/screens/Organization/SocialInsuranceAdministration/PensionCalculator.tsx @@ -6,7 +6,6 @@ import differenceInMonths from 'date-fns/differenceInMonths' import { useRouter } from 'next/router' import { useQueryState } from 'next-usequerystate' -import { CustomPageUniqueIdentifier } from '@island.is/api/schema' import { Box, Button, @@ -26,6 +25,7 @@ import { import { sortAlpha } from '@island.is/shared/utils' import { getThemeConfig, MarkdownText } from '@island.is/web/components' import { + CustomPageUniqueIdentifier, Organization, OrganizationPage, Query, diff --git a/apps/web/screens/Organization/StafraentIsland/ApiCatalogue.tsx b/apps/web/screens/Organization/StafraentIsland/ApiCatalogue.tsx index fd68e393a59a..7373d5adb7e6 100644 --- a/apps/web/screens/Organization/StafraentIsland/ApiCatalogue.tsx +++ b/apps/web/screens/Organization/StafraentIsland/ApiCatalogue.tsx @@ -1,5 +1,17 @@ /* eslint-disable jsx-a11y/anchor-is-valid */ import { ReactNode, useEffect, useState } from 'react' +import { useWindowSize } from 'react-use' +import { useRouter } from 'next/router' +import { useQuery } from '@apollo/client' +import { INLINES } from '@contentful/rich-text-types' + +import { + AccessCategory, + DataCategory, + PricingCategory, + TypeCategory, +} from '@island.is/api-catalogue/consts' +import { SliceType } from '@island.is/island-ui/contentful' import { ArrowLink, Box, @@ -10,49 +22,37 @@ import { NavigationItem, Text, } from '@island.is/island-ui/core' -import { withMainLayout } from '@island.is/web/layouts/main' +import { theme } from '@island.is/island-ui/theme' +import { + ApiCatalogueFilter, + OrganizationWrapper, + ServiceList, + Webreader, +} from '@island.is/web/components' import { ContentLanguage, + GetApiCatalogueInput, GetNamespaceQuery, Query, + QueryGetApiCatalogueArgs, QueryGetNamespaceArgs, QueryGetOrganizationPageArgs, QueryGetOrganizationSubpageArgs, } from '@island.is/web/graphql/schema' +import { useNamespace } from '@island.is/web/hooks' +import useContentfulId from '@island.is/web/hooks/useContentfulId' +import { useLinkResolver } from '@island.is/web/hooks/useLinkResolver' +import { withMainLayout } from '@island.is/web/layouts/main' +import { CustomNextError } from '@island.is/web/units/errors' +import { webRichText } from '@island.is/web/utils/richText' + +import { Screen } from '../../../types' import { GET_CATALOGUE_QUERY, GET_NAMESPACE_QUERY, GET_ORGANIZATION_PAGE_QUERY, GET_ORGANIZATION_SUBPAGE_QUERY, } from '../../queries' -import { Screen } from '../../../types' -import { useLinkResolver } from '@island.is/web/hooks/useLinkResolver' -import { - ApiCatalogueFilter, - OrganizationWrapper, - ServiceList, - Webreader, -} from '@island.is/web/components' -import { CustomNextError } from '@island.is/web/units/errors' -import { SliceType } from '@island.is/island-ui/contentful' -import { useNamespace } from '@island.is/web/hooks' -import { - GetApiCatalogueInput, - QueryGetApiCatalogueArgs, -} from '@island.is/api/schema' -import { useQuery } from '@apollo/client' -import { - AccessCategory, - DataCategory, - PricingCategory, - TypeCategory, -} from '@island.is/api-catalogue/consts' -import { useRouter } from 'next/router' -import { INLINES } from '@contentful/rich-text-types' -import { useWindowSize } from 'react-use' -import { theme } from '@island.is/island-ui/theme' -import useContentfulId from '@island.is/web/hooks/useContentfulId' -import { webRichText } from '@island.is/web/utils/richText' const LIMIT = 20