@estiva-app/ui 0.104.3 → 0.105.0
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/dist/MoveDialog.d.ts +2 -2
- package/dist/MoveDialog.d.ts.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
- package/registry.json +5 -5
- package/src/ArchiveDialog.mdx +2 -2
- package/src/ArchiveDialog.stories.tsx +5 -5
- package/src/FormDialog.mdx +3 -3
- package/src/FormDialog.stories.tsx +5 -5
- package/src/MoveDialog.mdx +16 -16
- package/src/MoveDialog.stories.tsx +22 -22
- package/src/MoveDialog.test.tsx +58 -48
- package/src/MoveDialog.tsx +8 -7
package/src/MoveDialog.tsx
CHANGED
|
@@ -74,9 +74,9 @@ export interface MoveDialogProps {
|
|
|
74
74
|
startIn?: string
|
|
75
75
|
/** The dialog's heading. "Move" when absent. */
|
|
76
76
|
heading?: string
|
|
77
|
-
/** The
|
|
77
|
+
/** The team field's label. "Team" when absent. */
|
|
78
78
|
folderLabel?: string
|
|
79
|
-
/** Said when no
|
|
79
|
+
/** Said when no team is offered. "There is no other team it can be moved to." when absent. */
|
|
80
80
|
noFolder?: string
|
|
81
81
|
/** A box under the choice, asked only where `label` names it; its answer comes back as `checked`. */
|
|
82
82
|
check?: MoveCheck
|
|
@@ -96,8 +96,8 @@ export function MoveDialog({
|
|
|
96
96
|
topLabel,
|
|
97
97
|
startIn,
|
|
98
98
|
heading = 'Move',
|
|
99
|
-
folderLabel = '
|
|
100
|
-
noFolder = 'There is no other
|
|
99
|
+
folderLabel = 'Team',
|
|
100
|
+
noFolder = 'There is no other team it can be moved to.',
|
|
101
101
|
check,
|
|
102
102
|
onMove,
|
|
103
103
|
onClose,
|
|
@@ -139,7 +139,8 @@ export function MoveDialog({
|
|
|
139
139
|
setPicked(undefined)
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
const
|
|
142
|
+
const chosenName = destinations?.find((candidate) => candidate.id === folder)?.name
|
|
143
|
+
const folderName = chosenName || 'this team'
|
|
143
144
|
const status = nests && folder ? read[folder] : undefined
|
|
144
145
|
const targets = Array.isArray(status) ? (status as readonly MovePlace[]) : []
|
|
145
146
|
const valueOf = (place: MovePlace) => place.id || TOP
|
|
@@ -171,14 +172,14 @@ export function MoveDialog({
|
|
|
171
172
|
value={folder}
|
|
172
173
|
onChange={chooseFolder}
|
|
173
174
|
options={(destinations ?? []).map((candidate) => ({ value: candidate.id, label: candidate.name }))}
|
|
174
|
-
placeholder={destinations ? 'Pick a
|
|
175
|
+
placeholder={destinations ? 'Pick a team' : 'Reading…'}
|
|
175
176
|
ariaLabel={folderLabel}
|
|
176
177
|
/>
|
|
177
178
|
</Field>
|
|
178
179
|
{nests &&
|
|
179
180
|
folder &&
|
|
180
181
|
(status === 'failed' ? (
|
|
181
|
-
<EmptyState scope="section" message={`${
|
|
182
|
+
<EmptyState scope="section" message={`${chosenName || 'This team'} could not be read.`} action={{ label: 'Try again', onClick: () => readPlaces(folder) }} />
|
|
182
183
|
) : Array.isArray(status) && targets.length === 0 ? (
|
|
183
184
|
<EmptyState scope="section" message={`There is nowhere in ${folderName} to put it.`} />
|
|
184
185
|
) : (
|