-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(zimbra): add loading to datagrids
ref: MANAGER-15389 Signed-off-by: Tristan WAGNER <[email protected]>
- Loading branch information
1 parent
f523e37
commit f93d5b0
Showing
8 changed files
with
190 additions
and
137 deletions.
There are no files selected for viewing
11 changes: 7 additions & 4 deletions
11
packages/manager/apps/zimbra/src/components/Loading/Loading.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
import React from 'react'; | ||
import { OsdsSpinner } from '@ovhcloud/ods-components/react'; | ||
import { ODS_SPINNER_MODE, ODS_SPINNER_SIZE } from '@ovhcloud/ods-components'; | ||
|
||
export default function Loading() { | ||
return ( | ||
<div className="flex justify-center"> | ||
<div> | ||
<OsdsSpinner /> | ||
</div> | ||
<div className="flex justify-center my-5"> | ||
<OsdsSpinner | ||
mode={ODS_SPINNER_MODE.indeterminate} | ||
size={ODS_SPINNER_SIZE.md} | ||
inline | ||
></OsdsSpinner> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 13 additions & 4 deletions
17
packages/manager/apps/zimbra/src/hooks/useOrganizationsList.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
import { useQuery } from '@tanstack/react-query'; | ||
import { | ||
useQuery, | ||
UseQueryOptions, | ||
UseQueryResult, | ||
} from '@tanstack/react-query'; | ||
import { usePlatform } from '@/hooks'; | ||
import { | ||
getZimbraPlatformOrganization, | ||
getZimbraPlatformOrganizationQueryKey, | ||
OrganizationType, | ||
} from '@/api/organization'; | ||
|
||
export const useOrganizationList = (options = {}) => { | ||
export const useOrganizationList = ( | ||
options: Omit<UseQueryOptions, 'queryKey' | 'queryFn' | 'select'> = {}, | ||
) => { | ||
const { platformId } = usePlatform(); | ||
|
||
return useQuery({ | ||
...options, | ||
queryKey: getZimbraPlatformOrganizationQueryKey(platformId), | ||
queryFn: () => getZimbraPlatformOrganization(platformId), | ||
enabled: !!platformId, | ||
}); | ||
enabled: | ||
(typeof options.enabled !== 'undefined' ? options.enabled : true) && | ||
!!platformId, | ||
}) as UseQueryResult<OrganizationType[]>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.