Skip to content

Commit

Permalink
fix(app-headless-cms): delete code model entries (#4487)
Browse files Browse the repository at this point in the history
  • Loading branch information
brunozoric authored Jan 13, 2025
1 parent 797f7dd commit 387e40e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -333,35 +333,21 @@ const ContentModelsDataList = ({

{canDelete(contentModel, "cms.contentModel") && (
<>
{contentModel.plugin ? (
<Tooltip
content={t`Content model is registered via a plugin.`}
placement={"top"}
>
<DeleteIcon
disabled
data-testid={
"cms-delete-content-model-button"
}
/>
</Tooltip>
) : (
<Tooltip
content={t`Delete content model`}
placement={"top"}
>
<DeleteIcon
onClick={() => {
setModelToBeDeleted(
contentModel
);
}}
data-testid={
"cms-delete-content-model-button"
}
/>
</Tooltip>
)}
<Tooltip
content={t`Delete content model`}
placement={"top"}
>
<DeleteIcon
onClick={() => {
setModelToBeDeleted(
contentModel
);
}}
data-testid={
"cms-delete-content-model-button"
}
/>
</Tooltip>
</>
)}
</UIL.ListActions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const Information = (props: IInformationProps) => {
const { model } = props;
return (
<>
{model.plugin && (
{model.plugin ? (
<>
<p>
This model is a plugin one, and it cannot be deleted. Only its entries can
Expand All @@ -23,9 +23,11 @@ export const Information = (props: IInformationProps) => {
<p>
<br />
</p>
<p>- This action will permanently delete all model entries.</p>
</>
) : (
<p>- This action will permanently delete the model and all its entries.</p>
)}
<p>- This action will permanently delete the model and all its associated data.</p>
<p>- References to this model in other parts of the system will be emptied.</p>
<p>- All relevant lifecycle events will be triggered.</p>
<p className={warningClassName}> - This action cannot be undone!</p>
Expand Down

0 comments on commit 387e40e

Please sign in to comment.