Skip to content

Commit

Permalink
LPS-204732 Show success message when operation is completed
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrodw3 authored and brianchandotcom committed Jan 2, 2024
1 parent afae4db commit b2003be
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@ import {LAYOUT_DATA_ITEM_TYPES} from './constants/layoutDataItemTypes';
const addPortlet = ({item, plid, targetItem, targetPosition}) => {
const loading = addLoadingAnimation(targetItem, targetPosition);

openToast({
message: Liferay.Language.get('the-application-was-added-to-the-page'),
type: 'success',
});

const portletData =
item.type === LAYOUT_DATA_ITEM_TYPES.widget
? ''
: `${item.data.classPK},${item.data.className}`;

Liferay.Portlet.add({
beforePortletLoaded: () => null,
onComplete: () =>
openToast({
message: Liferay.Language.get(
'the-application-was-added-to-the-page'
),
type: 'success',
}),
placeHolder: loading,
plid,
portletData,
Expand Down

0 comments on commit b2003be

Please sign in to comment.