@openmrs/angularjs-openmrs-api
Advanced tools
Comparing version 0.7.0 to 0.7.1
@@ -540,4 +540,11 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
openmrsRest.get('session').then(function (response) { | ||
if (response['locale'] != null && response['locale']['language'] != null) { | ||
language = response['locale']['language']; | ||
if (response['locale'] != null) { | ||
//TODO: Mark reported in dd85b9060d9c28cd075c2586509e1195687e8a2f | ||
//that Locale is serialized differently on his system. | ||
//We need to support both cases until we clarify why. | ||
if (response['locale']['language'] != null) { | ||
language = response['locale']['language']; | ||
} else { | ||
language = response['locale']; | ||
} | ||
$translate.use(language); | ||
@@ -544,0 +551,0 @@ } else { |
@@ -1,2 +0,2 @@ | ||
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("angular"),require("angular-resource"),require("angular-translate"),require("angular-translate-loader-url")):"function"==typeof define&&define.amd?define("angularjs-openmrs-api",["angular","angular-resource","angular-translate","angular-translate-loader-url"],n):"object"==typeof exports?exports["angularjs-openmrs-api"]=n(require("angular"),require("angular-resource"),require("angular-translate"),require("angular-translate-loader-url")):e["angularjs-openmrs-api"]=n(e.angular,e["angular-resource"],e["angular-translate"],e["angular-translate-loader-url"])}(this,function(e,n,r,t){return function(e){function n(t){if(r[t])return r[t].exports;var u=r[t]={i:t,l:!1,exports:{}};return e[t].call(u.exports,u,u.exports,n),u.l=!0,u.exports}var r={};return n.m=e,n.c=r,n.i=function(e){return e},n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="",n(n.s=3)}([function(e,n,r){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}function u(e,n,r,t){function u(){o("/owa/")}function o(e){var n=r.location.pathname;n=n.substring(0,n.indexOf(e)),n.endsWith("/")&&(n=n.substring(0,n.length-1)),t.href=n}function a(){var r=n.defer();return c.default.isDefined(t.href)?r.resolve(t):"undefined"!=typeof OPENMRS_CONTEXT_PATH?(t.href=OPENMRS_CONTEXT_PATH,r.resolve(t)):e.get("manifest.webapp").then(function(n){n.data.activities.openmrs.testConfig?(t.href=n.data.activities.openmrs.testConfig.href,t.test=!0,e.defaults.headers.common["Disable-WWW-Authenticate"]=!1,e.defaults.withCredentials=!0,r.resolve(t)):(u(),r.resolve(t))},function(e){u(),r.resolve(t)}),r.promise}return{getConfig:a,setBaseAppPath:o}}function o(e,n,r){return{responseError:function(t){var u=n.location.href;if(u=u.replace("#","_HASHTAG_"),!r.test&&(401===t.status||403===t.status)&&n.confirm("The operation cannot be completed, because you are no longer logged in. Do you want to go to login page?")){var o=r.href+"/login.htm?redirect_url="+u;n.location.href=o}return e.reject(t)}}}function a(e){e.interceptors.push("authInterceptor"),e.defaults.headers.common["Disable-WWW-Authenticate"]="true"}function i(e,n,r){function t(t){var o=n.defer();return r.getConfig().then(function(n){var r,a;if(c.default.isString(t)){t={resource:t,url:"/"+t}}if(t.unnatural)r=t.params,a=n.href+"/ws/rest/v1"+t.url+"/:uuid";else{var i=c.default.copy(u.defaultConfig);r=c.default.extend(i,t.params),a=n.href+"/ws/rest/v1"+t.url+"/:uuid"}var s=t.actions||u.extraActions;u[t.resource]=e(a,r,s),o.resolve(u[t.resource])}),o.promise}var u={defaultConfig:{uuid:"@uuid"},add:t};return u}function s(){function e(e,n){return["openmrsRest",function(r){return r.list(e,n)}]}function n(e,n){return["openmrsRest",function(r){return r.get(e,n)}]}function r(e,n,r,t){function u(){var e=r.defer();return t.getConfig().then(function(n){e.resolve(n.href)}),e.promise}function o(e){t.setBaseAppPath(e)}function a(r,t){return e.add(r).then(function(e){return e.get(t).$promise.then(function(e){return new l(e,n)})})}function i(e,n){return n=x(n,"full"),a(e,n)}function s(e,n){return n=x(n,"ref"),a(e,n)}function f(n,r){return e.add(n).then(function(e){return e.get(r).$promise.then(function(e){return e})})}function d(e,n){return n=x(n,"full"),f(e,n)}function p(e,n){return n=x(n,"ref"),f(e,n)}function g(n,r){return e.add(n).then(function(e){return e.save(r).$promise.then(function(e){return e})})}function m(n,r){return e.add(n).then(function(e){return e.save({uuid:r.uuid},r).$promise.then(function(e){return e})})}function h(n,r,t){return e.add(n).then(function(e){return e.remove({uuid:r.uuid,reason:t}).$promise.then(function(e){return e})})}function v(n,r){return e.add(n).then(function(e){return e.save({uuid:r.uuid},{retired:!1}).$promise.then(function(e){return e})})}function $(n,r){var t={uuid:r.uuid};return null==t?t={purge:!0}:c.default.extend(t,{purge:!0}),e.add(n).then(function(e){return e.remove(t).$promise.then(function(e){return e})})}function x(e,n){return null==e?{v:n}:c.default.extend(e,{v:n})}return{list:a,listFull:i,listRef:s,get:f,getFull:d,getRef:p,create:g,update:m,remove:h,retire:h,unretire:v,purge:$,getServerUrl:u,setBaseAppPath:o}}return{list:e,get:n,$get:["openmrsApi","$document","$q","openmrsContext",function(e,n,t,u){return r(e,n,t,u)}]}}function l(e,n){function r(){return null!=a}function t(){return null!=i}function u(e){var r=n[0].createElement("a");r.href=e;var t=r.search.slice(1).split("&"),u={};return t.forEach(function(e){""!==e&&(e=e.split("="),u[e[0]]=decodeURIComponent(e[1]||""))}),u}var o=e.results,a=null,i=null;return function(){if(null!=e.links)for(var n=0;n<e.links.length;n++){var r=e.links[n];"next"===r.rel?a=u(r.uri):"prev"===r.rel&&(i=u(r.uri))}}(),{results:o,hasNext:r,nextQuery:a,hasPrevious:t,previousQuery:i}}Object.defineProperty(n,"__esModule",{value:!0});var f=r(1),c=t(f),d=r(4);t(d);n.default=c.default.module("angularjs-openmrs-api-rest",["ngResource"]).value("openmrsContextConfig",{}).factory("openmrsContext",u).factory("openmrsApi",i).factory("authInterceptor",o).config(a).provider("openmrsRest",s).name,u.$inject=["$http","$q","$window","openmrsContextConfig"],o.$inject=["$q","$window","openmrsContextConfig"],a.$inject=["$httpProvider"],i.$inject=["$resource","$q","openmrsContext"]},function(e,n){e.exports=require("angular")},function(e,n,r){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}function u(e,n){return function(r){var t=n.getServerUrl();return t.then(function(n){return r.url=n+"/module/uicommons/messages/messages.json",r.queryParameter="localeKey",e(r)}),t}}function o(e){function n(n,r){var t=e.translations(n);angular.isDefined(t)||(t={}),e.translations(n,angular.extend(t,r))}function r(e,n,r,t){function u(n){e.use(n),t.create("session",{locale:n}).then(function(){console.log("Locale changed to "+n)})}function o(){var n=r.defer();return angular.isDefined(a)?n.resolve(a):t.get("session").then(function(r){null!=r.locale&&null!=r.locale.language?(a=r.locale.language,e.use(a)):a=e.use(),n.resolve(a)},function(r){a=e.use(),n.resolve(a)}),n.promise}var a;return function(){o()}(),{changeLanguage:u,setLanguage:u,getLanguage:o}}return function(){e.fallbackLanguage("en").preferredLanguage("en").useLoader("openmrsTranslateLoader").useSanitizeValueStrategy("escape").forceAsyncReload(!0)}(),{addTranslations:n,$get:["$translate","$http","$q","openmrsRest",r]}}Object.defineProperty(n,"__esModule",{value:!0});var a=r(5),i=(t(a),r(6)),s=(t(i),r(0)),l=t(s);n.default=angular.module("angularjs-openmrs-api-translate",["pascalprecht.translate",l.default]).factory("openmrsTranslateLoader",u).provider("openmrsTranslate",o).name,u.$inject=["$translateUrlLoader","openmrsRest"],o.$inject=["$translateProvider"]},function(e,n,r){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var u=r(1),o=t(u),a=r(0),i=t(a),s=r(2),l=t(s);n.default=o.default.module("angularjs-openmrs-api",[i.default,l.default]).name},function(e,n){e.exports=require("angular-resource")},function(e,n){e.exports=require("angular-translate")},function(e,n){e.exports=require("angular-translate-loader-url")}])}); | ||
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("angular"),require("angular-resource"),require("angular-translate"),require("angular-translate-loader-url")):"function"==typeof define&&define.amd?define("angularjs-openmrs-api",["angular","angular-resource","angular-translate","angular-translate-loader-url"],n):"object"==typeof exports?exports["angularjs-openmrs-api"]=n(require("angular"),require("angular-resource"),require("angular-translate"),require("angular-translate-loader-url")):e["angularjs-openmrs-api"]=n(e.angular,e["angular-resource"],e["angular-translate"],e["angular-translate-loader-url"])}(this,function(e,n,r,t){return function(e){function n(t){if(r[t])return r[t].exports;var u=r[t]={i:t,l:!1,exports:{}};return e[t].call(u.exports,u,u.exports,n),u.l=!0,u.exports}var r={};return n.m=e,n.c=r,n.i=function(e){return e},n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="",n(n.s=3)}([function(e,n,r){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}function u(e,n,r,t){function u(){o("/owa/")}function o(e){var n=r.location.pathname;n=n.substring(0,n.indexOf(e)),n.endsWith("/")&&(n=n.substring(0,n.length-1)),t.href=n}function a(){var r=n.defer();return c.default.isDefined(t.href)?r.resolve(t):"undefined"!=typeof OPENMRS_CONTEXT_PATH?(t.href=OPENMRS_CONTEXT_PATH,r.resolve(t)):e.get("manifest.webapp").then(function(n){n.data.activities.openmrs.testConfig?(t.href=n.data.activities.openmrs.testConfig.href,t.test=!0,e.defaults.headers.common["Disable-WWW-Authenticate"]=!1,e.defaults.withCredentials=!0,r.resolve(t)):(u(),r.resolve(t))},function(e){u(),r.resolve(t)}),r.promise}return{getConfig:a,setBaseAppPath:o}}function o(e,n,r){return{responseError:function(t){var u=n.location.href;if(u=u.replace("#","_HASHTAG_"),!r.test&&(401===t.status||403===t.status)&&n.confirm("The operation cannot be completed, because you are no longer logged in. Do you want to go to login page?")){var o=r.href+"/login.htm?redirect_url="+u;n.location.href=o}return e.reject(t)}}}function a(e){e.interceptors.push("authInterceptor"),e.defaults.headers.common["Disable-WWW-Authenticate"]="true"}function i(e,n,r){function t(t){var o=n.defer();return r.getConfig().then(function(n){var r,a;if(c.default.isString(t)){t={resource:t,url:"/"+t}}if(t.unnatural)r=t.params,a=n.href+"/ws/rest/v1"+t.url+"/:uuid";else{var i=c.default.copy(u.defaultConfig);r=c.default.extend(i,t.params),a=n.href+"/ws/rest/v1"+t.url+"/:uuid"}var s=t.actions||u.extraActions;u[t.resource]=e(a,r,s),o.resolve(u[t.resource])}),o.promise}var u={defaultConfig:{uuid:"@uuid"},add:t};return u}function s(){function e(e,n){return["openmrsRest",function(r){return r.list(e,n)}]}function n(e,n){return["openmrsRest",function(r){return r.get(e,n)}]}function r(e,n,r,t){function u(){var e=r.defer();return t.getConfig().then(function(n){e.resolve(n.href)}),e.promise}function o(e){t.setBaseAppPath(e)}function a(r,t){return e.add(r).then(function(e){return e.get(t).$promise.then(function(e){return new l(e,n)})})}function i(e,n){return n=x(n,"full"),a(e,n)}function s(e,n){return n=x(n,"ref"),a(e,n)}function f(n,r){return e.add(n).then(function(e){return e.get(r).$promise.then(function(e){return e})})}function d(e,n){return n=x(n,"full"),f(e,n)}function p(e,n){return n=x(n,"ref"),f(e,n)}function g(n,r){return e.add(n).then(function(e){return e.save(r).$promise.then(function(e){return e})})}function m(n,r){return e.add(n).then(function(e){return e.save({uuid:r.uuid},r).$promise.then(function(e){return e})})}function h(n,r,t){return e.add(n).then(function(e){return e.remove({uuid:r.uuid,reason:t}).$promise.then(function(e){return e})})}function v(n,r){return e.add(n).then(function(e){return e.save({uuid:r.uuid},{retired:!1}).$promise.then(function(e){return e})})}function $(n,r){var t={uuid:r.uuid};return null==t?t={purge:!0}:c.default.extend(t,{purge:!0}),e.add(n).then(function(e){return e.remove(t).$promise.then(function(e){return e})})}function x(e,n){return null==e?{v:n}:c.default.extend(e,{v:n})}return{list:a,listFull:i,listRef:s,get:f,getFull:d,getRef:p,create:g,update:m,remove:h,retire:h,unretire:v,purge:$,getServerUrl:u,setBaseAppPath:o}}return{list:e,get:n,$get:["openmrsApi","$document","$q","openmrsContext",function(e,n,t,u){return r(e,n,t,u)}]}}function l(e,n){function r(){return null!=a}function t(){return null!=i}function u(e){var r=n[0].createElement("a");r.href=e;var t=r.search.slice(1).split("&"),u={};return t.forEach(function(e){""!==e&&(e=e.split("="),u[e[0]]=decodeURIComponent(e[1]||""))}),u}var o=e.results,a=null,i=null;return function(){if(null!=e.links)for(var n=0;n<e.links.length;n++){var r=e.links[n];"next"===r.rel?a=u(r.uri):"prev"===r.rel&&(i=u(r.uri))}}(),{results:o,hasNext:r,nextQuery:a,hasPrevious:t,previousQuery:i}}Object.defineProperty(n,"__esModule",{value:!0});var f=r(1),c=t(f),d=r(4);t(d);n.default=c.default.module("angularjs-openmrs-api-rest",["ngResource"]).value("openmrsContextConfig",{}).factory("openmrsContext",u).factory("openmrsApi",i).factory("authInterceptor",o).config(a).provider("openmrsRest",s).name,u.$inject=["$http","$q","$window","openmrsContextConfig"],o.$inject=["$q","$window","openmrsContextConfig"],a.$inject=["$httpProvider"],i.$inject=["$resource","$q","openmrsContext"]},function(e,n){e.exports=require("angular")},function(e,n,r){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}function u(e,n){return function(r){var t=n.getServerUrl();return t.then(function(n){return r.url=n+"/module/uicommons/messages/messages.json",r.queryParameter="localeKey",e(r)}),t}}function o(e){function n(n,r){var t=e.translations(n);angular.isDefined(t)||(t={}),e.translations(n,angular.extend(t,r))}function r(e,n,r,t){function u(n){e.use(n),t.create("session",{locale:n}).then(function(){console.log("Locale changed to "+n)})}function o(){var n=r.defer();return angular.isDefined(a)?n.resolve(a):t.get("session").then(function(r){null!=r.locale?(a=null!=r.locale.language?r.locale.language:r.locale,e.use(a)):a=e.use(),n.resolve(a)},function(r){a=e.use(),n.resolve(a)}),n.promise}var a;return function(){o()}(),{changeLanguage:u,setLanguage:u,getLanguage:o}}return function(){e.fallbackLanguage("en").preferredLanguage("en").useLoader("openmrsTranslateLoader").useSanitizeValueStrategy("escape").forceAsyncReload(!0)}(),{addTranslations:n,$get:["$translate","$http","$q","openmrsRest",r]}}Object.defineProperty(n,"__esModule",{value:!0});var a=r(5),i=(t(a),r(6)),s=(t(i),r(0)),l=t(s);n.default=angular.module("angularjs-openmrs-api-translate",["pascalprecht.translate",l.default]).factory("openmrsTranslateLoader",u).provider("openmrsTranslate",o).name,u.$inject=["$translateUrlLoader","openmrsRest"],o.$inject=["$translateProvider"]},function(e,n,r){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var u=r(1),o=t(u),a=r(0),i=t(a),s=r(2),l=t(s);n.default=o.default.module("angularjs-openmrs-api",[i.default,l.default]).name},function(e,n){e.exports=require("angular-resource")},function(e,n){e.exports=require("angular-translate")},function(e,n){e.exports=require("angular-translate-loader-url")}])}); | ||
//# sourceMappingURL=index.min.js.map |
{ | ||
"name": "@openmrs/angularjs-openmrs-api", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"description": "AngularJS (1.x) library for OpenMRS API", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
115523
565