Skip to content

Commit bf97752

Browse files
Merge pull request #583 from Esri/paul/authenticationImmediatelyReady
Additional support for automation
2 parents 5c72727 + f65ebd4 commit bf97752

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

uitools/import/Esri/ArcGISRuntime/Toolkit/AuthenticationView.qml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,13 @@ Item {
7171
const component = internal.viewNameForChallengeType(controller.currentChallengeType);
7272
if (component) {
7373
const incubator = component.incubateObject(authenticationView);
74-
incubator.onStatusChanged = function(status) {
75-
if (status === Component.Ready) {
76-
this.object.open();
74+
if (incubator.status === Component.Ready) {
75+
incubator.object.open();
76+
} else {
77+
incubator.onStatusChanged = function(status) {
78+
if (status === Component.Ready) {
79+
this.object.open();
80+
}
7781
}
7882
}
7983
}

uitools/import/Esri/ArcGISRuntime/Toolkit/OAuth2View.qml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,19 @@ Dialog {
118118
const js = `setTimeout(function() { document.getElementById('user_username').value = '${username}'; document.getElementById('user_password').value = '${password}'; }, 1000);`;
119119
webView.runJavaScript(js);
120120
}
121+
122+
/*!
123+
\internal
124+
\brief Fill and accept the username and password
125+
*/
126+
function applyUsernameAndPassword(username, password) {
127+
const js = `
128+
setTimeout(function() {
129+
document.getElementById('user_username').value = '${username}';
130+
document.getElementById('user_password').value = '${password}';
131+
document.getElementById('oauth').submit();
132+
}, 1000);
133+
`;
134+
webView.runJavaScript(js);
135+
}
121136
}

uitools/import/Esri/ArcGISRuntime/Toolkit/UserCredentialsView.qml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,16 @@ Dialog {
118118
passwordTextField.text = password;
119119
}
120120

121+
/*!
122+
\internal
123+
\brief Fill and accept the username and password
124+
*/
125+
function applyUsernameAndPassword(username, password) {
126+
prefillUsernameAndPassword(username, password);
127+
acceptWithCurrentUsernameAndPassword();
128+
accept();
129+
}
130+
121131
/*!
122132
\internal
123133
\brief Attempts to apply the current username and password to

0 commit comments

Comments
 (0)