-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(resource-adm): Remove imports of designsystemet react components #14381
base: main
Are you sure you want to change the base?
Changes from 7 commits
17da7f5
066cbc7
f7cc01d
20b7782
70644dc
d40ccfd
f263cec
580c613
c2fb764
481a2cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,11 +1,10 @@ | ||||||
import React from 'react'; | ||||||
import { useTranslation } from 'react-i18next'; | ||||||
import { Alert, List, Paragraph } from '@digdir/designsystemet-react'; | ||||||
import { getResourcePageURL } from '../../utils/urlUtils'; | ||||||
import { useUrlParams } from '../../hooks/useUrlParams'; | ||||||
import { getAvailableEnvironments } from '../../utils/resourceUtils'; | ||||||
import { useResourcePolicyPublishStatusQuery } from '../../hooks/queries'; | ||||||
import { StudioSpinner } from '@studio/components'; | ||||||
import { StudioSpinner, StudioAlert, StudioList, StudioParagraph } from '@studio/components'; | ||||||
import { ArrowForwardIcon } from '@studio/icons'; | ||||||
import classes from './AccessListEnvLinks.module.css'; | ||||||
import { ButtonRouterLink } from 'app-shared/components/ButtonRouterLink'; | ||||||
|
@@ -35,20 +34,20 @@ export const AccessListEnvLinks = (): React.JSX.Element => { | |||||
{publishStatusData && ( | ||||||
<> | ||||||
{envPublishStatus.some((env) => !env.isResourcePublished) && ( | ||||||
<Alert severity='warning'> | ||||||
<Paragraph size='small' spacing> | ||||||
<StudioAlert severity='warning'> | ||||||
<StudioParagraph size='small' spacing> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can see this is a case for more files in this PR, can you please update in all of them? 😄
Suggested change
|
||||||
{t('resourceadm.about_resource_rrr_publish_warning')} | ||||||
</Paragraph> | ||||||
<List.Root size='small'> | ||||||
<List.Unordered> | ||||||
</StudioParagraph> | ||||||
<StudioList.Root size='small'> | ||||||
<StudioList.Unordered> | ||||||
{envPublishStatus | ||||||
.filter((env) => !env.isResourcePublished) | ||||||
.map((env) => ( | ||||||
<List.Item key={env.id}>{t(env.label)}</List.Item> | ||||||
<StudioList.Item key={env.id}>{t(env.label)}</StudioList.Item> | ||||||
))} | ||||||
</List.Unordered> | ||||||
</List.Root> | ||||||
</Alert> | ||||||
</StudioList.Unordered> | ||||||
</StudioList.Root> | ||||||
</StudioAlert> | ||||||
)} | ||||||
{envPublishStatus | ||||||
.filter((env) => env.isResourcePublished) | ||||||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -1,16 +1,21 @@ | ||||
import React, { useEffect, useState } from 'react'; | ||||
import { useTranslation } from 'react-i18next'; | ||||
import { toast } from 'react-toastify'; | ||||
import { Alert, Textfield, Radio } from '@digdir/designsystemet-react'; | ||||
import classes from './AccessListMembers.module.css'; | ||||
import type { AccessList, AccessListMember, ResourceError } from 'app-shared/types/ResourceAdm'; | ||||
import { FieldWrapper } from '../FieldWrapper'; | ||||
import { useRemoveAccessListMemberMutation } from '../../hooks/mutations/useRemoveAccessListMemberMutation'; | ||||
import { useAddAccessListMemberMutation } from '../../hooks/mutations/useAddAccessListMemberMutation'; | ||||
import { usePartiesRegistryQuery } from '../../hooks/queries/usePartiesRegistryQuery'; | ||||
import { useSubPartiesRegistryQuery } from '../../hooks/queries/useSubPartiesRegistryQuery'; | ||||
import { getPartiesQueryUrl } from '../../utils/urlUtils'; | ||||
import { StudioButton } from '@studio/components'; | ||||
import { | ||||
StudioAlert, | ||||
StudioButton, | ||||
StudioLabelAsParagraph, | ||||
StudioParagraph, | ||||
StudioRadio, | ||||
StudioTextfield, | ||||
} from '@studio/components'; | ||||
import { useDebounce } from '@studio/hooks'; | ||||
import { PlusIcon } from '@studio/icons'; | ||||
import { AccessListMembersPaging } from './AccessListMembersPaging'; | ||||
|
@@ -162,10 +167,14 @@ export const AccessListMembers = ({ | |||
const resultData = getResultData(); | ||||
|
||||
return ( | ||||
<FieldWrapper | ||||
label={t('resourceadm.listadmin_list_organizations')} | ||||
description={t('resourceadm.listadmin_list_organizations_description')} | ||||
> | ||||
<div> | ||||
<StudioLabelAsParagraph size='small' spacing> | ||||
{t('resourceadm.listadmin_list_organizations')} | ||||
</StudioLabelAsParagraph> | ||||
|
||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
<StudioParagraph variant='short' size='small'> | ||||
{t('resourceadm.listadmin_list_organizations_description')} | ||||
</StudioParagraph> | ||||
<AccessListMembersTable | ||||
listItems={getMergedMembersData()} | ||||
isLoading={isRemovingMember} | ||||
|
@@ -183,40 +192,43 @@ export const AccessListMembers = ({ | |||
</StudioButton> | ||||
)} | ||||
{!!members && members.pages?.length === 0 && ( | ||||
<Alert severity='info'>{t('resourceadm.listadmin_empty_list')}</Alert> | ||||
<StudioAlert severity='info'>{t('resourceadm.listadmin_empty_list')}</StudioAlert> | ||||
)} | ||||
{isAddMode && ( | ||||
<> | ||||
<div className={classes.searchWrapper}> | ||||
<FieldWrapper label={t('resourceadm.listadmin_search')} fieldId='party-search'> | ||||
<Textfield | ||||
id='party-search' | ||||
value={searchText} | ||||
onChange={(event) => { | ||||
debounce(() => setDebouncedSearchText(event.target.value)); | ||||
setSearchText(event.target.value); | ||||
}} | ||||
/> | ||||
<div className={classes.noSearchResults} aria-live='polite'> | ||||
{resultData?.parties?.length === 0 && ( | ||||
<div> | ||||
{isSubPartySearch | ||||
? t('resourceadm.listadmin_search_no_sub_parties') | ||||
: t('resourceadm.listadmin_search_no_parties')} | ||||
</div> | ||||
)} | ||||
</div> | ||||
</FieldWrapper> | ||||
<Radio.Group | ||||
<StudioTextfield | ||||
size='sm' | ||||
label={t('resourceadm.listadmin_search')} | ||||
value={searchText} | ||||
onChange={(event) => { | ||||
debounce(() => setDebouncedSearchText(event.target.value)); | ||||
setSearchText(event.target.value); | ||||
}} | ||||
/> | ||||
<div className={classes.noSearchResults} aria-live='polite'> | ||||
{resultData?.parties?.length === 0 && ( | ||||
<div> | ||||
{isSubPartySearch | ||||
? t('resourceadm.listadmin_search_no_sub_parties') | ||||
: t('resourceadm.listadmin_search_no_parties')} | ||||
</div> | ||||
)} | ||||
</div> | ||||
<StudioRadio.Group | ||||
hideLegend | ||||
onChange={() => setIsSubPartySearch((old) => !old)} | ||||
value={isSubPartySearch ? SUBPARTY_SEARCH_TYPE : PARTY_SEARCH_TYPE} | ||||
inline | ||||
legend={t('resourceadm.listadmin_search_party_type')} | ||||
> | ||||
<Radio value={PARTY_SEARCH_TYPE}>{t('resourceadm.listadmin_parties')}</Radio> | ||||
<Radio value={SUBPARTY_SEARCH_TYPE}>{t('resourceadm.listadmin_sub_parties')}</Radio> | ||||
</Radio.Group> | ||||
<StudioRadio value={PARTY_SEARCH_TYPE}> | ||||
{t('resourceadm.listadmin_parties')} | ||||
</StudioRadio> | ||||
<StudioRadio value={SUBPARTY_SEARCH_TYPE}> | ||||
{t('resourceadm.listadmin_sub_parties')} | ||||
</StudioRadio> | ||||
</StudioRadio.Group> | ||||
</div> | ||||
<AccessListMembersTable | ||||
isHeaderHidden | ||||
|
@@ -243,6 +255,6 @@ export const AccessListMembers = ({ | |||
</StudioButton> | ||||
</div> | ||||
)} | ||||
</FieldWrapper> | ||||
</div> | ||||
); | ||||
}; |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should change this to
lg
as this is what Designsystemet will support when we update 😄There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha, I thought studio components should continue to support the old size values 😄 I have updated all size values in resourceadm now 😊