Skip to content

Commit

Permalink
Bitrise build 11511
Browse files Browse the repository at this point in the history
  • Loading branch information
Bitrise Buildbot committed Sep 20, 2024
1 parent 7e39ca2 commit 9d2b636
Show file tree
Hide file tree
Showing 10 changed files with 179 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
<title>getMinAvailabilityHtml</title>
<link href="../../../images/logo-icon.svg" rel="icon" type="image/svg">
<script>var pathToRoot = "../../../";</script>
<script>const storage = localStorage.getItem("dokka-dark-mode")
if (storage == null) {
const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
if (osDarkSchemePreferred === true) {
document.getElementsByTagName("html")[0].classList.add("theme-dark")
}
} else {
const savedDarkMode = JSON.parse(storage)
if(savedDarkMode === true) {
document.getElementsByTagName("html")[0].classList.add("theme-dark")
}
}
</script>
<script type="text/javascript" src="../../../scripts/sourceset_dependencies.js" async="async"></script>
<link href="../../../styles/style.css" rel="Stylesheet">
<link href="../../../styles/jetbrains-mono.css" rel="Stylesheet">
<link href="../../../styles/main.css" rel="Stylesheet">
<link href="../../../styles/prism.css" rel="Stylesheet">
<link href="../../../styles/logo-styles.css" rel="Stylesheet">
<script type="text/javascript" src="../../../scripts/clipboard.js" async="async"></script>
<script type="text/javascript" src="../../../scripts/navigation-loader.js" async="async"></script>
<script type="text/javascript" src="../../../scripts/platform-content-handler.js" async="async"></script>
<script type="text/javascript" src="../../../scripts/main.js" defer="defer"></script>
<script type="text/javascript" src="../../../scripts/prism.js" async="async"></script>
<script type="text/javascript" src="../../../scripts/symbol-parameters-wrapper_deferred.js" defer="defer"></script>
</head>
<body>
<div class="navigation-wrapper" id="navigation-wrapper">
<div id="leftToggler"><span class="icon-toggler"></span></div>
<div class="library-name">
<a href="../../../index.html">
<span>output</span>
</a>
</div>
<div>
</div>
<div class="pull-right d-flex">
<div class="filter-section" id="filter-section">
<button class="platform-tag platform-selector jvm-like" data-active="" data-filter=":geotabdrivesdk:dokkaHtml/release">androidJvm</button>
</div>
<button id="theme-toggle-button"><span id="theme-toggle"></span></button>
<div id="searchBar"></div>
</div>
</div>
<div id="container">
<div id="leftColumn">
<div id="sideMenu"></div>
</div>
<div id="main">
<div class="main-content" data-page-type="member" id="content" pageIds="output::com.geotab.mobile.sdk.publicInterfaces/DriveSdk/getMinAvailabilityHtml/#kotlin.String#kotlin.Function1[com.geotab.mobile.sdk.module.Result[com.geotab.mobile.sdk.module.Success[kotlin.String],com.geotab.mobile.sdk.module.Failure],kotlin.Unit]/PointingToDeclaration//-1010896762">
<div class="breadcrumbs"><a href="../../../index.html">output</a><span class="delimiter">/</span><a href="../index.html">com.geotab.mobile.sdk.publicInterfaces</a><span class="delimiter">/</span><a href="index.html">DriveSdk</a><span class="delimiter">/</span><span class="current">getMinAvailabilityHtml</span></div>
<div class="cover ">
<h1 class="cover"><span>get</span><wbr></wbr><span>Min</span><wbr></wbr><span>Availability</span><wbr></wbr><span><span>Html</span></span></h1>
</div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":geotabdrivesdk:dokkaHtml/release"><div class="symbol monospace"><span class="token keyword">abstract </span><span class="token keyword"></span><span class="token keyword">fun </span><a href="get-min-availability-html.html"><span class="token function">getMinAvailabilityHtml</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">userName<span class="token operator">: </span><span data-unresolved-link="kotlin/String///PointingToDeclaration/">String</span><span class="token punctuation">, </span></span><span class="parameter ">callback<span class="token operator">: </span><span class="token punctuation">(</span><span class="token keyword"></span><span data-unresolved-link="com.geotab.mobile.sdk.module/Result///PointingToDeclaration/">Result</span><span class="token operator">&lt;</span><span class="token keyword"></span><span data-unresolved-link="com.geotab.mobile.sdk.module/Success///PointingToDeclaration/">Success</span><span class="token operator">&lt;</span><span class="token keyword"></span><span data-unresolved-link="kotlin/String///PointingToDeclaration/">String</span><span class="token operator">&gt;</span><span class="token punctuation">, </span><span class="token keyword"></span><span data-unresolved-link="com.geotab.mobile.sdk.module/Failure///PointingToDeclaration/">Failure</span><span class="token operator">&gt;</span><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><span class="token keyword"></span><span data-unresolved-link="kotlin/Unit///PointingToDeclaration/">Unit</span></span></span><span class="token punctuation">)</span></div><p class="paragraph">Returns the active driver's Minimum availability as html</p><span class="kdoc-tag"><h4 class="">Return</h4><p class="paragraph">Html string with the minimum availability</p></span></div></div>
</div>
<div class="footer">
<span class="go-to-top-icon"><a href="#content" id="go-to-top-link"></a></span><span>© 2024 Copyright</span><span
class="pull-right"><span>Generated by </span><a
href="https://github.com/Kotlin/dokka"><span>dokka</span><span class="padded-icon"></span></a></span>
</div>
</div>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,21 @@ <h2 class="">Functions</h2>
</div>
</div>
</div>
<a data-name="-1426027592%2FFunctions%2F-1010896762" anchor-label="getMinAvailabilityHtml" id="-1426027592%2FFunctions%2F-1010896762" data-filterable-set=":geotabdrivesdk:dokkaHtml/release"></a>
<div class="table-row" data-filterable-current=":geotabdrivesdk:dokkaHtml/release" data-filterable-set=":geotabdrivesdk:dokkaHtml/release">
<div class="main-subrow keyValue ">
<div class=""><span class="inline-flex">
<div><a href="get-min-availability-html.html"><span>get</span><wbr></wbr><span>Min</span><wbr></wbr><span>Availability</span><wbr></wbr><span><span>Html</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-1426027592%2FFunctions%2F-1010896762"></span>
<div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div>
<div class="title">
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":geotabdrivesdk:dokkaHtml/release"><div class="symbol monospace"><span class="token keyword">abstract </span><span class="token keyword"></span><span class="token keyword">fun </span><a href="get-min-availability-html.html"><span class="token function">getMinAvailabilityHtml</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">userName<span class="token operator">: </span><span data-unresolved-link="kotlin/String///PointingToDeclaration/">String</span><span class="token punctuation">, </span></span><span class="parameter ">callback<span class="token operator">: </span><span class="token punctuation">(</span><span class="token keyword"></span><span data-unresolved-link="com.geotab.mobile.sdk.module/Result///PointingToDeclaration/">Result</span><span class="token operator">&lt;</span><span class="token keyword"></span><span data-unresolved-link="com.geotab.mobile.sdk.module/Success///PointingToDeclaration/">Success</span><span class="token operator">&lt;</span><span class="token keyword"></span><span data-unresolved-link="kotlin/String///PointingToDeclaration/">String</span><span class="token operator">&gt;</span><span class="token punctuation">, </span><span class="token keyword"></span><span data-unresolved-link="com.geotab.mobile.sdk.module/Failure///PointingToDeclaration/">Failure</span><span class="token operator">&gt;</span><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><span class="token keyword"></span><span data-unresolved-link="kotlin/Unit///PointingToDeclaration/">Unit</span></span></span><span class="token punctuation">)</span></div><div class="brief "><p class="paragraph">Returns the active driver's Minimum availability as html</p></div></div></div>
</div>
</div>
</div>
</div>
<a data-name="-471478795%2FFunctions%2F-1010896762" anchor-label="getOpenCabAvailability" id="-471478795%2FFunctions%2F-1010896762" data-filterable-set=":geotabdrivesdk:dokkaHtml/release"></a>
<div class="table-row" data-filterable-current=":geotabdrivesdk:dokkaHtml/release" data-filterable-set=":geotabdrivesdk:dokkaHtml/release">
<div class="main-subrow keyValue ">
Expand Down
1 change: 1 addition & 0 deletions docs/output/package-list
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ $dokka.location:com.geotab.mobile.sdk.publicInterfaces/DriveSdk/getAllUsers/#kot
$dokka.location:com.geotab.mobile.sdk.publicInterfaces/DriveSdk/getAvailability/#kotlin.String#kotlin.Function1[com.geotab.mobile.sdk.module.Result[com.geotab.mobile.sdk.module.Success[kotlin.String],com.geotab.mobile.sdk.module.Failure],kotlin.Unit]/PointingToDeclaration/output/com.geotab.mobile.sdk.publicInterfaces/-drive-sdk/get-availability.html
$dokka.location:com.geotab.mobile.sdk.publicInterfaces/DriveSdk/getDeviceEvents/#kotlin.Function1[com.geotab.mobile.sdk.module.Result[com.geotab.mobile.sdk.module.Success[kotlin.String],com.geotab.mobile.sdk.module.Failure],kotlin.Unit]/PointingToDeclaration/output/com.geotab.mobile.sdk.publicInterfaces/-drive-sdk/get-device-events.html
$dokka.location:com.geotab.mobile.sdk.publicInterfaces/DriveSdk/getHosRuleSet/#kotlin.String#kotlin.Function1[com.geotab.mobile.sdk.module.Result[com.geotab.mobile.sdk.module.Success[kotlin.String],com.geotab.mobile.sdk.module.Failure],kotlin.Unit]/PointingToDeclaration/output/com.geotab.mobile.sdk.publicInterfaces/-drive-sdk/get-hos-rule-set.html
$dokka.location:com.geotab.mobile.sdk.publicInterfaces/DriveSdk/getMinAvailabilityHtml/#kotlin.String#kotlin.Function1[com.geotab.mobile.sdk.module.Result[com.geotab.mobile.sdk.module.Success[kotlin.String],com.geotab.mobile.sdk.module.Failure],kotlin.Unit]/PointingToDeclaration/output/com.geotab.mobile.sdk.publicInterfaces/-drive-sdk/get-min-availability-html.html
$dokka.location:com.geotab.mobile.sdk.publicInterfaces/DriveSdk/getOpenCabAvailability/#kotlin.String#kotlin.Function1[com.geotab.mobile.sdk.module.Result[com.geotab.mobile.sdk.module.Success[kotlin.String],com.geotab.mobile.sdk.module.Failure],kotlin.Unit]/PointingToDeclaration/output/com.geotab.mobile.sdk.publicInterfaces/-drive-sdk/get-open-cab-availability.html
$dokka.location:com.geotab.mobile.sdk.publicInterfaces/DriveSdk/getStateDevice/#kotlin.Function1[com.geotab.mobile.sdk.module.Result[com.geotab.mobile.sdk.module.Success[kotlin.String],com.geotab.mobile.sdk.module.Failure],kotlin.Unit]/PointingToDeclaration/output/com.geotab.mobile.sdk.publicInterfaces/-drive-sdk/get-state-device.html
$dokka.location:com.geotab.mobile.sdk.publicInterfaces/DriveSdk/getUserViolations/#kotlin.String#kotlin.Function1[com.geotab.mobile.sdk.module.Result[com.geotab.mobile.sdk.module.Success[kotlin.String],com.geotab.mobile.sdk.module.Failure],kotlin.Unit]/PointingToDeclaration/output/com.geotab.mobile.sdk.publicInterfaces/-drive-sdk/get-user-violations.html
Expand Down
2 changes: 1 addition & 1 deletion docs/scripts/pages.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion geotabdrivesdk/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import java.util.Properties

