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

SAK-45911 - Profile | Pronunciation recording clears other fields' data #11511

Merged
merged 4 commits into from
May 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ public class ProfileConstants {
*/

//default if not specified in sakai.properties as profile.picture.max (megs)
public static final int MAX_IMAGE_UPLOAD_SIZE = 2;
public static final int MAX_IMAGE_UPLOAD_SIZE = 2;
// Approx per second of pronouncation files in KB
public static final int PRONUNCIATION_SIZE_PER_SECOND = 500;

//one side will be scaled to this if larger. 200 is large enough
public static final int MAX_IMAGE_XY = 200;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="mainSectionHeading"><span wicket:id="heading">[Name Pronunciation and Pronouns]</span></div>

<div class="mainSectionContentForm">
<form wicket:id="form" id="namePronunciationForm" class="profileForm">
<form wicket:id="form" id="namePronunciationForm" class="profileForm" enctype="multipart/form-data">
<div wicket:id="formFeedback">[formFeedback]</div>
<div wicket:id="editWarning" class="edit-other-warning">[You are editing {other person}'s profile]</div>
<p class="mainSectionContentDescription"><wicket:message key="text.name.pronunciation.description" /></p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.apache.wicket.model.StringResourceModel;
import org.apache.wicket.spring.injection.annot.SpringBean;

import org.apache.wicket.util.lang.Bytes;
import org.sakaiproject.api.common.edu.person.SakaiPerson;
import org.sakaiproject.component.api.ServerConfigurationService;
import org.sakaiproject.entity.api.Entity;
Expand Down Expand Up @@ -75,7 +76,6 @@ public class MyNamePronunciationEdit extends Panel {

private final HiddenField audioBase64;


public MyNamePronunciationEdit(final String id, final UserProfile userProfile) {
super(id);

Expand All @@ -89,6 +89,9 @@ public MyNamePronunciationEdit(final String id, final UserProfile userProfile) {

//setup form
Form form = new Form("form", new Model(userProfile));
form.setMultiPart(true);
form.setMaxSize(Bytes.kilobytes(sakaiProxy.getNamePronunciationDuration() * ProfileConstants.PRONUNCIATION_SIZE_PER_SECOND));

form.setOutputMarkupId(true);

//form submit feedback
Expand Down