Skip to content

Commit e28a4f1

Browse files
committed
Merge branch 'development' of github.com:SpeciesFileGroup/taxonworks into development
2 parents 0abdd1f + 79d564d commit e28a4f1

6 files changed

Lines changed: 246 additions & 34 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ This project <em>does not yet</em> adheres to [Semantic Versioning](https://semv
3434
- Unify fails to activate [#4310]
3535
- Unify fails to merge FieldOccurrences [#4315]
3636
- Repositories shouldn't try to render Citations
37+
- Pdf download of formatted sources
38+
- 500 on filter mass annotate for an annotation not supported on the model [#4307]
3739

38-
39-
[#4310]: https://github.com/SpeciesFileGroup/taxonworks/issues/4266
40-
[#4315]: https://github.com/SpeciesFileGroup/taxonworks/issues/4266
40+
[#4307]: https://github.com/SpeciesFileGroup/taxonworks/issues/4307
41+
[#4310]: https://github.com/SpeciesFileGroup/taxonworks/issues/4310
42+
[#4315]: https://github.com/SpeciesFileGroup/taxonworks/issues/4315
4143

4244
## [0.50.0] - 2025-04-24
4345

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ gem 'zip_tricks', '~> 5.6'
2424
gem 'daemons', '~> 1.4.1'
2525
gem 'tzinfo-data', '~> 1.2019' # , '>= 1.2019.3'
2626
gem 'psych', '~> 5.1'
27-
gem 'rmagick', '~> 6.0'
27+
gem 'rmagick', '~> 6.0'
2828
gem 'roo', '~> 2.8', '>= 2.8.3'
2929
gem 'roo-xls', '~> 1.2'
3030

@@ -111,6 +111,7 @@ gem 'csl-styles', '~> 2.0.1'
111111
gem 'serrano', '~> 1.4'
112112
# gem 'latex-decode', '~> 0.2.2'
113113
gem 'pdf-reader', '~> 2.2'
114+
gem 'prawn', '~> 2.5.0'
114115

115116
# UI/UX
116117
gem 'chartkick', '~> 5.0'
@@ -178,7 +179,6 @@ group :test, :development do
178179
gem 'byebug', '~> 11.1', {}.merge(ENV['RM_INFO'] ? {require: false} : {})
179180
gem 'factory_bot_rails', '~> 6.2'
180181
gem 'selenium-webdriver', '~> 4.6', '>= 4.6.1'
181-
gem 'prawn', '~> 2.5.0'
182182
gem 'puma', '~> 6.3'
183183
end
184184

app/controllers/sounds_controller.rb

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class SoundsController < ApplicationController
22
include DataControllerConfiguration::ProjectDataControllerConfiguration
3-
3+
44
before_action :set_sound, only: %i[ show edit update destroy api_show ]
55

66
after_action -> { set_pagination_headers(:sounds) }, only: [:index, :api_index], if: :json_request?
@@ -71,17 +71,22 @@ def update
7171

7272
# DELETE /sounds/1 or /sounds/1.json
7373
def destroy
74-
@sound.destroy!
75-
76-
respond_to do |format|
77-
format.html { redirect_to sounds_path, status: :see_other, notice: 'Sound was successfully destroyed.' }
78-
format.json { head :no_content }
74+
if @sound.destroy
75+
respond_to do |format|
76+
format.html { redirect_to sounds_path, status: :see_other, notice: 'Sound was successfully destroyed.' }
77+
format.json { head :no_content }
78+
end
79+
else
80+
respond_to do |format|
81+
format.html { redirect_to sounds_path, notice: @sound.errors.full_messages.join('. ') }
82+
format.json { head :no_content, status: :unprocessable_entity }
83+
end
7984
end
8085
end
8186

8287
def select_options
8388
@sounds = Sound.select_optimized(
84-
sessions_current_user_id,
89+
sessions_current_user_id,
8590
sessions_current_project_id,
8691
params.require(:target))
8792
end
Lines changed: 217 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
import {
2+
ASSERTED_DISTRIBUTION,
3+
BIOLOGICAL_ASSOCIATION,
4+
CONTENT,
5+
DESCRIPTOR,
6+
EXTRACT,
7+
FIELD_OCCURRENCE,
8+
IMAGE,
9+
LOAN,
10+
OTU,
11+
PEOPLE,
12+
SOUND,
13+
SOURCE,
14+
TAXON_NAME
15+
} from '@/constants'
116
import AnnotatorTag from '../components/Annotator/AnnotatorTag.vue'
217
import AnnotatorNote from '../components/Annotator/AnnotatorNote.vue'
318
import AnnotatorConfidence from '../components/Annotator/Confidence/ConfidenceMain.vue'
@@ -6,20 +21,208 @@ import AnnotatorCitation from '../components/Annotator/AnnotatorCitation.vue'
621
import AnnotatorDataAttribute from '../components/Annotator/DataAttribute/AnnotatorDataAttribute.vue'
722
import AnnotatorProtocol from '../components/Annotator/Protocol/ProtocolMain.vue'
823

24+
const TAG_SLICE = {
25+
Tags: AnnotatorTag
26+
}
27+
28+
const NOTE_SLICE = {
29+
Notes: AnnotatorNote
30+
}
31+
32+
const CONFIDENCE_SLICE = {
33+
Confidence: AnnotatorConfidence
34+
}
35+
36+
const ATTRIBUTION_SLICE = {
37+
Attribution: AnnotatorAttribution
38+
}
39+
40+
const CITATION_SLICE = {
41+
Citations: AnnotatorCitation
42+
}
43+
44+
const DATA_ATTRIBUTE_SLICE = {
45+
'Data attributes': AnnotatorDataAttribute
46+
}
47+
48+
const PROTOCOL_SLICE = {
49+
Protocol: AnnotatorProtocol
50+
}
51+
52+
function buildSliceObject(...slices) {
53+
return Object.assign({}, ...slices)
54+
}
55+
956
export const ANNOTATORS = {
10-
all: {
11-
Confidence: AnnotatorConfidence,
12-
'Data attributes': AnnotatorDataAttribute,
13-
Protocol: AnnotatorProtocol
14-
},
15-
16-
ids: {
17-
Attribution: AnnotatorAttribution,
18-
Citations: AnnotatorCitation,
19-
Confidence: AnnotatorConfidence,
20-
'Data attributes': AnnotatorDataAttribute,
21-
Notes: AnnotatorNote,
22-
Protocol: AnnotatorProtocol,
23-
Tags: AnnotatorTag
57+
DEFAULT: {
58+
all: buildSliceObject(
59+
CONFIDENCE_SLICE,
60+
DATA_ATTRIBUTE_SLICE,
61+
PROTOCOL_SLICE
62+
),
63+
64+
ids: buildSliceObject(
65+
CITATION_SLICE,
66+
CONFIDENCE_SLICE,
67+
DATA_ATTRIBUTE_SLICE,
68+
NOTE_SLICE,
69+
PROTOCOL_SLICE,
70+
TAG_SLICE
71+
)
72+
},
73+
[OTU]: {
74+
all: buildSliceObject(CONFIDENCE_SLICE, DATA_ATTRIBUTE_SLICE),
75+
76+
ids: buildSliceObject(
77+
CITATION_SLICE,
78+
CONFIDENCE_SLICE,
79+
DATA_ATTRIBUTE_SLICE,
80+
NOTE_SLICE,
81+
TAG_SLICE
82+
)
83+
},
84+
[ASSERTED_DISTRIBUTION]: {
85+
all: buildSliceObject(CONFIDENCE_SLICE, DATA_ATTRIBUTE_SLICE),
86+
87+
ids: buildSliceObject(
88+
CITATION_SLICE,
89+
CONFIDENCE_SLICE,
90+
DATA_ATTRIBUTE_SLICE,
91+
NOTE_SLICE,
92+
TAG_SLICE
93+
)
94+
},
95+
96+
[BIOLOGICAL_ASSOCIATION]: {
97+
all: buildSliceObject(CONFIDENCE_SLICE, DATA_ATTRIBUTE_SLICE),
98+
99+
ids: buildSliceObject(
100+
CITATION_SLICE,
101+
CONFIDENCE_SLICE,
102+
DATA_ATTRIBUTE_SLICE,
103+
NOTE_SLICE,
104+
TAG_SLICE
105+
)
106+
},
107+
108+
[CONTENT]: {
109+
all: buildSliceObject(CONFIDENCE_SLICE, DATA_ATTRIBUTE_SLICE),
110+
111+
ids: buildSliceObject(
112+
ATTRIBUTION_SLICE,
113+
CITATION_SLICE,
114+
CONFIDENCE_SLICE,
115+
DATA_ATTRIBUTE_SLICE
116+
)
117+
},
118+
119+
[DESCRIPTOR]: {
120+
all: buildSliceObject(CONFIDENCE_SLICE, DATA_ATTRIBUTE_SLICE),
121+
122+
ids: buildSliceObject(
123+
CITATION_SLICE,
124+
CONFIDENCE_SLICE,
125+
DATA_ATTRIBUTE_SLICE,
126+
NOTE_SLICE,
127+
TAG_SLICE
128+
)
129+
},
130+
131+
[EXTRACT]: {
132+
all: buildSliceObject(
133+
CONFIDENCE_SLICE,
134+
DATA_ATTRIBUTE_SLICE,
135+
PROTOCOL_SLICE
136+
),
137+
138+
ids: buildSliceObject(
139+
CITATION_SLICE,
140+
CONFIDENCE_SLICE,
141+
DATA_ATTRIBUTE_SLICE,
142+
PROTOCOL_SLICE,
143+
TAG_SLICE
144+
)
145+
},
146+
147+
[IMAGE]: {
148+
all: buildSliceObject(CONFIDENCE_SLICE, PROTOCOL_SLICE),
149+
150+
ids: buildSliceObject(
151+
ATTRIBUTION_SLICE,
152+
PROTOCOL_SLICE,
153+
CITATION_SLICE,
154+
CONFIDENCE_SLICE,
155+
NOTE_SLICE,
156+
TAG_SLICE
157+
)
158+
},
159+
160+
[FIELD_OCCURRENCE]: {
161+
all: buildSliceObject(
162+
CONFIDENCE_SLICE,
163+
DATA_ATTRIBUTE_SLICE,
164+
PROTOCOL_SLICE
165+
),
166+
167+
ids: buildSliceObject(
168+
PROTOCOL_SLICE,
169+
CITATION_SLICE,
170+
CONFIDENCE_SLICE,
171+
DATA_ATTRIBUTE_SLICE,
172+
NOTE_SLICE,
173+
TAG_SLICE
174+
)
175+
},
176+
177+
[LOAN]: {
178+
all: buildSliceObject(DATA_ATTRIBUTE_SLICE),
179+
180+
ids: buildSliceObject(DATA_ATTRIBUTE_SLICE, NOTE_SLICE, TAG_SLICE)
181+
},
182+
183+
[PEOPLE]: {
184+
all: buildSliceObject(DATA_ATTRIBUTE_SLICE),
185+
186+
ids: buildSliceObject(DATA_ATTRIBUTE_SLICE, NOTE_SLICE, TAG_SLICE)
187+
},
188+
189+
[SOUND]: {
190+
all: buildSliceObject(
191+
CONFIDENCE_SLICE,
192+
DATA_ATTRIBUTE_SLICE,
193+
PROTOCOL_SLICE
194+
),
195+
196+
ids: buildSliceObject(
197+
ATTRIBUTION_SLICE,
198+
PROTOCOL_SLICE,
199+
CITATION_SLICE,
200+
CONFIDENCE_SLICE,
201+
DATA_ATTRIBUTE_SLICE,
202+
NOTE_SLICE,
203+
TAG_SLICE
204+
)
205+
},
206+
207+
[SOURCE]: {
208+
all: buildSliceObject(DATA_ATTRIBUTE_SLICE),
209+
210+
ids: buildSliceObject(DATA_ATTRIBUTE_SLICE, NOTE_SLICE, TAG_SLICE)
211+
},
212+
213+
[SOUND]: {
214+
all: buildSliceObject(
215+
CONFIDENCE_SLICE,
216+
DATA_ATTRIBUTE_SLICE,
217+
PROTOCOL_SLICE
218+
),
219+
220+
ids: buildSliceObject(
221+
CITATION_SLICE,
222+
CONFIDENCE_SLICE,
223+
DATA_ATTRIBUTE_SLICE,
224+
NOTE_SLICE,
225+
TAG_SLICE
226+
)
24227
}
25228
}

app/javascript/vue/components/radials/mass/radial.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ const props = defineProps({
111111
}
112112
})
113113
114+
const annotatorComponents = ANNOTATORS[props.objectType] || ANNOTATORS.DEFAULT
115+
114116
const {
115117
closeRadialBatch,
116118
currentSlice,
@@ -123,7 +125,7 @@ const {
123125
} = useRadialBatch({
124126
excludeParameters: EXCLUDE_PARAMETERS,
125127
props,
126-
slices: props.nestedQuery ? ANNOTATORS.all : ANNOTATORS.ids
128+
slices: props.nestedQuery ? annotatorComponents.all : annotatorComponents.ids
127129
})
128130
129131
const annotatorTypes = ref({})

app/javascript/vue/tasks/sounds/filter/components/ListResults.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
v-model="selectAll"
1414
/>
1515
</th>
16+
<th class="w-2" />
1617
<th>Name</th>
1718
<th>Object tag</th>
1819
<th></th>
19-
<th />
2020
</tr>
2121
</thead>
2222
<tbody>
@@ -32,6 +32,12 @@
3232
:value="item.id"
3333
/>
3434
</td>
35+
<td>
36+
<div class="horizontal-right-content middle gap-small">
37+
<RadialAnnotator :global-id="item.global_id" />
38+
<RadialNavigator :global-id="item.global_id" />
39+
</div>
40+
</td>
3541
<td>{{ item.name }}</td>
3642
<td v-html="item.object_tag" />
3743
<td>
@@ -41,12 +47,6 @@
4147
preload="metadata"
4248
/>
4349
</td>
44-
<td class="w-2">
45-
<div class="horizontal-right-content middle gap-small">
46-
<RadialAnnotator :global-id="item.global_id" />
47-
<RadialNavigator :global-id="item.global_id" />
48-
</div>
49-
</td>
5050
</tr>
5151
</tbody>
5252
</table>

0 commit comments

Comments
 (0)