main.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. require.config({
  2. hbs: {
  3. disableI18n: !0,
  4. helperPathCallback: function(name) {
  5. return "modules/Helpers";
  6. },
  7. templateExtension: "html",
  8. compileOptions: {}
  9. },
  10. urlArgs: "bust=" + getBustValue(),
  11. deps: [ "marionette" ],
  12. waitSeconds: 0,
  13. shim: {
  14. backbone: {
  15. deps: [ "underscore", "jquery" ],
  16. exports: "Backbone"
  17. },
  18. "jquery-ui": {
  19. deps: [ "jquery" ]
  20. },
  21. asBreadcrumbs: {
  22. deps: [ "jquery" ],
  23. exports: "asBreadcrumbs"
  24. },
  25. bootstrap: {
  26. deps: [ "jquery" ],
  27. exports: "jquery"
  28. },
  29. underscore: {
  30. exports: "_"
  31. },
  32. marionette: {
  33. deps: [ "backbone" ]
  34. },
  35. backgrid: {
  36. deps: [ "backbone" ],
  37. exports: "Backgrid"
  38. },
  39. "backgrid-paginator": {
  40. deps: [ "backbone", "backgrid" ]
  41. },
  42. "backgrid-filter": {
  43. deps: [ "backbone", "backgrid" ]
  44. },
  45. "backgrid-orderable": {
  46. deps: [ "backbone", "backgrid" ]
  47. },
  48. "backgrid-sizeable": {
  49. deps: [ "backbone", "backgrid" ]
  50. },
  51. "backgrid-select-all": {
  52. deps: [ "backbone", "backgrid" ]
  53. },
  54. "backgrid-columnmanager": {
  55. deps: [ "backbone", "backgrid" ]
  56. },
  57. hbs: {
  58. deps: [ "underscore", "handlebars" ]
  59. },
  60. d3: {
  61. exports: [ "d3" ]
  62. },
  63. "d3-tip": {
  64. deps: [ "d3" ],
  65. exports: [ "d3-tip" ]
  66. },
  67. LineageHelper: {
  68. deps: [ "d3" ]
  69. },
  70. dagreD3: {
  71. deps: [ "d3" ],
  72. exports: [ "dagreD3" ]
  73. },
  74. sparkline: {
  75. deps: [ "jquery" ],
  76. exports: [ "sparkline" ]
  77. },
  78. pnotify: {
  79. exports: [ "pnotify" ]
  80. },
  81. "jquery-placeholder": {
  82. deps: [ "jquery" ]
  83. },
  84. "query-builder": {
  85. deps: [ "jquery" ]
  86. },
  87. daterangepicker: {
  88. deps: [ "jquery", "moment" ]
  89. },
  90. "moment-timezone": {
  91. deps: [ "moment" ]
  92. },
  93. moment: {
  94. exports: [ "moment" ]
  95. },
  96. jstree: {
  97. deps: [ "jquery" ]
  98. },
  99. "jquery-steps": {
  100. deps: [ "jquery" ]
  101. }
  102. },
  103. paths: {
  104. jquery: "libs/jquery/js/jquery.min",
  105. underscore: "libs/underscore/underscore-min",
  106. bootstrap: "libs/bootstrap/js/bootstrap.min",
  107. backbone: "libs/backbone/backbone-min",
  108. "backbone.babysitter": "libs/backbone.babysitter/lib/backbone.babysitter.min",
  109. marionette: "libs/backbone-marionette/backbone.marionette.min",
  110. "backbone.paginator": "libs/backbone-paginator/backbone.paginator.min",
  111. "backbone.wreqr": "libs/backbone-wreqr/backbone.wreqr.min",
  112. backgrid: "libs/backgrid/js/backgrid",
  113. "backgrid-filter": "libs/backgrid-filter/js/backgrid-filter.min",
  114. "backgrid-orderable": "libs/backgrid-orderable-columns/js/backgrid-orderable-columns",
  115. "backgrid-paginator": "libs/backgrid-paginator/js/backgrid-paginator.min",
  116. "backgrid-sizeable": "libs/backgrid-sizeable-columns/js/backgrid-sizeable-columns",
  117. "backgrid-columnmanager": "external_lib/backgrid-columnmanager/js/Backgrid.ColumnManager",
  118. asBreadcrumbs: "libs/jquery-asBreadcrumbs/js/jquery-asBreadcrumbs.min",
  119. d3: "libs/d3/d3.min",
  120. "d3-tip": "libs/d3/index",
  121. LineageHelper: "external_lib/atlas-lineage/dist/index",
  122. dagreD3: "libs/dagre-d3/dagre-d3.min",
  123. sparkline: "libs/sparkline/jquery.sparkline.min",
  124. tmpl: "templates",
  125. "requirejs.text": "libs/requirejs-text/text",
  126. handlebars: "external_lib/require-handlebars-plugin/js/handlebars",
  127. hbs: "external_lib/require-handlebars-plugin/js/hbs",
  128. i18nprecompile: "external_lib/require-handlebars-plugin/js/i18nprecompile",
  129. select2: "libs/select2/select2.full.min",
  130. "backgrid-select-all": "libs/backgrid-select-all/backgrid-select-all.min",
  131. moment: "libs/moment/js/moment.min",
  132. "moment-timezone": "libs/moment-timezone/moment-timezone-with-data.min",
  133. "jquery-ui": "external_lib/jquery-ui/jquery-ui.min",
  134. pnotify: "external_lib/pnotify/pnotify.custom.min",
  135. "pnotify.buttons": "external_lib/pnotify/pnotify.custom.min",
  136. "pnotify.confirm": "external_lib/pnotify/pnotify.custom.min",
  137. "jquery-placeholder": "libs/jquery-placeholder/js/jquery.placeholder",
  138. platform: "libs/platform/platform",
  139. "query-builder": "libs/jQueryQueryBuilder/js/query-builder.standalone.min",
  140. daterangepicker: "libs/bootstrap-daterangepicker/js/daterangepicker",
  141. "table-dragger": "libs/table-dragger/table-dragger",
  142. jstree: "libs/jstree/jstree.min",
  143. "jquery-steps": "libs/jquery-steps/jquery.steps.min",
  144. dropzone: "libs/dropzone/js/dropzone-amd-module",
  145. "lossless-json": "libs/lossless-json/lossless-json"
  146. },
  147. enforceDefine: !1
  148. }), require([ "App", "router/Router", "utils/Helper", "utils/CommonViewFunction", "utils/Globals", "utils/UrlLinks", "collection/VEntityList", "collection/VTagList", "utils/Enums", "utils/Overrides", "bootstrap", "d3", "select2" ], function(App, Router, Helper, CommonViewFunction, Globals, UrlLinks, VEntityList, VTagList, Enums) {
  149. var that = this;
  150. this.asyncFetchCounter = 5 + (Enums.addOnEntities.length + 1), this.entityDefCollection = new VEntityList(),
  151. this.entityDefCollection.url = UrlLinks.entitiesDefApiUrl(), this.typeHeaders = new VTagList(),
  152. this.typeHeaders.url = UrlLinks.typesApiUrl(), this.enumDefCollection = new VTagList(),
  153. this.enumDefCollection.url = UrlLinks.enumDefApiUrl(), this.enumDefCollection.modelAttrName = "enumDefs",
  154. this.classificationDefCollection = new VTagList(), this.metricCollection = new VTagList(),
  155. this.metricCollection.url = UrlLinks.metricsApiUrl(), this.metricCollection.modelAttrName = "data",
  156. this.classificationAndMetricEvent = new Backbone.Wreqr.EventAggregator(), this.businessMetadataDefCollection = new VEntityList(),
  157. this.businessMetadataDefCollection.url = UrlLinks.businessMetadataDefApiUrl(), this.businessMetadataDefCollection.modelAttrName = "businessMetadataDefs",
  158. App.appRouter = new Router({
  159. entityDefCollection: this.entityDefCollection,
  160. typeHeaders: this.typeHeaders,
  161. enumDefCollection: this.enumDefCollection,
  162. classificationDefCollection: this.classificationDefCollection,
  163. metricCollection: this.metricCollection,
  164. classificationAndMetricEvent: this.classificationAndMetricEvent,
  165. businessMetadataDefCollection: this.businessMetadataDefCollection
  166. });
  167. var startApp = function() {
  168. 0 === that.asyncFetchCounter && App.start();
  169. };
  170. CommonViewFunction.userDataFetch({
  171. url: UrlLinks.sessionApiUrl(),
  172. callback: function(response) {
  173. if (response) {
  174. if (response.userName && (Globals.userLogedIn.status = !0, Globals.userLogedIn.response = response),
  175. void 0 !== response["atlas.entity.create.allowed"] && (Globals.entityCreate = response["atlas.entity.create.allowed"]),
  176. void 0 !== response["atlas.entity.update.allowed"] && (Globals.entityUpdate = response["atlas.entity.update.allowed"]),
  177. void 0 !== response["atlas.ui.editable.entity.types"]) {
  178. var entityTypeList = response["atlas.ui.editable.entity.types"].trim().split(",");
  179. entityTypeList.length && ("*" === entityTypeList[0] ? Globals.entityTypeConfList = [] : entityTypeList.length > 0 && (Globals.entityTypeConfList = entityTypeList));
  180. }
  181. if (void 0 !== response["atlas.ui.default.version"] && (Globals.DEFAULT_UI = response["atlas.ui.default.version"]),
  182. void 0 !== response["atlas.ui.date.format"]) {
  183. // Globals.dateTimeFormat = response["atlas.ui.date.format"];
  184. Globals.dateTimeFormat = "YYYY-MM-DD HH:mm:ss";
  185. var dateFormatSeperated = Globals.dateTimeFormat.split(" ");
  186. dateFormatSeperated[0] && (Globals.dateFormat = dateFormatSeperated[0]);
  187. }
  188. void 0 !== response["atlas.ui.date.timezone.format.enabled"] && (Globals.isTimezoneFormatEnabled = response["atlas.ui.date.timezone.format.enabled"]),
  189. void 0 !== response["atlas.debug.metrics.enabled"] && (Globals.isDebugMetricsEnabled = response["atlas.debug.metrics.enabled"]),
  190. void 0 !== response["atlas.tasks.enabled"] && (Globals.isTasksEnabled = response["atlas.tasks.enabled"]);
  191. }
  192. --that.asyncFetchCounter, startApp();
  193. }
  194. }), this.entityDefCollection.fetch({
  195. complete: function() {
  196. that.entityDefCollection.fullCollection.comparator = function(model) {
  197. return model.get("name").toLowerCase();
  198. }, that.entityDefCollection.fullCollection.sort({
  199. silent: !0
  200. }), --that.asyncFetchCounter, startApp();
  201. }
  202. }), this.typeHeaders.fetch({
  203. async: !0,
  204. complete: function() {
  205. that.typeHeaders.fullCollection.comparator = function(model) {
  206. return model.get("name").toLowerCase();
  207. }, that.typeHeaders.fullCollection.sort({
  208. silent: !0
  209. }), --that.asyncFetchCounter, startApp();
  210. }
  211. }), this.enumDefCollection.fetch({
  212. complete: function() {
  213. that.enumDefCollection.fullCollection.comparator = function(model) {
  214. return model.get("name").toLowerCase();
  215. }, that.enumDefCollection.fullCollection.sort({
  216. silent: !0
  217. }), --that.asyncFetchCounter, startApp();
  218. }
  219. }), this.classificationDefCollection.fetch({
  220. async: !0,
  221. complete: function() {
  222. that.classificationDefCollection.fullCollection.comparator = function(model) {
  223. return model.get("name").toLowerCase();
  224. }, that.classificationDefCollection.fullCollection.sort({
  225. silent: !0
  226. }), that.classificationAndMetricEvent.trigger("classification:Update:ClassificationTab"),
  227. that.classificationAndMetricEvent.trigger("classification:Update:Search");
  228. }
  229. }), this.metricCollection.fetch({
  230. async: !0,
  231. success: function() {
  232. that.classificationAndMetricEvent.trigger("metricCollection:Update");
  233. }
  234. }), this.businessMetadataDefCollection.fetch({
  235. complete: function() {
  236. that.businessMetadataDefCollection.fullCollection.comparator = function(model) {
  237. return model.get("name").toLowerCase();
  238. }, that.businessMetadataDefCollection.fullCollection.sort({
  239. silent: !0
  240. }), --that.asyncFetchCounter, startApp();
  241. }
  242. }), CommonViewFunction.fetchRootEntityAttributes({
  243. url: UrlLinks.rootEntityDefUrl(Enums.addOnEntities[0]),
  244. entity: Enums.addOnEntities,
  245. callback: function() {
  246. --that.asyncFetchCounter, startApp();
  247. }
  248. }), CommonViewFunction.fetchRootClassificationAttributes({
  249. url: UrlLinks.rootClassificationDefUrl(Enums.addOnClassification[0]),
  250. classification: Enums.addOnClassification,
  251. callback: function() {
  252. --that.asyncFetchCounter, startApp();
  253. }
  254. });
  255. });