File tree Expand file tree Collapse file tree
src/components/DataDimension Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ msgstr ""
55"Content-Type : text/plain; charset=utf-8\n "
66"Content-Transfer-Encoding : 8bit\n "
77"Plural-Forms : nplurals=2; plural=(n != 1)\n "
8- "POT-Creation-Date : 2025-02-24T10:59:13.262Z \n "
9- "PO-Revision-Date : 2025-02-24T10:59:13.263Z \n "
8+ "POT-Creation-Date : 2025-02-27T14:06:17.569Z \n "
9+ "PO-Revision-Date : 2025-02-27T14:06:17.570Z \n "
1010
1111msgid "view only"
1212msgstr "view only"
@@ -336,6 +336,9 @@ msgstr "Search by data item name"
336336msgid "Selected Items"
337337msgstr "Selected Items"
338338
339+ msgid "All available items are already selected"
340+ msgstr "All available items are already selected"
341+
339342msgid "Calculation"
340343msgstr "Calculation"
341344
@@ -348,9 +351,6 @@ msgstr "All metrics"
348351msgid "No items selected"
349352msgstr "No items selected"
350353
351- msgid "All available items are already selected"
352- msgstr "All available items are already selected"
353-
354354msgid "No indicators found"
355355msgstr "No indicators found"
356356
Original file line number Diff line number Diff line change @@ -168,17 +168,31 @@ export const ItemOptionsSelector = ({
168168 < Transfer
169169 onChange = { ( { selected } ) => onChange ( selected ) }
170170 selected = { selectedItems . map ( ( item ) => item . value ) }
171- options = { [ ...state . options , ...selectedItems ] }
171+ options = { [
172+ ...state . options ,
173+ // remove items already in the options list
174+ ...selectedItems . filter (
175+ ( selectedItem ) =>
176+ ! state . options ?. find (
177+ ( option ) => option . value === selectedItem . value
178+ )
179+ ) ,
180+ ] }
172181 loading = { state . loading }
173182 loadingPicked = { state . loading }
174183 sourceEmptyPlaceholder = {
175184 < SourceEmptyPlaceholder
176185 loading = { state . loading }
177186 searchTerm = { debouncedSearchTerm }
178187 options = { state . options }
179- allItemsSelectedMessage = { i18n . t (
180- 'All available options are already selected'
181- ) }
188+ allItemsSelectedMessage = {
189+ state . options . length === selectedItems . length &&
190+ ! state . nextPage
191+ ? i18n . t (
192+ 'All available options are already selected'
193+ )
194+ : ''
195+ }
182196 noItemsMessage = { i18n . t (
183197 'No available options for this item'
184198 ) }
Original file line number Diff line number Diff line change @@ -350,14 +350,31 @@ const ItemSelector = ({
350350 < Transfer
351351 onChange = { ( { selected } ) => onChange ( selected ) }
352352 selected = { selectedItems . map ( ( item ) => item . value ) }
353- options = { [ ...state . options , ...selectedItems ] }
353+ options = { [
354+ ...state . options ,
355+ // remove items already in the options list
356+ ...selectedItems . filter (
357+ ( selectedItem ) =>
358+ ! state . options ?. find (
359+ ( option ) => option . value === selectedItem . value
360+ )
361+ ) ,
362+ ] }
354363 loading = { state . loading }
355364 loadingPicked = { state . loading }
356365 sourceEmptyPlaceholder = {
357366 < SourceEmptyPlaceholder
358367 loading = { state . loading }
359368 searchTerm = { debouncedSearchTerm }
360369 options = { state . options }
370+ allItemsSelectedMessage = {
371+ state . options . length === selectedItems . length &&
372+ ! state . nextPage
373+ ? i18n . t (
374+ 'All available items are already selected'
375+ )
376+ : ''
377+ }
361378 noItemsMessage = { noItemsMessage }
362379 dataType = { state . filter . dataType }
363380 dataTest = { `${ dataTest } -empty-source` }
Original file line number Diff line number Diff line change @@ -21,10 +21,8 @@ export const SourceEmptyPlaceholder = ({
2121 dataTest,
2222} ) => {
2323 let message = ''
24- if ( ! loading && options . length && ! searchTerm ) {
25- message =
26- allItemsSelectedMessage ||
27- i18n . t ( 'All available items are already selected' )
24+ if ( allItemsSelectedMessage && ! loading && options . length && ! searchTerm ) {
25+ message = allItemsSelectedMessage
2826 } else if ( ! loading && ! options . length && ! searchTerm ) {
2927 if ( noItemsMessage ) {
3028 message = noItemsMessage
You can’t perform that action at this time.
0 commit comments