Skip to content

Commit

Permalink
Conflicts resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
bholt13 committed Nov 18, 2024
2 parents 544b109 + a997b37 commit 3308ee4
Show file tree
Hide file tree
Showing 14 changed files with 158 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/scala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [ master ]

jobs:
build:
build_and_test:

runs-on: ubuntu-latest

Expand Down
7 changes: 5 additions & 2 deletions app/femr/data/daos/system/UserRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,12 @@ public List<?extends IUser> retrieveUsersByTripId(Integer tripId){
@Override
public List<? extends IRole> retrieveAllRoles(){

ExpressionList<Role> roleQuery = QueryProvider.getRoleQuery()
.where()
ExpressionList<Role> roleQuery = QueryProvider.getRoleQuery().where();

/*
.ne("name", "SuperUser");
Why remove SuperUser from role list? Caused bug where updating SuperUser removed its role...
*/

List<? extends IRole> allRoles;
try{
Expand Down
2 changes: 1 addition & 1 deletion app/femr/ui/controllers/ReferenceController.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import femr.ui.views.html.reference.index;

@Security.Authenticated(FEMRAuthenticated.class)
@AllowedRoles({Roles.PHYSICIAN, Roles.PHARMACIST, Roles.NURSE, Roles.SUPERUSER})
@AllowedRoles({Roles.PHYSICIAN, Roles.PHARMACIST, Roles.NURSE, Roles.SUPERUSER, Roles.ADMINISTRATOR})
public class ReferenceController extends Controller {

private final AssetsFinder assetsFinder;
Expand Down
47 changes: 41 additions & 6 deletions app/femr/ui/views/admin/trips/cities.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,38 @@
@additionalScripts = {
<script type = "text/javascript" src="@assets.path("js/libraries/jquery.dataTables.min.js")"></script>
<script type="text/javascript" src="@assets.path("js/superuser/superuser.js")"></script>
<script>
let languageData;

fetch('@routes.Assets.versioned("json/languages.json")')
.then(response => response.json())
.then(data => {
languageData = data;
updateLanguage("@{currentUser.getLanguageCode}","@{currentUser.getFirstName}");

})
.catch(error => console.error('Error fetching language data:', error));


function updateTextContent(elementId, value) {
const element = document.getElementById(elementId);
if (element) {
element.textContent = value;
} else {
console.error(`Element with ID '${elementId}' not found.`);
}
}

function updateLanguage(languageCode) {
localStorage.setItem('languageCode', languageCode);
updateTextContent("trips_cities_Add", languageData[languageCode].trips_cities_Add);
updateTextContent("trips_cities_City", languageData[languageCode].trips_cities_City);
updateTextContent("trips_cities_Country", languageData[languageCode].trips_cities_Country);
updateTextContent("trips_cities_Submit", languageData[languageCode].trips_cities_Submit);
updateTextContent("trips_cities_tCity", languageData[languageCode].trips_cities_tCity);
updateTextContent("trips_cities_tCountry", languageData[languageCode].trips_cities_tCountry);
}
</script>
}

@admin("Trips - Manage Cities", currentUser, scripts = additionalScripts, styles = additionalStyles, assets = assets) {
Expand All @@ -24,15 +56,18 @@

@helper.form(action = TripController.citiesPost()) {
<div id="addCityWrap">
<h1>Add City:</h1>
<h1 id="trips_cities_Add">Add City</h1>
<div>
<label>City:<span class="red bold">*</span>
<label><span id="trips_cities_City">City:</span>
<span class="red bold">*</span>
<input class="fInput" type="text" name="newCity"/>
</label>
</div>

<div>
<label>Country:<span class="red bold">*</span>
<label>
<span id="trips_cities_Country">Country:</span>
<span class="red bold">*</span>
<select class="fSelect" name="newCityCountry">
<option selected disabled value=""></option>
@for(countryIndex <- 1 to viewModel.getAvailableCountries.size) {
Expand All @@ -43,7 +78,7 @@ <h1>Add City:</h1>
</div>
</div>
<div id="submitWrap">
<button type="submit" class="fButton">Submit</button>
<button type="submit" class="fButton" id="trips_cities_Submit">Submit</button>
</div>
}

Expand All @@ -52,8 +87,8 @@ <h1>Add City:</h1>
<table id="cityTable">
<thead>
<tr>
<th>City</th>
<th>Country</th>
<th id="trips_cities_tCity">City</th>
<th id="trips_cities_tCountry">Country</th>
</tr>
</thead>
<tbody>
Expand Down
69 changes: 56 additions & 13 deletions app/femr/ui/views/admin/trips/manage.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,46 @@
@additionalScripts = {
<script type = "text/javascript" src="@assets.path("js/libraries/jquery.dataTables.min.js")"></script>
<script type="text/javascript" src="@assets.path("js/superuser/superuser.js")"></script>
<script>
let languageData;

fetch('@routes.Assets.versioned("json/languages.json")')
.then(response => response.json())
.then(data => {
languageData = data;
updateLanguage("@{currentUser.getLanguageCode}","@{currentUser.getFirstName}");

})
.catch(error => console.error('Error fetching language data:', error));


function updateTextContent(elementId, value) {
const element = document.getElementById(elementId);
if (element) {
element.textContent = value;
} else {
console.error(`Element with ID '${elementId}' not found.`);
}
}

function updateLanguage(languageCode) {
localStorage.setItem('languageCode', languageCode);
updateTextContent("trips_manage_Add", languageData[languageCode].trips_manage_Add);
updateTextContent("trips_manage_Team", languageData[languageCode].trips_manage_Team);
updateTextContent("trips_manage_TripCity", languageData[languageCode].trips_manage_TripCity);
updateTextContent("trips_manage_TripCountry", languageData[languageCode].trips_manage_TripCountry);
updateTextContent("trips_manage_Start1", languageData[languageCode].trips_manage_Start1);
updateTextContent("trips_manage_End1", languageData[languageCode].trips_manage_End1);
updateTextContent("trips_manage_Submit", languageData[languageCode].trips_manage_Submit);
updateTextContent("trips_manage_Edit", languageData[languageCode].trips_manage_Edit);
updateTextContent("trips_manage_Name", languageData[languageCode].trips_manage_Name);
updateTextContent("trips_manage_Country", languageData[languageCode].trips_manage_Country);
updateTextContent("trips_manage_City", languageData[languageCode].trips_manage_City);
updateTextContent("trips_manage_Start2", languageData[languageCode].trips_manage_Start2);
updateTextContent("trips_manage_End2", languageData[languageCode].trips_manage_End2);

}
</script>
}

@admin("Trips - Manage Trips", currentUser, styles = additionalStyles, scripts = additionalScripts, assets = assets) {
Expand All @@ -24,9 +64,10 @@

@helper.form(action = TripController.managePost()) {
<div id="addTripWrap">
<h1>Add Trip:</h1>
<h1 id="trips_manage_Add">Add Trip:</h1>
<div>
<label>Trip Team:<span class="red bold">*</span>
<label><span id="trips_manage_Team">Trip Team:</span>
<span class="red bold">*</span>
<select class="fSelect" name="newTripTeamName">
<option selected value=""></option>
@for(teamIndex <- 1 to viewModel.getMissionItems.size) {
Expand All @@ -38,7 +79,7 @@ <h1>Add Trip:</h1>
</label>
</div>
<div>
<label>Trip City:<span class="red bold">*</span>
<label><span id="trips_manage_TripCity">Trip City:</span><span class="red bold">*</span>
<select class="fSelect" name="newTripCity">
<option selected value=""></option>
@for(tripIndex <- 1 to viewModel.getAvailableCities.size) {
Expand All @@ -50,25 +91,27 @@ <h1>Add Trip:</h1>
</label>
</div>
<div>
<label>Trip Country:
<label><span id="trips_manage_TripCountry">Trip Country:</span>
<input class="fInput" type="text" value="" name="newTripCountry" readonly/>
</label>
</div>

<div>
<label>Start Date:<span class="red bold">*</span>
<label><span id="trips_manage_Start1">Start Date:</span>
<span class="red bold">*</span>
<input type="date" name="newTripStartDate"/>
</label>
</div>
<div>
<label>End Date:<span class="red bold">*</span>
<label><span id="trips_manage_End1">End Date:</span>
<span class="red bold">*</span>
<input type="date" name="newTripEndDate"/>
</label>
</div>
</div>

<div id="submitWrap">
<button type="submit" class="fButton">Submit</button>
<button type="submit" class="fButton" id="trips_manage_Submit">Submit</button>
</div>
}

Expand All @@ -77,12 +120,12 @@ <h1>Add Trip:</h1>
<table id="tripTable">
<thead>
<tr>
<th>Edit</th>
<th>Team Name</th>
<th>Country</th>
<th>City</th>
<th>Start Date</th>
<th>End Date</th>
<th id="trips_manage_Edit">Edit</th>
<th id="trips_manage_Name">Team Name</th>
<th id="trips_manage_Country">Country</th>
<th id="trips_manage_City">City</th>
<th id="trips_manage_Start2">Start Date</th>
<th id="trips_manage_End2">End Date</th>
</tr>
</thead>
<tbody>
Expand Down
54 changes: 46 additions & 8 deletions app/femr/ui/views/admin/trips/teams.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,41 @@
@additionalScripts = {
<script type = "text/javascript" src="@assets.path("js/libraries/jquery.dataTables.min.js")"></script>
<script type="text/javascript" src="@assets.path("js/superuser/superuser.js")"></script>
<script>
let languageData;

fetch('@routes.Assets.versioned("json/languages.json")')
.then(response => response.json())
.then(data => {
languageData = data;
updateLanguage("@{currentUser.getLanguageCode}","@{currentUser.getFirstName}");

})
.catch(error => console.error('Error fetching language data:', error));


function updateTextContent(elementId, value) {
const element = document.getElementById(elementId);
if (element) {
element.textContent = value;
} else {
console.error(`Element with ID '${elementId}' not found.`);
}
}

function updateLanguage(languageCode) {
localStorage.setItem('languageCode', languageCode);
updateTextContent("trips_teams_Add", languageData[languageCode].trips_teams_Add);
updateTextContent("trips_teams_Description1", languageData[languageCode].trips_teams_Description1);
updateTextContent("trips_teams_Submit", languageData[languageCode].trips_teams_Submit);
updateTextContent("trips_teams_TeamName1", languageData[languageCode].trips_teams_TeamName1);
updateTextContent("trips_teams_Location", languageData[languageCode].trips_teams_Location);
updateTextContent("trips_teams_TeamName2", languageData[languageCode].trips_teams_TeamName2);
updateTextContent("trips_teams_Description2", languageData[languageCode].trips_teams_Description2);
updateTextContent("trips_teams_Origin", languageData[languageCode].trips_teams_Origin);

}
</script>
}

@admin("Trips - Manage Teams", currentUser, styles = additionalStyles, scripts = additionalScripts, assets = assets) {
Expand All @@ -25,21 +60,24 @@
@helper.form(action = TripController.teamsPost()) {

<div id="addTeamWrap">
<h1>Add Team:</h1>
<h1 id="trips_teams_Add">Add Team:</h1>
<div>
<label>Team Name<span class="red bold">*</span>:
<label>
<span id="trips_teams_TeamName1">Team Name</span>
<span class="red bold">*</span>
<input class="fInput" type="text" name="newTeamName"/>
</label>
</div>

<div>
<label>Team Location:
<label><span id="trips_teams_Location">Team Origin:</span>
<input class="fInput" type="text" name="newTeamLocation"/>
</label>
</div>

<div>
<label>Team Description:
<label>
<span id="trips_teams_Description1">Team Description:</span>
<input class="fInput" type="text" name="newTeamDescription"/>
</label>
</div>
Expand All @@ -49,7 +87,7 @@ <h1>Add Team:</h1>


<div id="submitWrap">
<button type="submit" class="fButton">Submit</button>
<button type="submit" class="fButton" id="trips_teams_Submit">Submit</button>
</div>
}

Expand All @@ -58,9 +96,9 @@ <h1>Add Team:</h1>
<table id="teamTable">
<thead>
<tr>
<th>Team Name</th>
<th>Description</th>
<th>Origin</th>
<th id="trips_teams_TeamName2">Team Name</th>
<th id="trips_teams_Description2">Description</th>
<th id="trips_teams_Origin">Origin</th>
</tr>
</thead>
<tbody>
Expand Down
1 change: 1 addition & 0 deletions app/femr/ui/views/admin/updates/manage.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<div id="left-div">
<div id="network-status">
<h2>Network Status</h2>

<table id="networkstatus">
<div>
<div>
Expand Down
2 changes: 1 addition & 1 deletion app/femr/ui/views/home/index.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
</script>
}


@*Sample texts. Content is pulled from the languages json in the public directory.*@
@top = {
<div class="jumbotron">
<div class="container">
Expand Down
2 changes: 1 addition & 1 deletion app/femr/ui/views/layouts/main.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<link rel="shortcut icon" type="image/png" href="@assets.path("img/favicon.png")">
<link rel="shortcut icon" type="image/png" href="@assets.path("img/logo_color_wordless.png")">
<link rel="stylesheet" href="@assets.path("css/libraries/jquery.dataTables.min.css")">
<link rel="stylesheet" href="@assets.path("css/libraries/bootstrap.min.css")">
<link rel="stylesheet" href="@assets.path("css/femr.css")"/>
Expand Down
3 changes: 0 additions & 3 deletions app/femr/ui/views/partials/footer.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@
<script>
document.addEventListener('DOMContentLoaded', function() {
let languageData;
let languageCode;
fetch('@routes.Assets.versioned("json/languages.json")')
.then(response => response.json())
.then(data => {
languageData = data;
const initialLanguage = localStorage.getItem('languageCode') || 'en';
updateLanguage(initialLanguage);
languageCode = "en";
updateLanguage(languageCode);
});

function updateTextContent(elementId, value) {
Expand Down
2 changes: 2 additions & 0 deletions app/femr/ui/views/sessions/create.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ <h2>@message</h2>
}
</div>

<h2>Please note: Before you can log in your account must be approved by an admin.</h2>

@helper.form(action = SessionsController.createAccountPost(), 'class -> "form-horizontal createWrap", 'name -> "createForm") {

@helper.inputText(createForm("email"),
Expand Down
1 change: 1 addition & 0 deletions app/femr/ui/views/superuser/tabs/fields.scala.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import play.twirl.api.TwirlFeatureImports.defining
@(currentUser: femr.common.dtos.CurrentUser,
viewModel: femr.ui.models.superuser.ContentViewModelGet,
assets: AssetsFinder)
Expand Down
1 change: 1 addition & 0 deletions app/femr/ui/views/superuser/tabs/manage.scala.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import play.twirl.api.TwirlFeatureImports.defining
@(currentUser: femr.common.dtos.CurrentUser, viewModel: femr.ui.models.superuser.TabsViewModelGet, assets: AssetsFinder)

@import femr.ui.views.html.layouts.admin
Expand Down
2 changes: 1 addition & 1 deletion public/json/languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"trips_manage_End2": "End Date",
"trips_teams_Add": "Add Team",
"trips_teams_TeamName1": "Team Name:",
"trips_teams_Location": "Team Location:",
"trips_teams_Location": "Team Origin:",
"trips_teams_Description1": "Team Description:",
"trips_teams_Submit": "Submit",
"trips_teams_TeamName2": "Team Name",
Expand Down

0 comments on commit 3308ee4

Please sign in to comment.