diff --git a/README.md b/README.md index 3c1356967f2..70f7a2f81c4 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Issue reports are encouraged! [Please read this article](http://polite.technolog * [Report a Bug](https://github.com/archesproject/arches/issues/new?template=bug.md) * [File a Feature Ticket](https://github.com/archesproject/arches/issues/new?template=feature.md) -[Version 7.5.0 release notes](https://github.com/archesproject/arches/blob/stable/7.5.0/releases/7.5.0.md) +[Version 7.5.1 release notes](https://github.com/archesproject/arches/blob/stable/7.5.0/releases/7.5.1.md) #### Quick Install diff --git a/arches/app/etl_modules/base_data_editor.py b/arches/app/etl_modules/base_data_editor.py index 68f84a16037..54fa921f13c 100644 --- a/arches/app/etl_modules/base_data_editor.py +++ b/arches/app/etl_modules/base_data_editor.py @@ -231,7 +231,7 @@ def edit_staged_data(self, cursor, graph_id, node_id, operation, language_code, result["message"] = _("Unable to edit staged data: {}").format(str(e)) return result - def get_preview_data(self, node_id, search_url, language_code, operation, old_text, case_insensitive, whole_word): + def get_preview_data(self, node_id, search_url, language_code, operation, old_text, case_insensitive, whole_word, preview_limit): request = HttpRequest() request.user = self.request.user request.method = "GET" @@ -312,7 +312,7 @@ def get_preview_data(self, node_id, search_url, language_code, operation, old_te nested_agg.add_aggregation(search_filter_agg) se = SearchEngineFactory().create() - query = Query(se, limit=5) + query = Query(se, limit=preview_limit) query.add_query(search_url_query) query.add_aggregation(nested_agg) @@ -326,7 +326,7 @@ def get_preview_data(self, node_id, search_url, language_code, operation, old_te number_of_resources = results['hits']['total']['value'] number_of_tiles = results["aggregations"]["tile_agg"]["string_search"]["buckets"][0]["doc_count"] - return values[:5], number_of_tiles, number_of_resources + return values[:preview_limit], number_of_tiles, number_of_resources def preview(self, request): graph_id = request.POST.get("graph_id", None) @@ -341,6 +341,8 @@ def preview(self, request): also_trim = request.POST.get("also_trim", "false") search_url = request.POST.get("search_url", None) + preview_limit = ETLModule.objects.get(pk=self.moduleid).config.get("previewLimit", 5) + try: self.validate_inputs(request) except MissingRequiredInputError as e: @@ -374,7 +376,7 @@ def preview(self, request): try: first_five_values, number_of_tiles, number_of_resources = self.get_preview_data( - node_id, search_url, language_code, operation, old_text, case_insensitive, whole_word + node_id, search_url, language_code, operation, old_text, case_insensitive, whole_word, preview_limit ) except TypeError: return { @@ -408,7 +410,7 @@ def preview(self, request): return { "success": True, - "data": {"value": return_list, "number_of_tiles": number_of_tiles, "number_of_resources": number_of_resources}, + "data": {"value": return_list, "number_of_tiles": number_of_tiles, "number_of_resources": number_of_resources, "preview_limit": preview_limit}, } def write(self, request): diff --git a/arches/app/media/css/arches.scss b/arches/app/media/css/arches.scss index a9b5950d986..59f784d8beb 100644 --- a/arches/app/media/css/arches.scss +++ b/arches/app/media/css/arches.scss @@ -11824,12 +11824,11 @@ a.filter-tools:hover { } .map-coordinate-editor { - margin-top: 15px; + margin-top: 5px; } .map-coordinate-editor-crs-selector { - position: fixed; - margin-top: 25px; + margin-top: 10px; background: #fff; padding-bottom: 8px; border-bottom: 1px solid #ddd; @@ -11849,8 +11848,9 @@ a.filter-tools:hover { } .map-coordinate-editor-list { - padding: 0 5px; - margin-top: 70px; + padding-top: 5px; + padding-left: 5px; + overflow-y: auto; } .map-coordinate-editor-list a:focus i { @@ -11894,21 +11894,18 @@ a.filter-tools:hover { } .map-coordinate-editor-header { - position: fixed; background: #fff; padding: 6px 0; font-size: 1.2em; width: 370px; - margin-top: -6px; } .map-coordinate-editor-pair.map-coordinate-editor-new-coordinates { - padding: 0 0px 10px 4px; + padding: 5px 0px 5px 4px; } .map-coordinate-editor-button-container { - position: sticky; - bottom: -17px; + display: inline-flex; background: #fff; width: 400px; padding: 10px 5px; diff --git a/arches/app/media/js/viewmodels/file-widget.js b/arches/app/media/js/viewmodels/file-widget.js index c04290cc0ac..b757bcc148b 100644 --- a/arches/app/media/js/viewmodels/file-widget.js +++ b/arches/app/media/js/viewmodels/file-widget.js @@ -231,16 +231,12 @@ define([ }); }, this, 'beforeChange'); - this.getFileUrl = function(url){ - url = ko.unwrap(url); - var httpRegex = /^https?:\/\//; - // test whether the url is external (starts with http(s), if it is just return it) - if (httpRegex.test(url)){ - return url; - }else{ - return (arches.urls.url_subpath + url).replace('//', '/'); - } - + this.getFileUrl = function(urltoclean) { + const url = ko.unwrap(urltoclean); + const httpRegex = /^https?:\/\//; + // test whether the url is fully qualified or already starts with url_subpath + return !url || httpRegex.test(url) || url.startsWith(arches.urls.url_subpath) ? url : + (arches.urls.url_subpath + url).replace('//', '/'); }; if (Array.isArray(self.value())) { @@ -292,7 +288,7 @@ define([ } if (self.filesJSON().length > 0) { self.selectedFile(self.filesJSON()[newfilePosition]); } }; - + this.pageCt = ko.observable(5); this.pageCtReached = ko.computed(function() { return (self.filesJSON().length > self.pageCt() ? 'visible' : 'hidden'); @@ -399,7 +395,7 @@ define([ }; this.displayValue = ko.computed(function() { - return self.uploadedFiles().length === 1 ? ko.unwrap(self.uploadedFiles()[0].name) : self.uploadedFiles().length; + return self.uploadedFiles().length === 1 ? ko.unwrap(self.uploadedFiles()[0].name) : self.uploadedFiles().length; }); this.reportFiles = ko.computed(function() { diff --git a/arches/app/media/js/viewmodels/workflow-step.js b/arches/app/media/js/viewmodels/workflow-step.js index 78fb9e255db..4fcbb744187 100644 --- a/arches/app/media/js/viewmodels/workflow-step.js +++ b/arches/app/media/js/viewmodels/workflow-step.js @@ -130,7 +130,7 @@ define([ this.updateWorkflowComponentAbstractLookup = function(workflowComponentAbtractData) { var workflowComponentAbstractLookup = self.workflowComponentAbstractLookup(); - var workflowComponentAbstractId = self.id(); + var workflowComponentAbstractId = null; if (config.workflowHistory.stepdata) { const componentIdLookup = config.workflowHistory.stepdata?.[ko.unwrap(self.name)]?.[COMPONENT_ID_LOOKUP_LABEL]; @@ -214,6 +214,7 @@ define([ [ko.unwrap(self.name)]: { [key]: value, locked: self.locked(), + stepId: self.id(), }, }, }; diff --git a/arches/app/media/js/viewmodels/workflow.js b/arches/app/media/js/viewmodels/workflow.js index 7ae8d26ea54..4118e4ce0f8 100644 --- a/arches/app/media/js/viewmodels/workflow.js +++ b/arches/app/media/js/viewmodels/workflow.js @@ -130,7 +130,7 @@ define([ var stepName = ko.unwrap(stepConfigData.name); if (stepConfigData.workflowHistory.stepdata?.[stepName]) { // stepdata might exist without this specific stepName if injected - stepConfigData.id = Object.values(stepConfigData.workflowHistory.stepdata[stepName].componentIdLookup)[0]; + stepConfigData.id = stepConfigData.workflowHistory.stepdata[stepName].stepId; } stepConfigData.informationBoxDisplayed = ko.observable(self.getInformationBoxDisplayedStateFromLocalStorage(stepName)); diff --git a/arches/app/media/js/views/components/cards/photo-gallery-card.js b/arches/app/media/js/views/components/cards/photo-gallery-card.js index a907c1aa64c..9119271cb9e 100644 --- a/arches/app/media/js/views/components/cards/photo-gallery-card.js +++ b/arches/app/media/js/views/components/cards/photo-gallery-card.js @@ -2,6 +2,7 @@ define([ 'knockout', 'knockout-mapping', 'underscore', + 'arches', 'dropzone', 'uuid', 'viewmodels/card-component', @@ -12,9 +13,9 @@ define([ 'bindings/fadeVisible', 'bindings/dropzone', 'bindings/gallery', -], function(ko, koMapping, _, Dropzone, uuid, CardComponentViewModel, WorkbenchComponentViewModel, PhotoGallery, photoGalleryCardTemplate) { +], function(ko, koMapping, _, arches, Dropzone, uuid, CardComponentViewModel, WorkbenchComponentViewModel, PhotoGallery, photoGalleryCardTemplate) { const viewModel = function(params) { - + params.configKeys = ['acceptedFiles', 'maxFilesize']; var self = this; CardComponentViewModel.apply(this, [params]); @@ -48,13 +49,19 @@ define([ this.fileListNodeId = getfileListNode(); + this.cleanUrl = function(url) { + const httpRegex = /^https?:\/\//; + return !url || httpRegex.test(url) || url.startsWith(arches.urls.url_subpath) ? url : + (arches.urls.url_subpath + url).replace('//', '/'); + }; + this.getUrl = function(tile){ var url = ''; var name = ''; var val = ko.unwrap(tile.data[this.fileListNodeId]); if (val && val.length == 1) { { - url = ko.unwrap(val[0].url) || ko.unwrap(val[0].content); + url = self.cleanUrl(ko.unwrap(val[0].url)) || ko.unwrap(val[0].content); name = ko.unwrap(val[0].name); } } diff --git a/arches/app/media/js/views/components/etl_modules/base-bulk-string-editor.js b/arches/app/media/js/views/components/etl_modules/base-bulk-string-editor.js index a710e36e05c..e4854a43937 100644 --- a/arches/app/media/js/views/components/etl_modules/base-bulk-string-editor.js +++ b/arches/app/media/js/views/components/etl_modules/base-bulk-string-editor.js @@ -57,6 +57,7 @@ define([ this.loadId = params.loadId || uuid.generate(); this.resourceids = ko.observable(); this.previewValue = ko.observable(); + this.previewLimit = ko.observable(); this.showPreview = ko.observable(false); this.searchUrl = ko.observable(); this.caseInsensitive = ko.observable(); @@ -204,6 +205,7 @@ define([ self.showPreview(true); self.numberOfResources(data.result.number_of_resources); self.numberOfTiles(data.result.number_of_tiles); + self.previewLimit(data.result.preview_limit); }).fail(function(err) { self.alert( new JsonErrorAlertViewModel( diff --git a/arches/app/media/js/views/components/widgets/text.js b/arches/app/media/js/views/components/widgets/text.js index 7b3eefee477..dab21caf46e 100644 --- a/arches/app/media/js/views/components/widgets/text.js +++ b/arches/app/media/js/views/components/widgets/text.js @@ -129,14 +129,15 @@ define([ }); - const valueLeaf = self.value?.[arches.activeLanguage]?.value || self.value; - valueLeaf?.subscribe(newValue => { - const currentLanguage = self.currentLanguage(); - if(!currentLanguage) { return; } - if(JSON.stringify(currentValue) != JSON.stringify(ko.toJS(ko.unwrap(self.value)))){ - self.currentText(newValue?.[currentLanguage.code]?.value || newValue); - } - }); + if (ko.isObservable(self.value)) { + self.value.subscribe(newValue => { + const currentLanguage = self.currentLanguage(); + if(!currentLanguage) { return; } + if(JSON.stringify(currentValue) != JSON.stringify(ko.toJS(ko.unwrap(self.value)))){ + self.currentText(newValue?.[currentLanguage.code]?.value); + } + }); + } self.currentText.subscribe(newValue => { const currentLanguage = self.currentLanguage(); diff --git a/arches/app/models/migrations/9219_divide_individual_editors.py b/arches/app/models/migrations/9219_divide_individual_editors.py index 7a488baba65..a4dffa75b21 100644 --- a/arches/app/models/migrations/9219_divide_individual_editors.py +++ b/arches/app/models/migrations/9219_divide_individual_editors.py @@ -26,7 +26,7 @@ class Migration(migrations.Migration): 'bulk-trim-editor', 'base_data_editor.py', 'BulkStringEditor', - '{"bgColor": "#2ecc71", "circleColor": "#51D88C", "show": true}', + '{"bgColor": "#2ecc71", "circleColor": "#51D88C", "show": true, "previewLimit": 5}', 'fa fa-edit', 'bulk-trim-editor' ), @@ -39,7 +39,7 @@ class Migration(migrations.Migration): 'bulk-case-editor', 'base_data_editor.py', 'BulkStringEditor', - '{"bgColor": "#7EC8E3", "circleColor": "#AEC6CF", "show": true}', + '{"bgColor": "#7EC8E3", "circleColor": "#AEC6CF", "show": true, "previewLimit": 5}', 'fa fa-edit', 'bulk-case-editor' ), @@ -52,7 +52,7 @@ class Migration(migrations.Migration): 'bulk-replace-editor', 'base_data_editor.py', 'BulkStringEditor', - '{"bgColor": "#27ae60", "circleColor": "#51D88C", "show": true}', + '{"bgColor": "#27ae60", "circleColor": "#51D88C", "show": true, "previewLimit": 5}', 'fa fa-edit', 'bulk-replace-editor' ); diff --git a/arches/app/templates/views/components/coordinate-editor.htm b/arches/app/templates/views/components/coordinate-editor.htm index 7aa1d97fd30..341cf1b6342 100644 --- a/arches/app/templates/views/components/coordinate-editor.htm +++ b/arches/app/templates/views/components/coordinate-editor.htm @@ -1,7 +1,7 @@ {% load i18n %} -