Skip to content
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

LPS-125128 prevent submitting form if default value is empty #3440

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -148,19 +148,27 @@ editDDMStructureURL.setParameter("mvcPath", "/edit_data_definition.jsp");
'<portlet:namespace />name'
);

if (!nameInput.value) {
var name = <portlet:namespace />getInputLocalizedValues('name');

if (
!nameInput.value ||
!name[
'<%= journalEditDDMStructuresDisplayContext.getDefaultLanguageId() %>'
]
) {
Liferay.Util.openToast({
message:
'<liferay-ui:message key="please-enter-a-valid-name" />',
title: '<liferay-ui:message key="error" />',
type: 'danger',
});

return;
}

var description = <portlet:namespace />getInputLocalizedValues(
'description'
);
var name = <portlet:namespace />getInputLocalizedValues('name');

var formData = dataLayoutBuilder.getFormData();

Expand Down