val versionName = "6.7.0_72497"
val versionName = "6.7.0_72511"

plugins {
id("com.android.library")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
(async (callerId) => {
try {
const userName = '{{userName}}';

if (userName == null || userName === '') {
throw new Error('No users');
}

const api = window.webViewLayer.getApi(userName);
const availabilityHtml = await api.mobile.user.getMinAvailabilityHtml();

window.geotabModules.{{moduleName}}.{{functionName}}(
{ callerId, result: availabilityHtml },
() => {}
);
} catch (err) {
window.geotabModules.{{moduleName}}.{{functionName}}(
{ callerId, error: err.message },
() => {}
);
throw err;
}
})('{{callerId}}');
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ import com.geotab.mobile.sdk.module.user.DriverActionNecessaryCallbackType
import com.geotab.mobile.sdk.module.user.GetAllUsersFunction
import com.geotab.mobile.sdk.module.user.GetAvailabilityFunction
import com.geotab.mobile.sdk.module.user.GetHosRuleSetFunction
import com.geotab.mobile.sdk.module.user.GetMinAvailabilityHtmlFunction
import com.geotab.mobile.sdk.module.user.GetOpenCabAvailabilityFunction
import com.geotab.mobile.sdk.module.user.GetViolationsFunction
import com.geotab.mobile.sdk.module.user.LoginRequiredCallbackType
Expand Down Expand Up @@ -585,6 +586,16 @@ class DriveFragment :
}
}

