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

INTGR-203: feat / Add full list of HOS rulesets #379

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
117 changes: 29 additions & 88 deletions src/software/js-samples/importUsers.html
Original file line number Diff line number Diff line change
Expand Up @@ -489,93 +489,7 @@ <h1>DEVELOPER SAMPLE</h1>
<p>
<div class="checkmateField">
<label for="options_hosRuleSet">Ruleset:</label>
<select id="options_hosRuleSet" class="checkmateFormEditField" title="This is the ruleset the user will follow when using hours of service.">
<option value=""></option>"Please Select a Ruleset"</option>
<option value="HosRuleSetAlaskaPassenger7Day">Alaska Passenger 70-hour/7-day</option>
<option value="HosRuleSetAlaskaPassenger8Day">Alaska Passenger 80-hour/8-day</option>
<option value="HosRuleSetAlaskaProperty7Day">Alaska Property 70-hour/7-day</option>
<option value="HosRuleSetAlaskaProperty8Day">Alaska Property 80-hour/8-day</option>
<option value="HosRuleSetAmerica7Day">USA Property 60-hour/7-day</option>
<option value="HosRuleSetAmerica7DayBig">USA Property 60-hour/7-day (16-hour exemption)</option>
<option value="HosRuleSetAmerica7DayNo34h">USA Property 60-hour/7-day without 34-hour restart</option>
<option value="HosRuleSetAmerica7DayPassenger">USA Passenger 60-hour/7-day</option>
<option value="HosRuleSetAmerica8Day">USA Property 70-hour/8-day</option>
<option value="HosRuleSetAmerica8DayBig">USA Property 70-hour/8-day (16-hour exemption)</option>
<option value="HosRuleSetAmerica8DayNo34h">USA Property 70-hour/8-day without 34-hour restart</option>
<option value="HosRuleSetAmerica8DayPassenger">USA Passenger 70-hour/8-day</option>
<option value="HosRuleSetAmericaNoRestRequirement7Day">USA Property 60-hour/7-day without rest requirement</option>
<option value="HosRuleSetAmericaNoRestRequirement7DayBig">USA Property 60-hour/7-day (16-hour exemption) without
rest requirement</option>
<option value="HosRuleSetAmericaNoRestRequirement8Day">USA Property 70-hour/8-day without rest requirement</option>
<option value="HosRuleSetAmericaNoRestRequirement8DayBig">USA Property 70-hour/8-day (16-hour exemption) without
rest requirement</option>
<option value="HosRuleSetAmericaNonCdlShortHaul7Day">Non-CDL Short-haul 60-hour/7-day</option>
<option value="HosRuleSetAmericaNonCdlShortHaul8Day">Non-CDL Short-haul 70-hour/8-day</option>
<option value="HosRuleSetAmericaSalesperson">USA Salesperson</option>
<option value="HosRuleSetAmericaShortHaul">USA Property Short-haul 60-hour/7-day 12hr Workday</option>
<option value="HosRuleSetAmericaShortHaul8Day">USA Property Short-haul 70-hour/8-day 12hr Workday</option>
<option value="HosRuleSetAmericaShortHaul8DayNo34h">USA Property Short-haul 70-hour/8-day without 34-hour restart</option>
<option value="HosRuleSetAmericaShortHaulNo34h">USA Property Short-haul 60-hour/7-day without 34-hour restart</option>
<option value="HosRuleSetAmericaShortHaulPassenger">USA Passenger Short-haul 60-hour/7-day</option>
<option value="HosRuleSetAmericaShortHaulPassenger8Day">USA Passenger Short-haul 70-hour/8-day</option>
<option value="HosRuleSetAmericaTexas">Texas Intrastate</option>
<option value="HosRuleSetAmericaTexasShortHaul">Texas Short-haul 60-hour/7-day Intrastate</option>
<option value="HosRuleSetAmericaTexasShortHaul8Day">Texas Short-haul 70-hour/8-day Intrastate</option>
<option value="HosRuleSetBrazilShortHaul">Brazil Property Short-haul</option>
<option value="HosRuleSetCalifornia8day">California Property Intrastate with rest requirement</option>
<option value="HosRuleSetCaliforniaFarmProduct">California Farm Product</option>
<option value="HosRuleSetCaliforniaFlammableLiquid">California Flammable Liquid</option>
<option value="HosRuleSetCaliforniaPassenger">California Passenger Intrastate</option>
<option value="HosRuleSetCaliforniaProperty">California Property Intrastate</option>
<option value="HosRuleSetCaliforniaSchoolPupil">California School Pupil</option>
<option value="HosRuleSetCanadaCycleOne">Canada 7-Day Cycle 1</option>
<option value="HosRuleSetCanadaCycleTwo">Canada 14-Day Cycle 2</option>
<option value="HosRuleSetCarrierExemption">Carrier Exemption</option>
<option value="HosRuleSetFlorida7Day">USA Florida 70-hour/7-Day</option>
<option value="HosRuleSetFlorida8Day">USA Florida 80-hour/8-Day</option>
<option value="HosRuleSetFloridaShortHaul7Day">USA Florida Short-haul 70-hour/7-Day</option>
<option value="HosRuleSetFloridaShortHaul8Day">USA Florida Short-haul 80-hour/8-Day</option>
<option value="HosRuleSetMarylandShortHaul7Day">Maryland Short Haul 70-hour/7-day</option>
<option value="HosRuleSetMarylandShortHaul8Day">Maryland Short Haul 80-hour/8-day</option>
<option value="HosRuleSetNebraska7day">Nebraska 70-hour/7-day</option>
<option value="HosRuleSetNebraska8day">Nebraska 80-hour/8-day</option>
<option value="HosRuleSetNone">No Ruleset (7-day cycle)</option>
<option value="HosRuleSetNone8Day">No Ruleset (8-day cycle)</option>
<option value="HosRuleSetNorthDakota7Day">North Dakota 70-hour/7-day</option>
<option value="HosRuleSetNorthDakotaShortHaul7Day">North Dakota Short Haul 70-hour/7-day</option>
<option value="HosRuleSetOilTransport7Day">USA Property 60-hour/7-day 24-hour restart</option>
<option value="HosRuleSetOilTransport7DayBig">USA Property 60-hour/7-day 24-hour restart (16-hour exemption)</option>
<option value="HosRuleSetOilTransport8Day">USA Property 70-hour/8-day 24-hour restart</option>
<option value="HosRuleSetOilTransport8DayBig">USA Property 70-hour/8-day 24-hour restart (16-hour exemption)</option>
<option value="HosRuleSetOilTransportCalifornia8day">California Oil Transport Property Intrastate with rest
requirement</option>
<option value="HosRuleSetOilTransportNoRestRequirement7Day">USA Oil Transport 60-hour/7-day without rest requirement</option>
<option value="HosRuleSetOilTransportNoRestRequirement7DayBig">USA Oil Transport 60-hour/7-day (16-hour exemption)
without rest requirement</option>
<option value="HosRuleSetOilTransportNoRestRequirement8Day">USA Oil Transport 70-hour/8-day without rest requirement</option>
<option value="HosRuleSetOilTransportNoRestRequirement8DayBig">USA Oil Transport 70-hour/8-day (16-hour exemption)
without rest requirement</option>
<option value="HosRuleSetOilTransportShortHaul">USA Property Short-haul 60-hour/7-day 12hr Workday 24-hour restart</option>
<option value="HosRuleSetOilTransportShortHaul8Day">USA Property Short-haul 70-hour/8-day 12hr Workday 24-hour
restart</option>
<option value="HosRuleSetOilTransportTexas">USA Texas Oil Transport 70-hour/7-day</option>
<option value="HosRuleSetOilWell7Day">USA Oil Well 60-hour/7-day</option>
<option value="HosRuleSetOilWell7DayBig">USA Oil Well 60-hour/7-day (16-hour exemption)</option>
<option value="HosRuleSetOilWell8Day">USA Oil Well 70-hour/8-day</option>
<option value="HosRuleSetOilWell8DayBig">USA Oil Well 70-hour/8-day (16-hour exemption)</option>
<option value="HosRuleSetOilWellCalifornia8day">California Oil Well Property Intrastate with rest requirement</option>
<option value="HosRuleSetOilWellNoRestRequirement7Day">USA Oil Well 60-hour/7-day without rest requirement</option>
<option value="HosRuleSetOilWellNoRestRequirement7DayBig">USA Oil Well 60-hour/7-day (16-hour exemption) without
rest requirement</option>
<option value="HosRuleSetOilWellNoRestRequirement8Day">USA Oil Well 70-hour/8-day without rest requirement</option>
<option value="HosRuleSetOilWellNoRestRequirement8DayBig">USA Oil Well 70-hour/8-day (16-hour exemption) without
rest requirement</option>
<option value="HosRuleSetOilWellTexas">USA Texas Oil Well 70-hour/7-day</option>
<option value="HosRuleSetOregon7day">Oregon 70-hour/7-day</option>
<option value="HosRuleSetOregon8day">Oregon 80-hour/8-day</option>
<option value="HosRuleSetSouthCarolina7Day">South Carolina 70-hour/7-day</option>
<option value="HosRuleSetSouthCarolina8Day">South Carolina 80-hour/8-day</option>
</select>
<select id="options_hosRuleSet" class="checkmateFormEditField" title="This is the ruleset the user will follow when using hours of service."></select>
</div>
</p>
<p>
Expand Down Expand Up @@ -866,7 +780,8 @@ <h2>Template</h2>

document.addEventListener('click', toggleDocs, true);

document.addEventListener("DOMContentLoaded", function() {
document.addEventListener("DOMContentLoaded", function() {
populateHOSRuleSetSelect();
document.getElementById("content").addEventListener("keyup", function(event) {
event.preventDefault();

Expand Down Expand Up @@ -1475,6 +1390,32 @@ <h2>Template</h2>
else alert("Custom NFC Key Serial Number must be between 0 and 72057594037927940.")
return keys;
}

function getHOSRuleSet() {
return new Promise(function (resolve, reject) {
api.call("GetHosRuleSets", {
// empty
}, function (result) {
resolve(result);
}, function (error) {
reject(error);
});
});
}
async function populateHOSRuleSetSelect() {
try {
const hosRuleSetSelect = document.getElementById("options_hosRuleSet");
const result = await getHOSRuleSet();
result.forEach((option) => {
const optionElement = document.createElement("option");
optionElement.value = option.id;
optionElement.textContent = option.name;
hosRuleSetSelect.appendChild(optionElement);
});
} catch (error) {
console.error("Error fetching HOS Rule Set:", error);
}
}
</script>

</body>
Expand Down