-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add broken protectedData indicator #106
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
6eadb06
chore: remove unused code generation script from package.json
ErwanDecoster 17e3109
fix: remove unused NavLink import in protectedDataList component
ErwanDecoster d54fb1c
fix: ensure timestamp is properly converted to number in formatTimest…
ErwanDecoster 5f6350a
feat: add tooltip component
ErwanDecoster 8019aff
feat: add tooltip for missing secret encryption key in protected data
ErwanDecoster ad78471
feat: add CheckSMSRequestSuccess component to display SMS secret status
ErwanDecoster 9435676
feat: wrap CheckSMSRequestSuccess component in a div and add classNam…
ErwanDecoster 5d72f7b
feat: integrate CheckSMSRequestSuccess component into ProtectedDataList
ErwanDecoster 234c7ef
refactor: rename variable hasSmsSecret to smsSecretExists for clarity
ErwanDecoster baeda5c
refactor: standardize state variable naming for grant access modal
ErwanDecoster 3118a2a
refactor: rename variable protectedDatas to protectedDataItems for cl…
ErwanDecoster File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import * as TooltipPrimitive from '@radix-ui/react-tooltip'; | ||
| import * as React from 'react'; | ||
| import { cn } from '../../utils/style.utils.ts'; | ||
|
|
||
| const TooltipProvider = TooltipPrimitive.Provider; | ||
|
|
||
| const Tooltip = TooltipPrimitive.Root; | ||
|
|
||
| const TooltipTrigger = TooltipPrimitive.Trigger; | ||
|
|
||
| const TooltipContent = React.forwardRef< | ||
| React.ElementRef<typeof TooltipPrimitive.Content>, | ||
| React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> | ||
| >(({ className, sideOffset = 4, ...props }, ref) => ( | ||
| <TooltipPrimitive.Content | ||
| ref={ref} | ||
| sideOffset={sideOffset} | ||
| className={cn( | ||
| 'border-grey-600 animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 overflow-hidden rounded-md border bg-[#14141B] p-4 font-sans text-sm text-white shadow-md', | ||
| className | ||
| )} | ||
| {...props} | ||
| /> | ||
| )); | ||
| TooltipContent.displayName = TooltipPrimitive.Content.displayName; | ||
|
|
||
| export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }; |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| import { Address } from '@/types'; | ||
| import { useQuery } from '@tanstack/react-query'; | ||
| import { AlertCircle } from 'react-feather'; | ||
| import { | ||
| Tooltip, | ||
| TooltipContent, | ||
| TooltipProvider, | ||
| TooltipTrigger, | ||
| } from '@/components/ui/tooltip'; | ||
| import { getDataProtectorCoreClient } from '@/externals/iexecSdkClient'; | ||
|
|
||
| export default function CheckSMSRequestSuccess({ | ||
| protectedDataAddress, | ||
| className, | ||
| }: { | ||
| className?: string; | ||
| protectedDataAddress: Address | undefined; | ||
| }) { | ||
| const { | ||
| data: smsSecretExists, | ||
| isSuccess: isSmsRequestSuccess, | ||
| isError: isCheckSmsSecretError, | ||
| } = useQuery({ | ||
| queryKey: ['oneProtectedDataSmsSecret', protectedDataAddress], | ||
| queryFn: async () => { | ||
| const dataProtectorCore = await getDataProtectorCoreClient(); | ||
| // @ts-expect-error 'iexec' is a protected field but that's fine | ||
| return dataProtectorCore.iexec.dataset.checkDatasetSecretExists( | ||
| protectedDataAddress! | ||
| ); | ||
| }, | ||
| enabled: !!protectedDataAddress, | ||
| }); | ||
|
|
||
| return ( | ||
| <div className={className}> | ||
| {isSmsRequestSuccess && !smsSecretExists && !isCheckSmsSecretError && ( | ||
| <TooltipProvider delayDuration={0}> | ||
| <Tooltip> | ||
| <TooltipTrigger className="cursor-default"> | ||
| <AlertCircle size="24" className="text-red-400" /> | ||
| </TooltipTrigger> | ||
| <TooltipContent side="left"> | ||
| This protected data is probably unusable as{' '} | ||
| <strong> | ||
| its secret encryption key was | ||
| <br /> not found | ||
| </strong>{' '} | ||
| in the iExec Secret Management Service (SMS). | ||
| </TooltipContent> | ||
| </Tooltip> | ||
| </TooltipProvider> | ||
| )} | ||
| </div> | ||
| ); | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.