-
Notifications
You must be signed in to change notification settings - Fork 10
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
Ms2/process editor #126
Merged
Merged
Ms2/process editor #126
Changes from 8 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
22021e0
created folder for helper files
LucasMGo cfb2c60
Merge branch 'main' into ms2/process-editor
LucasMGo 45ae408
Merge branch 'main' into ms2/process-editor
LucasMGo 58555f5
enable setting version as latest version
LucasMGo a4f4512
add content type to header information for put-request on userTasks
LucasMGo a351daa
fix modeler: set to viewer mode when version is selected
LucasMGo 1a17c07
added components for process creation; use them on multiple occasions
LucasMGo 7bad7e6
invalidate query after creating version to show updated list of version
LucasMGo a24a658
remove unused declaration
LucasMGo 28c7b33
remove unnecessary close Icon in modal
LucasMGo 84b9144
add auth check for creating process in editor
LucasMGo f03397d
add auth check for creation of process
LucasMGo 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
'use client'; | ||
|
||
import { FC, PropsWithChildren } from 'react'; | ||
import { Menu } from 'antd'; | ||
const { SubMenu, Item, ItemGroup } = Menu; | ||
import { EditOutlined, ProfileOutlined, FileAddOutlined, StarOutlined } from '@ant-design/icons'; | ||
import { usePathname, useRouter } from 'next/navigation'; | ||
import { useAuthStore } from '@/lib/iam'; | ||
import ProcessCreationButton from './process-creation-button'; | ||
|
||
const ProcessSider: FC<PropsWithChildren> = () => { | ||
const router = useRouter(); | ||
const activeSegment = usePathname().slice(1) || 'processes'; | ||
const ability = useAuthStore((state) => state.ability); | ||
|
||
return ( | ||
<> | ||
<ItemGroup key="processes" title="Processes"> | ||
{ability.can('view', 'Process') ? ( | ||
<SubMenu | ||
key="processes" | ||
title={ | ||
<span | ||
onClick={() => { | ||
router.push(`/processes`); | ||
}} | ||
> | ||
Process List | ||
</span> | ||
} | ||
className={activeSegment === 'processes' ? 'SelectedSegment' : ''} | ||
icon={ | ||
<EditOutlined | ||
onClick={() => { | ||
router.push(`/processes`); | ||
}} | ||
/> | ||
} | ||
> | ||
<Item | ||
key="newProcess" | ||
icon={<FileAddOutlined />} | ||
hidden={!ability.can('create', 'Process')} | ||
> | ||
<ProcessCreationButton | ||
wrapperElement={<span>New Process</span>} | ||
></ProcessCreationButton> | ||
</Item> | ||
<Item key="processFavorites" icon={<StarOutlined />}> | ||
Favorites | ||
</Item> | ||
</SubMenu> | ||
) : null} | ||
|
||
{ability.can('view', 'Template') ? ( | ||
<SubMenu key="templates" title="Templates" icon={<ProfileOutlined />}> | ||
<Item | ||
key="newTemplate" | ||
icon={<FileAddOutlined />} | ||
hidden={!ability.can('create', 'Template')} | ||
> | ||
New Template | ||
</Item> | ||
<Item key="templateFavorites" icon={<StarOutlined />}> | ||
Favorites | ||
</Item> | ||
</SubMenu> | ||
) : null} | ||
</ItemGroup> | ||
</> | ||
); | ||
}; | ||
|
||
export default ProcessSider; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,7 +61,7 @@ const Modeler: FC<ModelerProps> = ({ minimized, ...props }) => { | |
// This is not the most recent instance, so don't do anything. | ||
if (active !== modeler.current) return; | ||
|
||
if (editingDisabled) { | ||
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.
|
||
if (selectedVersionId !== null) { | ||
modeler.current = new Viewer!({ | ||
container: canvas.current!, | ||
moddleExtensions: { | ||
|
@@ -103,7 +103,7 @@ const Modeler: FC<ModelerProps> = ({ minimized, ...props }) => { | |
modeler.current?.destroy(); | ||
}; | ||
// only reset the modeler if we switch between editing being enabled or disabled | ||
}, [setModeler, editingDisabled, processId, updateProcessMutation]); | ||
}, [setModeler, editingDisabled, selectedVersionId, processId, updateProcessMutation]); | ||
|
||
const { data: processBpmn } = useProcessBpmn(processId as string, selectedVersionId); | ||
|
||
|
Oops, something went wrong.
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.
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.
Permission check is missing (AuthCan)
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.
This is also the case in version-toolbar.tsx:199