mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
empty state for workflow with no linear fields in view mode
This commit is contained in:
parent
c4fe7e697b
commit
56fcf6af78
@ -944,6 +944,7 @@
|
|||||||
"doesNotExist": "does not exist",
|
"doesNotExist": "does not exist",
|
||||||
"downloadWorkflow": "Download Workflow JSON",
|
"downloadWorkflow": "Download Workflow JSON",
|
||||||
"edge": "Edge",
|
"edge": "Edge",
|
||||||
|
"edit": "Edit",
|
||||||
"editMode": "Edit in Workflow Editor",
|
"editMode": "Edit in Workflow Editor",
|
||||||
"enum": "Enum",
|
"enum": "Enum",
|
||||||
"enumDescription": "Enums are values that may be one of a number of options.",
|
"enumDescription": "Enums are values that may be one of a number of options.",
|
||||||
@ -1019,6 +1020,7 @@
|
|||||||
"nodeTemplate": "Node Template",
|
"nodeTemplate": "Node Template",
|
||||||
"nodeType": "Node Type",
|
"nodeType": "Node Type",
|
||||||
"noFieldsLinearview": "No fields added to Linear View",
|
"noFieldsLinearview": "No fields added to Linear View",
|
||||||
|
"noFieldsViewMode": "This workflow has no selected fields to display. View the full workflow to configure values.",
|
||||||
"noFieldType": "No field type",
|
"noFieldType": "No field type",
|
||||||
"noImageFoundState": "No initial image found in state",
|
"noImageFoundState": "No initial image found in state",
|
||||||
"noMatchingNodes": "No matching nodes",
|
"noMatchingNodes": "No matching nodes",
|
||||||
|
@ -0,0 +1,55 @@
|
|||||||
|
import { Button, Flex, Text, Image } from '@invoke-ai/ui-library';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { useAppDispatch } from '../../../../../app/store/storeHooks';
|
||||||
|
import { useCallback } from 'react';
|
||||||
|
import { workflowModeChanged } from '../../../store/workflowSlice';
|
||||||
|
import InvokeLogoSVG from 'public/assets/images/invoke-symbol-wht-lrg.svg';
|
||||||
|
|
||||||
|
export const EmptyState = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const dispatch = useAppDispatch();
|
||||||
|
|
||||||
|
const onClick = useCallback(() => {
|
||||||
|
dispatch(workflowModeChanged('edit'));
|
||||||
|
}, [dispatch]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Flex
|
||||||
|
sx={{
|
||||||
|
w: 'full',
|
||||||
|
h: 'full',
|
||||||
|
userSelect: 'none',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Flex
|
||||||
|
sx={{
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
borderRadius: 'base',
|
||||||
|
flexDir: 'column',
|
||||||
|
gap: 5,
|
||||||
|
maxW: '230px',
|
||||||
|
margin: '0 auto',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Image
|
||||||
|
src={InvokeLogoSVG}
|
||||||
|
alt="invoke-ai-logo"
|
||||||
|
opacity={0.2}
|
||||||
|
mixBlendMode="overlay"
|
||||||
|
w={16}
|
||||||
|
h={16}
|
||||||
|
minW={16}
|
||||||
|
minH={16}
|
||||||
|
userSelect="none"
|
||||||
|
/>
|
||||||
|
<Text textAlign="center" fontSize="md">
|
||||||
|
{t('nodes.noFieldsViewMode')}
|
||||||
|
</Text>
|
||||||
|
<Button colorScheme="invokeBlue" onClick={onClick}>
|
||||||
|
{t('nodes.edit')}
|
||||||
|
</Button>
|
||||||
|
</Flex>
|
||||||
|
</Flex>
|
||||||
|
);
|
||||||
|
};
|
@ -8,6 +8,7 @@ import { t } from 'i18next';
|
|||||||
import { useGetOpenAPISchemaQuery } from 'services/api/endpoints/appInfo';
|
import { useGetOpenAPISchemaQuery } from 'services/api/endpoints/appInfo';
|
||||||
|
|
||||||
import WorkflowField from './WorkflowField';
|
import WorkflowField from './WorkflowField';
|
||||||
|
import { EmptyState } from './EmptyState';
|
||||||
|
|
||||||
const selector = createMemoizedSelector(selectWorkflowSlice, (workflow) => {
|
const selector = createMemoizedSelector(selectWorkflowSlice, (workflow) => {
|
||||||
return {
|
return {
|
||||||
@ -30,7 +31,7 @@ export const WorkflowViewMode = () => {
|
|||||||
<WorkflowField key={`${nodeId}.${fieldName}`} nodeId={nodeId} fieldName={fieldName} />
|
<WorkflowField key={`${nodeId}.${fieldName}`} nodeId={nodeId} fieldName={fieldName} />
|
||||||
))
|
))
|
||||||
) : (
|
) : (
|
||||||
<IAINoContentFallback label={t('nodes.noFieldsLinearview')} icon={null} />
|
<EmptyState />
|
||||||
)}
|
)}
|
||||||
</Flex>
|
</Flex>
|
||||||
</ScrollableContent>
|
</ScrollableContent>
|
||||||
|
Loading…
Reference in New Issue
Block a user