Skip to content

Commit

Permalink
OAM-64: add includeDisabled to valid src and dest, add disabled label
Browse files Browse the repository at this point in the history
  • Loading branch information
olewandowski1 committed May 22, 2024
1 parent 3113c32 commit f3fa12a
Show file tree
Hide file tree
Showing 6 changed files with 184 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,7 @@
function organizationsResolve(OrganizationResource) {
return new OrganizationResource().query()
.then(function(resource) {
var activeOrgs = resource.content.filter(function(organization) {
return !organization.disabled;
});

return activeOrgs;
return resource.content;
});
}
}
Expand Down
89 changes: 89 additions & 0 deletions src/admin-valid-destination-add/valid-destination-add.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<div class="modal" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1>{{'adminValidDestinationAdd.addValidDestination' | message}}</h1>
</div>
<div class="modal-body">
<form id="add-valid-destination-form" ng-submit="vm.submit()">
<label for="program">
{{'adminValidDestinationAdd.selectProgram' | message}}
</label>
<select id="program"
ng-model="vm.program"
ng-options="p.name for p in vm.programs track by p.id" required>
</select>

<label for="facilityType">
{{'adminValidDestinationAdd.facilityType' | message}}
</label>

<select id="facilityType"
ng-model="vm.facilityType"
ng-options="f.name for f in vm.facilityTypes track by f.id" required>
</select>

<label for="facilityUnitType">
<input
id="facilityUnitType"
type="radio"
ng-model="vm.unitType"
value="facility"
required>
{{'adminValidDestinationAdd.isFacility' | message}}
</label>

<label for="organizationUnitType">
<input
id="organizationUnitType"
type="radio"
ng-model="vm.unitType"
value="organization"
required>
{{'adminValidDestinationAdd.isOrganization' | message}}
</label>

<div ng-if="vm.unitType === 'organization'">
<label for="organization">
{{'adminValidDestinationAdd.organization' | message}}
</label>

<select id="organization"
ng-model="vm.organization"
ng-options="(o.disabled ? o.name + ' [DISABLED]' : o.name) for o in vm.organizations track by o.id" required>
</select>
</div>

<div ng-if="vm.unitType === 'facility'">
<label for="facility">
{{'adminValidDestinationAdd.facility' | message}}
</label>

<select id="facility"
ng-model="vm.facility"
ng-options="f.name for f in vm.facilities track by f.id" required>
</select>
</div>

<label for="geoLevelAffinity">
{{'adminValidDestinationAdd.geoLevelAffinity' | message}}
</label>

<select id="geoLevelAffinity"
ng-model="vm.geoLevel"
ng-options="g.code for g in vm.geoLevels track by g.id">
</select>
</form>
</div>
<div class="modal-footer">
<button id="cancel" ng-click="vm.goToPreviousState()">
{{'adminValidDestinationAdd.cancel' | message}}
</button>
<button class="primary" form="add-valid-destination-form">
{{'adminValidDestinationAdd.add' | message}}
</button>
</div>
</div>
</div>
</div>

Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
size: params.size,
page: params.page,
programId: params.programId,
facilityId: params.facilityId
facilityId: params.facilityId,
includeDisabled: true
});
});
},
Expand Down
6 changes: 1 addition & 5 deletions src/admin-valid-source-add/admin-valid-source-add.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,7 @@
function organizationsResolve(OrganizationResource) {
return new OrganizationResource().query()
.then(function(resource) {
var activeOrgs = resource.content.filter(function(organization) {
return !organization.disabled;
});

return activeOrgs;
return resource.content;
});
}
}
Expand Down
89 changes: 89 additions & 0 deletions src/admin-valid-source-add/valid-source-add.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<div class="modal" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1>{{'adminValidSourceAdd.addValidSource' | message}}</h1>
</div>
<div class="modal-body">
<form id="add-valid-source-form" ng-submit="vm.submit()">
<label for="program">
{{'adminValidSourceAdd.selectProgram' | message}}
</label>
<select id="program"
ng-model="vm.program"
ng-options="p.name for p in vm.programs track by p.id" required>
</select>

<label for="facilityType">
{{'adminValidSourceAdd.facilityType' | message}}
</label>

<select id="facilityType"
ng-model="vm.facilityType"
ng-options="f.name for f in vm.facilityTypes track by f.id" required>
</select>

<label for="facilityUnitType">
<input
id="facilityUnitType"
type="radio"
ng-model="vm.unitType"
value="facility"
required>
{{'adminValidSourceAdd.isFacility' | message}}
</label>

<label for="organizationUnitType">
<input
id="organizationUnitType"
type="radio"
ng-model="vm.unitType"
value="organization"
required>
{{'adminValidSourceAdd.isOrganization' | message}}
</label>

<div ng-if="vm.unitType === 'organization'">
<label for="organization">
{{'adminValidSourceAdd.organization' | message}}
</label>

<select id="organization"
ng-model="vm.organization"
ng-options="(o.disabled ? o.name + ' [DISABLED]' : o.name) for o in vm.organizations track by o.id" required>
</select>
</div>

<div ng-if="vm.unitType === 'facility'">
<label for="facility">
{{'adminValidSourceAdd.facility' | message}}
</label>

<select id="facility"
ng-model="vm.facility"
ng-options="f.name for f in vm.facilities track by f.id" required>
</select>
</div>

<label for="geoLevelAffinity">
{{'adminValidSourceAdd.geoLevelAffinity' | message}}
</label>

<select id="geoLevelAffinity"
ng-model="vm.geoLevel"
ng-options="g.code for g in vm.geoLevels track by g.id">
</select>
</form>
</div>
<div class="modal-footer">
<button id="cancel" ng-click="vm.goToPreviousState()">
{{'adminValidSourceAdd.cancel' | message}}
</button>
<button class="primary" form="add-valid-source-form">
{{'adminValidSourceAdd.add' | message}}
</button>
</div>
</div>
</div>
</div>

Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
size: params.size,
page: params.page,
programId: params.programId,
facilityId: params.facilityId
facilityId: params.facilityId,
includeDisabled: true
});
});
},
Expand Down

0 comments on commit f3fa12a

Please sign in to comment.