generated from openmcp-project/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 3
feat: deleting managed resources #301
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
+460
−62
Merged
Changes from 11 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
6986bbd
Managed resources deletion
Hubert-Szczepanski-SAP 0eabb48
disable only action menu
Hubert-Szczepanski-SAP a332b11
Action menu moved to separate file
Hubert-Szczepanski-SAP 55738ee
more descriptive name + simplify handler
Hubert-Szczepanski-SAP 7462215
linting
Hubert-Szczepanski-SAP 64aa012
Reverting skipped changes
Hubert-Szczepanski-SAP cfc86f8
adjusting input name in tests
Hubert-Szczepanski-SAP 7ad70e8
fixing tests
Hubert-Szczepanski-SAP df0a145
fixing lint issue
Hubert-Szczepanski-SAP 68609b0
PR comments
Hubert-Szczepanski-SAP 6f9a53a
Merge branch 'main' into feat/deleting-managed-resources
Hubert-Szczepanski-SAP d7e58eb
PR changes
Hubert-Szczepanski-SAP 07053c8
Merge branch 'main' into feat/deleting-managed-resources
Hubert-Szczepanski-SAP edd9e76
leftover after merge
Hubert-Szczepanski-SAP 476ab61
fixing parameters for patch
Hubert-Szczepanski-SAP aba00bc
linter
Hubert-Szczepanski-SAP 47aac68
Merge branch 'main' into feat/deleting-managed-resources
lucasgoral dfcb4c6
adding missing onClose - cancel button was not working after changes
Hubert-Szczepanski-SAP 9713e4d
Merge branch 'main' into feat/deleting-managed-resources
Hubert-Szczepanski-SAP 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 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,4 @@ | ||
.deletingRow { | ||
opacity: 0.5; | ||
pointer-events: none; | ||
} |
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
29 changes: 29 additions & 0 deletions
29
src/components/ControlPlane/ManagedResourcesActionMenu.tsx
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,29 @@ | ||
import { FC, useRef } from 'react'; | ||
import { Button, Menu, MenuItem, MenuDomRef } from '@ui5/webcomponents-react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { ManagedResourceItem } from '../../lib/shared/types'; | ||
|
||
interface RowActionsMenuProps { | ||
item: ManagedResourceItem; | ||
onOpen: (item: ManagedResourceItem) => void; | ||
isDeleting: boolean; | ||
} | ||
|
||
export const RowActionsMenu: FC<RowActionsMenuProps> = ({ item, onOpen, isDeleting }) => { | ||
const { t } = useTranslation(); | ||
const popoverRef = useRef<MenuDomRef>(null); | ||
|
||
return ( | ||
<> | ||
<Button icon="overflow" icon-end disabled={isDeleting} onClick={() => onOpen(item)} /> | ||
<Menu | ||
ref={popoverRef} | ||
onItemClick={() => { | ||
onOpen(item); | ||
}} | ||
> | ||
<MenuItem text={t('ManagedResources.deleteAction')} icon="delete" /> | ||
</Menu> | ||
</> | ||
); | ||
}; |
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
File renamed without changes.
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,36 @@ | ||
import { Trans } from 'react-i18next'; | ||
import { Input, InputDomRef, Label, Ui5CustomEvent } from '@ui5/webcomponents-react'; | ||
import styles from './DeleteConfirmationForm.module.css'; | ||
|
||
interface DeleteConfirmationFormProps { | ||
resourceName: string; | ||
confirmationText: string; | ||
onConfirmationInputChange: (event: Ui5CustomEvent<InputDomRef>) => void; | ||
deleteMessageKey: string; | ||
deleteConfirmationLabel: string; | ||
} | ||
|
||
export function DeleteConfirmationForm({ | ||
resourceName, | ||
confirmationText, | ||
onConfirmationInputChange, | ||
deleteMessageKey, | ||
deleteConfirmationLabel, | ||
}: DeleteConfirmationFormProps) { | ||
return ( | ||
<div className={styles.dialogContent}> | ||
<span className={styles.message}> | ||
<Trans i18nKey={deleteMessageKey} values={{ resourceName }} components={{ b: <b /> }} /> | ||
</span> | ||
<Label className={styles.confirmLabel} for="delete-confirm-input"> | ||
{deleteConfirmationLabel} | ||
</Label> | ||
<Input | ||
id="delete-confirm-input" | ||
value={confirmationText} | ||
className={styles.confirmationInput} | ||
onInput={onConfirmationInputChange} | ||
/> | ||
</div> | ||
); | ||
} |
15 changes: 15 additions & 0 deletions
15
src/components/Dialogs/ManagedResourceDeleteDialog.module.css
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,15 @@ | ||
.dialog { | ||
width: 520px; | ||
} | ||
|
||
.content { | ||
gap: 0.75rem; | ||
} | ||
|
||
.advancedOptionsContent { | ||
gap: 0.5rem; | ||
} | ||
|
||
.actions { | ||
gap: 0.5rem; | ||
} |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.