override fun getMinAvailabilityHtml(
userName: String,
callback: (Result<Success<String>, Failure>) -> Unit
) {
(findModuleFunction(UserModule.MODULE_NAME, "getMinAvailabilityHtml") as? GetMinAvailabilityHtmlFunction)?.let {
it.userName = userName
functionCall(callback, it)
}
}

override fun getOpenCabAvailability(
version: String,
callback: (Result<Success<String>, Failure>) -> Unit
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package com.geotab.mobile.sdk.module.user

import android.content.Context
import com.geotab.mobile.sdk.Error
import com.geotab.mobile.sdk.models.enums.GeotabDriveError
import com.geotab.mobile.sdk.module.BaseCallbackFunction
import com.geotab.mobile.sdk.module.Failure
import com.geotab.mobile.sdk.module.ModuleFunction
import com.geotab.mobile.sdk.module.Result
import com.geotab.mobile.sdk.module.Success

class GetMinAvailabilityHtmlFunction(
override val name: String = "getMinAvailabilityHtml",
override val module: UserModule
) : ModuleFunction,
BaseCallbackFunction(name) {

var userName = ""

companion object {
const val TEMPLATE_FILE_NAME = "ModuleFunction.GetMinAvailabilityHtmlFunction.Api.js"
}

override fun handleJavascriptCall(
jsonString: String?,
jsCallback: (Result<Success<String>, Failure>) -> Unit
) {
val response = this.transformOrInvalidate(jsonString, jsCallback) ?: return
val sdkCallback = this.getSdkCallbackOrInvalidate(response, jsCallback) ?: return
if (!response.result.isNullOrEmpty()) {
sdkCallback(Success(response.result))
} else {
jsCallback(Failure(Error(GeotabDriveError.JS_ISSUED_ERROR)))
callbacks.remove(response.callerId)
return
}

callbacks.remove(response.callerId)
jsCallback(Success("undefined"))
}

override fun getJavascript(context: Context, callerId: String): String {
val scriptParameter: HashMap<String, Any> =
hashMapOf("moduleName" to module.name, "functionName" to name, "userName" to userName)
scriptParameter.putAll(hashMapOf("callerId" to callerId))
return module.getScriptFromTemplate(context, TEMPLATE_FILE_NAME, scriptParameter)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class UserModule : Module(MODULE_NAME) {
functions.add(GetViolationsFunction(module = this))
functions.add(SetDriverSeatFunction(module = this))
functions.add(GetAvailabilityFunction(module = this))
functions.add(GetMinAvailabilityHtmlFunction(module = this))
functions.add(GetHosRuleSetFunction(module = this))
functions.add(DriverActionNecessaryFunction(module = this))
functions.add(PageNavigationFunction(module = this))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ interface DriveSdk {
*/
fun getAvailability(userName: String, callback: (Result<Success<String>, Failure>) -> Unit)

/**
* Returns the active driver's Minimum availability as html
* @return Html string with the minimum availability
*/
fun getMinAvailabilityHtml(userName: String, callback: (Result<Success<String>, Failure>) -> Unit)

/**
* Returns the active driver's availability hours for OpenCab
* @return Json string with the duty status availability
Expand Down

0 comments on commit 9d2b636

Please sign in to comment.