Skip to content

Commit

Permalink
Merge pull request #35693 from dimagi/jls/app-manager-dependencies-gl…
Browse files Browse the repository at this point in the history
…obals-only

App manager js dependencies: jquery/knockout/underscore only
  • Loading branch information
orangejenny authored Jan 28, 2025
2 parents d9e337a + 59fb2da commit 5fe1480
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
hqDefine("app_manager/js/details/filter", [
"knockout",
], function (
ko,
) {
/**
* Model for the case list filter, which has a button to
* "Add Filter" when there's no filter, and when clicked
Expand All @@ -6,7 +11,6 @@
* @param filterText Initial text of the filter
* @param saveButton Save button for case list config
*/
hqDefine("app_manager/js/details/filter", function () {
return function (filterText, saveButton) {
var self = {};
self.filterText = ko.observable(typeof filterText === "string" && filterText.length > 0 ? filterText : "");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
/**
* Model for Lookup Table Case Selection in case list configuration.
*/
hqDefine("app_manager/js/details/fixture_select", function () {
hqDefine("app_manager/js/details/fixture_select", [
"knockout",
], function (
ko,
) {
return function (init) {
var self = {};
self.active = ko.observable(init.active);
Expand All @@ -17,4 +21,4 @@ hqDefine("app_manager/js/details/fixture_select", function () {
});
return self;
};
});
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"use strict";
hqDefine('app_manager/js/forms/custom_instances', function () {
'use strict';

hqDefine("app_manager/js/forms/custom_instances", [
"knockout",
], function (
ko,
) {
var customInstance = function (instanceId, instancePath) {
var self = {};
self.instanceId = ko.observable(instanceId || '');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
hqDefine("app_manager/js/modules/case_list_setting", function () {
hqDefine("app_manager/js/modules/case_list_setting", [
'jquery',
'underscore',
], function (
$,
_
) {
function getLabel(slug) { return $('.case-list-setting-label[data-slug="' + slug + '"]'); }
function getShow(slug) { return $('.case-list-setting-show[data-slug="' + slug + '"]'); }
function getMedia(slug) { return $('.case-list-setting-media[data-slug="' + slug + '"]'); }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
hqDefine('app_manager/js/modules/shadow_module_settings', function () {
hqDefine('app_manager/js/modules/shadow_module_settings', [
'knockout',
'underscore',
], function (
ko,
_,
) {
const module = {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
* When the user shows or hides a section, that preference is stored in localStorage.
*/
hqDefine("app_manager/js/section_changer", function () {
hqDefine("app_manager/js/section_changer", [
'jquery',
], function (
$
) {
// Determine key for localStorage
// page is something like "module-view"
// section is something like "logic"
Expand Down

0 comments on commit 5fe1480

Please sign in to comment.