@dhis2-ui/transfer 9.4.4 → 9.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/features/add_remove-highlighted-options/index.js +12 -12
- package/build/cjs/features/disabled-transfer-buttons/index.js +19 -22
- package/build/cjs/features/disabled-transfer-options/index.js +19 -19
- package/build/cjs/features/display-order/index.js +14 -14
- package/build/cjs/features/filter-options-list/index.js +19 -19
- package/build/cjs/features/highlight-range-of-options/index.js +31 -31
- package/build/cjs/features/loading_lists/index.js +7 -7
- package/build/cjs/features/notify_at_end_of_list/index.js +8 -19
- package/build/cjs/features/reorder-with-buttons/index.js +17 -13
- package/build/cjs/features/set_unset-highlighted-option/index.js +15 -15
- package/build/cjs/features/transferring-items/index.js +41 -49
- package/build/es/features/add_remove-highlighted-options/index.js +1 -1
- package/build/es/features/disabled-transfer-buttons/index.js +1 -4
- package/build/es/features/disabled-transfer-options/index.js +1 -1
- package/build/es/features/display-order/index.js +1 -1
- package/build/es/features/filter-options-list/index.js +1 -1
- package/build/es/features/highlight-range-of-options/index.js +1 -1
- package/build/es/features/loading_lists/index.js +1 -1
- package/build/es/features/notify_at_end_of_list/index.js +1 -12
- package/build/es/features/reorder-with-buttons/index.js +8 -4
- package/build/es/features/set_unset-highlighted-option/index.js +1 -1
- package/build/es/features/transferring-items/index.js +15 -23
- package/package.json +7 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Given, When, Then } from 'cypress-cucumber-preprocessor
|
|
1
|
+
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
2
2
|
import { parseSelectorWithDataTest } from '../../../../../cypress/support/common/parseSelectorWithDataTest.js';
|
|
3
3
|
import { extractOptionFromElement } from '../common/index.js';
|
|
4
4
|
Given('some options are selectable', () => {
|
|
@@ -147,27 +147,19 @@ Then('all items removed from options list should be visible in the selected list
|
|
|
147
147
|
expect(allSelected).to.equal(true);
|
|
148
148
|
});
|
|
149
149
|
});
|
|
150
|
-
Then('the transferred items should be appended to the selected list in the order they were displayed in the options list', () => {
|
|
151
|
-
cy.all(() => cy.get('@itemsToBeSelected'), () => cy.get('{transfer-pickedoptions} {transferoption}')).should(_ref14 => {
|
|
152
|
-
let [itemsToBeSelected, $selectedOptions] = _ref14;
|
|
153
|
-
const selectedOptions = $selectedOptions.toArray().map(extractOptionFromElement);
|
|
154
|
-
const previouslySelectedSubset = selectedOptions.slice(-1 * itemsToBeSelected.length);
|
|
155
|
-
expect(itemsToBeSelected).to.eql(previouslySelectedSubset);
|
|
156
|
-
});
|
|
157
|
-
});
|
|
158
150
|
Then('all items should be removed from the selected list', () => {
|
|
159
151
|
cy.get('{transfer-pickedoptions} {transferoption}').should('not.exist');
|
|
160
152
|
});
|
|
161
153
|
Then('all items removed from selected list should be visible in the options list', () => {
|
|
162
|
-
cy.all(() => cy.get('@itemsToBeDeselected'), () => cy.get('{transfer-sourceoptions} {transferoption}')).should(
|
|
163
|
-
let [itemsToBeDeselected, $selectableSourceOptions] =
|
|
154
|
+
cy.all(() => cy.get('@itemsToBeDeselected'), () => cy.get('{transfer-sourceoptions} {transferoption}')).should(_ref14 => {
|
|
155
|
+
let [itemsToBeDeselected, $selectableSourceOptions] = _ref14;
|
|
164
156
|
const selectableSourceOptions = $selectableSourceOptions.toArray().map(extractOptionFromElement);
|
|
165
157
|
const allSelectable = itemsToBeDeselected.every(option => {
|
|
166
|
-
return selectableSourceOptions.find(
|
|
158
|
+
return selectableSourceOptions.find(_ref15 => {
|
|
167
159
|
let {
|
|
168
160
|
label,
|
|
169
161
|
value
|
|
170
|
-
} =
|
|
162
|
+
} = _ref15;
|
|
171
163
|
return option.label === label && option.value === value;
|
|
172
164
|
});
|
|
173
165
|
});
|
|
@@ -175,8 +167,8 @@ Then('all items removed from selected list should be visible in the options list
|
|
|
175
167
|
});
|
|
176
168
|
});
|
|
177
169
|
Then('the transferred items should be appended to the selected list in the order they were displayed in the options list', () => {
|
|
178
|
-
cy.all(() => cy.get('@itemsToBeSelected'), () => cy.get('{transfer-pickedoptions} {transferoption}')).should(
|
|
179
|
-
let [itemsToBeSelected, $selectedOptions] =
|
|
170
|
+
cy.all(() => cy.get('@itemsToBeSelected'), () => cy.get('{transfer-pickedoptions} {transferoption}')).should(_ref16 => {
|
|
171
|
+
let [itemsToBeSelected, $selectedOptions] = _ref16;
|
|
180
172
|
const selectedOptions = $selectedOptions.toArray().map(extractOptionFromElement);
|
|
181
173
|
const previouslySelectedSubset = selectedOptions.slice(-1 * itemsToBeSelected.length);
|
|
182
174
|
expect(itemsToBeSelected).to.eql(previouslySelectedSubset);
|
|
@@ -185,8 +177,8 @@ Then('the transferred items should be appended to the selected list in the order
|
|
|
185
177
|
Then('the options list items should be ordered in the original order', () => {
|
|
186
178
|
cy.all(() => cy.window(), () => cy.get('{transfer-sourceoptions} {transferoption}'), () => cy.get('{transfer-pickedoptions}').then($pickedOptions => {
|
|
187
179
|
return $pickedOptions.find(parseSelectorWithDataTest('{transferoption}'));
|
|
188
|
-
})).should(
|
|
189
|
-
let [win, $selectableSourceOptions, $pickedOptions] =
|
|
180
|
+
})).should(_ref17 => {
|
|
181
|
+
let [win, $selectableSourceOptions, $pickedOptions] = _ref17;
|
|
190
182
|
const pickedPlainOptions = $pickedOptions.toArray().map(extractOptionFromElement);
|
|
191
183
|
const originalOrderWithoutSelected = win.options.filter(originalOption => {
|
|
192
184
|
return !pickedPlainOptions.find(pickedPlainOption => pickedPlainOption.value === originalOption.value && pickedPlainOption.label === originalOption.label);
|
|
@@ -196,24 +188,24 @@ Then('the options list items should be ordered in the original order', () => {
|
|
|
196
188
|
});
|
|
197
189
|
});
|
|
198
190
|
Then('the item should be removed from its options list', () => {
|
|
199
|
-
cy.all(() => cy.get('@doubleClickedPlainOption'), () => cy.get('{transfer-sourceoptions} {transferoption}')).should(
|
|
200
|
-
let [doubleClickedPlainOption, $sourceOptions] =
|
|
191
|
+
cy.all(() => cy.get('@doubleClickedPlainOption'), () => cy.get('{transfer-sourceoptions} {transferoption}')).should(_ref18 => {
|
|
192
|
+
let [doubleClickedPlainOption, $sourceOptions] = _ref18;
|
|
201
193
|
const sourcePlainOptions = $sourceOptions.toArray().map(extractOptionFromElement);
|
|
202
194
|
const found = sourcePlainOptions.find(sourcePlainOption => sourcePlainOption.value === doubleClickedPlainOption.value && sourcePlainOption.label === doubleClickedPlainOption.label);
|
|
203
195
|
expect(found).to.not.equal(true);
|
|
204
196
|
});
|
|
205
197
|
});
|
|
206
198
|
Then('the item should be visible at the bottom of the selected list', () => {
|
|
207
|
-
cy.all(() => cy.get('@doubleClickedPlainOption'), () => cy.get('{transfer-pickedoptions} {transferoption}')).should(
|
|
208
|
-
let [doubleClickedPlainOption, $pickedOptions] =
|
|
199
|
+
cy.all(() => cy.get('@doubleClickedPlainOption'), () => cy.get('{transfer-pickedoptions} {transferoption}')).should(_ref19 => {
|
|
200
|
+
let [doubleClickedPlainOption, $pickedOptions] = _ref19;
|
|
209
201
|
const lastSourcePlainOption = $pickedOptions.last().toArray().map(extractOptionFromElement).pop();
|
|
210
202
|
const doubleClickedOptionIsLast = lastSourcePlainOption.value === doubleClickedPlainOption.value && lastSourcePlainOption.label === doubleClickedPlainOption.label;
|
|
211
203
|
expect(doubleClickedOptionIsLast).to.equal(true);
|
|
212
204
|
});
|
|
213
205
|
});
|
|
214
206
|
Then('the item should be removed from the selected list', () => {
|
|
215
|
-
cy.all(() => cy.get('@doubleClickedPlainOption'), () => cy.get('{transfer-pickedoptions} {transferoption}')).should(
|
|
216
|
-
let [doubleClickedPlainOption, $pickedOptions] =
|
|
207
|
+
cy.all(() => cy.get('@doubleClickedPlainOption'), () => cy.get('{transfer-pickedoptions} {transferoption}')).should(_ref20 => {
|
|
208
|
+
let [doubleClickedPlainOption, $pickedOptions] = _ref20;
|
|
217
209
|
const pickedPlainOptions = $pickedOptions.toArray().map(extractOptionFromElement);
|
|
218
210
|
const found = pickedPlainOptions.find(sourcePlainOption => sourcePlainOption.value === doubleClickedPlainOption.value && sourcePlainOption.label === doubleClickedPlainOption.label);
|
|
219
211
|
expect(found).to.not.equal(true);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2-ui/transfer",
|
|
3
|
-
"version": "9.4.
|
|
3
|
+
"version": "9.4.6",
|
|
4
4
|
"description": "UI Transfer",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@dhis2/prop-types": "^3.1.2",
|
|
36
|
-
"@dhis2-ui/button": "9.4.
|
|
37
|
-
"@dhis2-ui/field": "9.4.
|
|
38
|
-
"@dhis2-ui/input": "9.4.
|
|
39
|
-
"@dhis2-ui/intersection-detector": "9.4.
|
|
40
|
-
"@dhis2-ui/loader": "9.4.
|
|
41
|
-
"@dhis2/ui-constants": "9.4.
|
|
36
|
+
"@dhis2-ui/button": "9.4.6",
|
|
37
|
+
"@dhis2-ui/field": "9.4.6",
|
|
38
|
+
"@dhis2-ui/input": "9.4.6",
|
|
39
|
+
"@dhis2-ui/intersection-detector": "9.4.6",
|
|
40
|
+
"@dhis2-ui/loader": "9.4.6",
|
|
41
|
+
"@dhis2/ui-constants": "9.4.6",
|
|
42
42
|
"classnames": "^2.3.1",
|
|
43
43
|
"prop-types": "^15.7.2"
|
|
44
44
|
},
|