Skip to content

Commit

Permalink
Fixed #18, adapted to newest WebApiClient
Browse files Browse the repository at this point in the history
  • Loading branch information
DigitalFlow committed Jul 5, 2018
1 parent 31a61f1 commit 8304fb6
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/js/PropertyEditor/AttributePropertyHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
var request = {
entityName: "EntityDefinition",
entityId: entityMetadataId,
queryParams: "/Attributes?$filter=IsCustomizable/Value eq true and IsLogical eq false"
queryParams: "/Attributes?$filter=IsCustomizable/Value eq true"
};

WebApiClient.Retrieve(request)
Expand Down Expand Up @@ -174,7 +174,7 @@
requests.push(request);
}

Promise.resolve(requests)
WebApiClient.Promise.resolve(requests)
.each(function(request) {
return WebApiClient.SendRequest(request.method, request.url, request.attribute, request.headers);
})
Expand Down
4 changes: 2 additions & 2 deletions src/js/Translator/AttributeHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
var request = {
entityName: "EntityDefinition",
entityId: entityMetadataId,
queryParams: "/Attributes?$filter=IsCustomizable/Value eq true and IsLogical eq false"
queryParams: "/Attributes?$filter=IsCustomizable/Value eq true"
};

return WebApiClient.Retrieve(request)
Expand Down Expand Up @@ -146,7 +146,7 @@
requests.push(request);
}

return Promise.resolve(requests)
return WebApiClient.Promise.resolve(requests)
.each(function(request) {
return WebApiClient.SendRequest(request.method, request.url, request.attribute, request.headers);
})
Expand Down
4 changes: 2 additions & 2 deletions src/js/Translator/FormHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@
language: initialLanguage
});

return Promise.reduce(requests, function(total, request){
return WebApiClient.Promise.reduce(requests, function(total, request){
if (request.action === "Update") {
return WebApiClient.Update({
overriddenSetName: "usersettingscollection",
Expand All @@ -408,7 +408,7 @@
});
}
else if (request.action === "Retrieve") {
return Promise.props({
return WebApiClient.Promise.props({
forms: WebApiClient.Retrieve(formRequest),
languageCode: request.language
})
Expand Down
6 changes: 3 additions & 3 deletions src/js/Translator/FormMetaHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@
}
})

var prop = Promise.props({
var prop = WebApiClient.Promise.props({
recid: form.formid,
labels: WebApiClient.Execute(retrieveLabelsRequest)
});

requests.push(prop);
}

return Promise.all(requests);
return WebApiClient.Promise.all(requests);
})
.then(function(responses) {
var forms = responses;
Expand Down Expand Up @@ -174,7 +174,7 @@
requests.push(request);
}

return Promise.resolve(requests)
return WebApiClient.Promise.resolve(requests)
.each(function(request) {
return WebApiClient.Execute(request);
})
Expand Down
2 changes: 1 addition & 1 deletion src/js/Translator/OptionSetHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
return OptionSetHandler.Load();
}

return Promise.resolve(updates)
return WebApiClient.Promise.resolve(updates)
.each(function(payload) {
return WebApiClient.SendRequest("POST", WebApiClient.GetApiUrl() + "UpdateOptionValue", payload);
})
Expand Down
4 changes: 2 additions & 2 deletions src/js/Translator/TranslationHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
function GetTranslation(fromLanguage, destLanguage, phrase) {
$.support.cors = true;

return Promise.resolve($.ajax({
return WebApiClient.Promise.resolve($.ajax({
url: BuildTranslationUrl(fromLanguage, destLanguage, phrase),
type: "GET",
crossDomain: true,
Expand Down Expand Up @@ -200,7 +200,7 @@
translationRequests.push(GetTranslation(fromIso, toIso, record[fromLcid]));
}

Promise.all(translationRequests)
WebApiClient.Promise.all(translationRequests)
.then(function (responses) {
AddTranslations(fromLcid, destLcid, updateRecords, responses);
XrmTranslator.UnlockGrid();
Expand Down
6 changes: 3 additions & 3 deletions src/js/Translator/ViewHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@
}
})

var prop = Promise.props({
var prop = WebApiClient.Promise.props({
recid: view.savedqueryid,
labels: WebApiClient.Execute(retrieveLabelsRequest)
});

requests.push(prop);
}

return Promise.all(requests);
return WebApiClient.Promise.all(requests);
})
.then(function(responses) {
var views = responses;
Expand Down Expand Up @@ -177,7 +177,7 @@
requests.push(request);
}

Promise.resolve(requests)
WebApiClient.Promise.resolve(requests)
.each(function(request) {
return WebApiClient.Execute(request);
})
Expand Down

0 comments on commit 8304fb6

Please sign in to comment.