Skip to content

Commit

Permalink
Standardize sampleOf and analysisAreaOf #1516
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls committed Jan 17, 2024
1 parent 4fe4143 commit 86484f8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ define([
this.areaNameFromTileData = (tileData) => {
const nameValue = tileData[self.partIdentifierAssignmentLabelNodeId];
const baseName = self.getStrValue(nameValue) || "";
return arches.translations.analysisAreaOf.replace('{}', baseName).replace('{}', self.physicalThingName());
return arches.translations.analysisAreaOf.replace('{analysisName}', baseName).replace('{physicalThingName}', self.physicalThingName());
};
this.areaName = ko.computed(function(){
if (self.selectedAnalysisAreaInstance()){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ define([
this.sampleNameFromTileData = (data) => {
const partIdentifierAssignmentLabelNodeId = '3e541cc6-859b-11ea-97eb-acde48001122';
const baseName = ko.unwrap(ko.unwrap(data[partIdentifierAssignmentLabelNodeId])?.[arches.activeLanguage]?.["value"]) || "";
return arches.translations.sampleOf.replace('{}', baseName).replace('{}', params.physicalThingName);
return arches.translations.sampleOf.replace('{sampleName}', baseName).replace('{physicalThingName}', params.physicalThingName);
};

this.sampleName = ko.computed(function() {
Expand Down
4 changes: 2 additions & 2 deletions arches_for_science/templates/javascript.htm
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@
takes-too-long='{% trans "This is taking longer than usual. Thank you for your patience." as takesTooLong %} "{{ takesTooLong|escapejs }}"'
analysis-area='{% trans "Analysis Area" as analysisArea %} "{{ analysisArea|escapejs }}"'
analysis-areas='{% trans "Analysis Areas" as analysisAreas %} "{{ analysisAreas|escapejs }}"'
analysis-area-of='{% trans "{analysisName} [Analysis Area of {physicalThingName}]" as analysisAreaOf %} "{{ analysisAreaOf|escapejs }}"'
sample-of='{% trans "{sampleName} [Sample of {physicalThingName}]" as sampleOf %} "{{ sampleOf|escapejs }}"'
no-modifying-areas='{% trans "Analysis Areas may not be modified in the sample taking workflow" as noModifyingAreas %} "{{ noModifyingAreas|escapejs }}"'
analysis-area-of='{% trans "{} [Analysis Area of {}]" as analysisAreaOf %} "{{ analysisAreaOf|escapejs }}"'
sample-of='{% trans "{} [Sample of {}]" as sampleOf %} "{{ sampleOf|escapejs }}"'
sample-location='{% trans "Sample Location" as sampleLocation %} "{{ sampleLocation|escapejs }}"'
no-modifying-samples='{% trans "Sample locations may not be modified in the analysis area workflow" as noModifyingSamples %} "{{ noModifyingSamples|escapejs }}"'
physical-thing-placeholder='{% trans "find a physical thing: enter an artist, object name, artwork title or object number" as physicalThingPlaceholder %} "{{ physicalThingPlaceholder|escapejs }}"'
Expand Down
6 changes: 3 additions & 3 deletions arches_for_science/views/analysis_area_and_sample_taking.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def post(self, request):
analysis_area_physical_thing_resourceid = part_identifier_assignment_tile_data[physical_part_of_object_nodeid][0]["resourceId"]

base_name = part_identifier_assignment_tile_data[part_identifier_assignment_label_nodeid][get_language()]["value"]
name = _("{} [Analysis Area of {}]").format(base_name, parent_physical_thing_name)
name = _("{analysisName} [Analysis Area of {physicalThingName}]").format(analysisName=base_name, physicalThingName=parent_physical_thing_name)

try:
with transaction.atomic():
Expand Down Expand Up @@ -365,8 +365,8 @@ def post(self, request):
sample_physical_thing_resourceid = sampling_unit_tile.data[sampling_area_sample_created_nodeid][0]["resourceId"]

base_name = part_identifier_assignment_tile_data[part_identifier_assignment_label_nodeid][get_language()]["value"]
sample_name = _("{} [Sample of {}]").format(base_name, parent_physical_thing_name)
sample_area_name = _("{} [Sample Area of {}]").format(base_name, parent_physical_thing_name)
sample_name = _("{sampleName} [Sample of {physicalThingName}]").format(sampleName=base_name, physicalThingName=parent_physical_thing_name)
sample_area_name = _("{sampleName} [Sample Area of {physicalThingName}]").format(sampleName=base_name, physicalThingName=parent_physical_thing_name)

try:
with transaction.atomic():
Expand Down

0 comments on commit 86484f8

Please sign in to comment.