Skip to content

RA-2081: Create modal on submit telling user not to reload the page #152

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
merged 2 commits into from
Jun 6, 2025
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
13 changes: 4 additions & 9 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,13 @@ jobs:
JAVA_VERSION: ${{ matrix.java-version }}

steps:
- uses: actions/checkout@v2
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tangential... updated to newer configuration for this

- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java-version }}
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
cache: 'maven'
- name: Install dependencies
run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true --batch-mode --show-version --file pom.xml
- name: Build with Maven
Expand Down
4 changes: 3 additions & 1 deletion api/src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,6 @@ registrationapp.person.relationship.label=Relatives
registrationapp.person.relationship.question=Who is the patient related to?

registrationapp.person.name=Person Name
registrationapp.person.relationship.selectRelationshipType=Select Relationship Type
registrationapp.person.relationship.selectRelationshipType=Select Relationship Type

registrationapp.pleaseDoNotRefreshPage=Please do not refresh the page
2 changes: 2 additions & 0 deletions api/src/main/resources/messages_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,5 @@ registrationapp.person.relationship.question=Le Patient a-t-il une relation avec

registrationapp.person.name=Nom de la personne
registrationapp.person.relationship.selectRelationshipType=Choisissez le type de relation

registrationapp.pleaseDoNotRefreshPage=Veuillez ne pas actualiser la page
7 changes: 7 additions & 0 deletions omod/src/main/webapp/pages/registerPatient.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,13 @@ fieldset[id\$="-fieldset"] div > div {
});
</script>

<div id="modal-overlay">
<div id="modal-content">
<div class="spinner"></div>
<p>${ui.message("registrationapp.pleaseDoNotRefreshPage")}</p>
</div>
</div>

<div id="validation-errors" class="note-container" style="display: none" >
<div class="note error">
<div id="validation-errors-content" class="text">
Expand Down
2 changes: 2 additions & 0 deletions omod/src/main/webapp/resources/scripts/registerPatient.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ jq(function() {
jq('#registration').submit(function (e) {
e.preventDefault();
jq('#submit').attr('disabled', 'disabled');
jq('#modal-overlay').fadeIn();
jq('#cancelSubmission').attr('disabled', 'disabled');
jq('#validation-errors').hide();
var formData = jq('#registration').serialize();
Expand All @@ -248,6 +249,7 @@ jq(function() {
jq('#validation-errors-content').html(response.responseJSON.globalErrors);
jq('#validation-errors').show();
jq('#submit').removeAttr('disabled');
jq('#modal-overlay').fadeOut();
jq('#cancelSubmission').removeAttr('disabled');
}
});
Expand Down
43 changes: 43 additions & 0 deletions omod/src/main/webapp/resources/styles/registerPatient.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,46 @@
}


#modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
z-index: 999;
display: none; /* Hidden by default */
}

#modal-content {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: white;
padding: 20px;
text-align: center;
border-radius: 8px;
width: 300px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.spinner {
width: 40px;
height: 40px;
margin: 15px auto;
border: 4px solid #f3f3f3;
border-top: 4px solid #3498db;
border-radius: 50%;
animation: spin 1s linear infinite;
}

@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}