mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-06 02:34:21 +00:00
feat(packing): change the sharing of a whole list at once (#2961)
The list menu on desktop and phone gets "Sharing for Whole List": pick Shared, Personal or Shared with people once and every item of yours in that list moves there through the existing per-item sharing write. Items other people added stay as they are, and the dialog says so up front.
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
// FE-PACK-CATSHAREDLG-001 to FE-PACK-CATSHAREDLG-004: the desktop dialog for sharing a whole packing list (#2961).
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import { fireEvent, render, screen } from '../../../tests/helpers/render';
|
||||
import PackingCategorySharingDialog from './PackingCategorySharingDialog';
|
||||
import type { PackingCategorySharing } from './usePackingCategorySharing';
|
||||
import type { TripMember } from './usePackingListPanel';
|
||||
|
||||
const ME = 1;
|
||||
const MEMBERS: TripMember[] = [
|
||||
{ id: ME, username: 'me' },
|
||||
{ id: 2, username: 'alice' },
|
||||
];
|
||||
|
||||
function sharing(overrides: Partial<PackingCategorySharing> = {}): PackingCategorySharing {
|
||||
return {
|
||||
category: 'Camp',
|
||||
visibility: null,
|
||||
setVisibility: vi.fn(),
|
||||
recipientIds: [],
|
||||
toggleRecipient: vi.fn(),
|
||||
ownCount: 2,
|
||||
othersCount: 0,
|
||||
busy: false,
|
||||
ready: false,
|
||||
openFor: vi.fn(),
|
||||
close: vi.fn(),
|
||||
apply: vi.fn(() => Promise.resolve()),
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
|
||||
function setup(state: PackingCategorySharing) {
|
||||
render(<PackingCategorySharingDialog sharing={state} tripMembers={MEMBERS} currentUserId={ME} />);
|
||||
return state;
|
||||
}
|
||||
|
||||
describe('PackingCategorySharingDialog', () => {
|
||||
it('FE-PACK-CATSHAREDLG-001: renders nothing until a list is chosen', () => {
|
||||
setup(sharing({ category: null }));
|
||||
expect(screen.queryByRole('dialog')).toBeNull();
|
||||
});
|
||||
|
||||
it('FE-PACK-CATSHAREDLG-002: names the list, offers the three tiers and marks the chosen one', () => {
|
||||
const state = setup(sharing({ visibility: 'common' }));
|
||||
expect(screen.getByText('Camp')).toBeInTheDocument();
|
||||
expect(screen.getByText('Sharing for Whole List')).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: /In the group pool/ })).toHaveAttribute('aria-pressed', 'true');
|
||||
|
||||
fireEvent.click(screen.getByRole('button', { name: /Private/ }));
|
||||
expect(state.setVisibility).toHaveBeenCalledWith('personal');
|
||||
// Apply waits until the choice is complete.
|
||||
expect(screen.getByRole('button', { name: 'Apply to list' })).toBeDisabled();
|
||||
});
|
||||
|
||||
it('FE-PACK-CATSHAREDLG-003: the third tier lists the other members to pick, and applies once ready', () => {
|
||||
const state = setup(sharing({ visibility: 'shared', recipientIds: [2], ready: true, othersCount: 1 }));
|
||||
expect(screen.queryByRole('button', { name: 'me' })).toBeNull();
|
||||
const alice = screen.getByRole('button', { name: 'alice' });
|
||||
expect(alice).toHaveAttribute('aria-pressed', 'true');
|
||||
fireEvent.click(alice);
|
||||
expect(state.toggleRecipient).toHaveBeenCalledWith(2);
|
||||
expect(
|
||||
screen.getByText('Items other people added stay as they are. Only they can change them.')
|
||||
).toBeInTheDocument();
|
||||
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Apply to list' }));
|
||||
expect(state.apply).toHaveBeenCalledOnce();
|
||||
});
|
||||
|
||||
it('FE-PACK-CATSHAREDLG-004: a list of nobody but others explains why and leaves the tiers shut', () => {
|
||||
setup(sharing({ ownCount: 0, othersCount: 2 }));
|
||||
expect(
|
||||
screen.getByText('Every item in this list was added by someone else, so only they can change its sharing.')
|
||||
).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: /In the group pool/ })).toBeDisabled();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,155 @@
|
||||
import type { PackingVisibility } from '@trek/shared';
|
||||
import { Check, Loader2, Share2, UserRound, Users } from 'lucide-react';
|
||||
import { type ReactNode, useId } from 'react';
|
||||
|
||||
import { useTranslation } from '../../i18n';
|
||||
import {
|
||||
DialogButton,
|
||||
DialogFooter,
|
||||
DialogHeader,
|
||||
DialogShell,
|
||||
DialogTile,
|
||||
FooterSpacer,
|
||||
NEUTRAL_TINT,
|
||||
fs,
|
||||
} from '../shared/DialogShell';
|
||||
import type { PackingCategorySharing } from './usePackingCategorySharing';
|
||||
import type { TripMember } from './usePackingListPanel';
|
||||
|
||||
/**
|
||||
* The desktop's choice of one sharing tier for a whole packing list (#2961): the
|
||||
* same three tiers as an item's own sharing control, the people to share with
|
||||
* under the third, and a note on the items that belong to someone else.
|
||||
*/
|
||||
export default function PackingCategorySharingDialog({
|
||||
sharing,
|
||||
tripMembers,
|
||||
currentUserId,
|
||||
}: {
|
||||
sharing: PackingCategorySharing;
|
||||
tripMembers: TripMember[];
|
||||
currentUserId: number | null | undefined;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const labelId = useId();
|
||||
const { category, visibility, recipientIds, ownCount, othersCount, busy, ready } = sharing;
|
||||
const others = tripMembers.filter((m) => m.id !== currentUserId);
|
||||
const needsPeople = visibility === 'shared' && others.length > 0 && recipientIds.length === 0;
|
||||
|
||||
const tier = (value: PackingVisibility, icon: ReactNode, label: string, hint?: string) => {
|
||||
const on = visibility === value;
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
aria-pressed={on}
|
||||
disabled={ownCount === 0}
|
||||
onClick={() => sharing.setVisibility(value)}
|
||||
className={`flex min-h-[44px] items-center gap-3 rounded-[10px] px-3 py-2 text-start disabled:opacity-50 ${on ? 'bg-surface-card shadow-sm' : 'enabled:hover:bg-surface-card'}`}
|
||||
>
|
||||
<span className={`flex-none ${on ? 'text-content' : 'text-content-muted'}`}>{icon}</span>
|
||||
<span className="min-w-0 flex-1">
|
||||
<span className="block font-semibold text-content" style={fs(13, 'body')}>
|
||||
{label}
|
||||
</span>
|
||||
{hint && (
|
||||
<span className="block text-content-faint" style={fs(11.5)}>
|
||||
{hint}
|
||||
</span>
|
||||
)}
|
||||
</span>
|
||||
{on && <Check size={14} className="flex-none text-content-muted" />}
|
||||
</button>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<DialogShell
|
||||
open={category != null}
|
||||
onClose={sharing.close}
|
||||
labelledBy={labelId}
|
||||
width="narrow"
|
||||
header={
|
||||
<DialogHeader
|
||||
tile={
|
||||
<DialogTile>
|
||||
<Share2 size={20} strokeWidth={1.9} className="text-content-muted" />
|
||||
</DialogTile>
|
||||
}
|
||||
tint={NEUTRAL_TINT}
|
||||
labelId={labelId}
|
||||
onClose={sharing.close}
|
||||
eyebrow={t('packing.menuShareCat')}
|
||||
title={category}
|
||||
/>
|
||||
}
|
||||
footer={
|
||||
<DialogFooter>
|
||||
<FooterSpacer />
|
||||
<DialogButton onClick={sharing.close} disabled={busy}>
|
||||
{t('common.cancel')}
|
||||
</DialogButton>
|
||||
<DialogButton
|
||||
variant="primary"
|
||||
onClick={() => void sharing.apply()}
|
||||
disabled={!ready}
|
||||
icon={busy ? <Loader2 size={14} className="animate-spin" /> : undefined}
|
||||
>
|
||||
{t('packing.shareCat.apply')}
|
||||
</DialogButton>
|
||||
</DialogFooter>
|
||||
}
|
||||
>
|
||||
<p className="m-0 text-content-muted" style={fs(12.5, 'body')}>
|
||||
{ownCount === 0 ? t('packing.shareCat.noneOwn') : t('packing.shareCat.hint')}
|
||||
</p>
|
||||
|
||||
<div className="flex flex-col gap-0.5 rounded-[14px] border border-edge-faint bg-surface-secondary p-1.5">
|
||||
{tier('common', <Users size={15} />, t('packing.viewCommon'), t('packing.tierCommonHint'))}
|
||||
{tier('personal', <UserRound size={15} />, t('packing.tierPersonal'), t('packing.tierPersonalHint'))}
|
||||
{tier('shared', <Share2 size={15} />, t('packing.tierShared'))}
|
||||
{visibility === 'shared' && (
|
||||
<div className="flex flex-col gap-0.5 ps-6">
|
||||
{others.length === 0 ? (
|
||||
<p className="m-0 px-3 py-2 text-content-faint" style={fs(12, 'body')}>
|
||||
{t('packing.noOneToShare')}
|
||||
</p>
|
||||
) : (
|
||||
others.map((m) => {
|
||||
const picked = recipientIds.includes(m.id);
|
||||
return (
|
||||
<button
|
||||
key={m.id}
|
||||
type="button"
|
||||
aria-pressed={picked}
|
||||
onClick={() => sharing.toggleRecipient(m.id)}
|
||||
className="flex min-h-[40px] items-center gap-3 rounded-[10px] px-3 py-1.5 text-start hover:bg-surface-card"
|
||||
>
|
||||
<span className="min-w-0 flex-1 truncate text-content" style={fs(13, 'body')}>
|
||||
{m.username}
|
||||
</span>
|
||||
<span
|
||||
className={`grid h-6 w-6 flex-none place-items-center rounded-[8px] ${picked ? 'bg-accent text-accent-text' : 'border border-edge bg-surface-card text-transparent'}`}
|
||||
>
|
||||
<Check size={13} />
|
||||
</span>
|
||||
</button>
|
||||
);
|
||||
})
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{needsPeople && (
|
||||
<p className="m-0 text-content-faint" style={fs(12, 'body')}>
|
||||
{t('packing.shareCat.pickPeople')}
|
||||
</p>
|
||||
)}
|
||||
{ownCount > 0 && othersCount > 0 && (
|
||||
<p className="m-0 text-content-faint" style={fs(12, 'body')}>
|
||||
{t('packing.shareCat.othersKept')}
|
||||
</p>
|
||||
)}
|
||||
</DialogShell>
|
||||
);
|
||||
}
|
||||
@@ -6,13 +6,14 @@ import { PackingList } from './PackingListPanelList'
|
||||
import { BagSidebar } from './PackingListPanelBagSidebar'
|
||||
import { BagModal } from './PackingListPanelBagModal'
|
||||
import { BulkImportModal } from './PackingListPanelImportModal'
|
||||
import PackingCategorySharingDialog from './PackingCategorySharingDialog'
|
||||
|
||||
// Re-exported for tests and external callers that import it from this module.
|
||||
export { itemWeight } from './packingListPanel.helpers'
|
||||
|
||||
export default function PackingListPanel(props: PackingListPanelProps) {
|
||||
const S = usePackingList(props)
|
||||
const { font, bagTrackingEnabled, bags, showBagModal, showImportModal } = S
|
||||
const { font, bagTrackingEnabled, bags, showBagModal, showImportModal, categorySharing, tripMembers, currentUserId } = S
|
||||
return (
|
||||
<div style={{ display: 'flex', flexDirection: 'column', height: '100%', ...font }}>
|
||||
{/* ── Header ── */}
|
||||
@@ -37,6 +38,8 @@ export default function PackingListPanel(props: PackingListPanelProps) {
|
||||
|
||||
{/* Bulk Import Modal */}
|
||||
{showImportModal && <BulkImportModal {...S} />}
|
||||
|
||||
<PackingCategorySharingDialog sharing={categorySharing} tripMembers={tripMembers} currentUserId={currentUserId} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// FE-W5CAT-001 to FE-W5CAT-040
|
||||
// FE-W5CAT-001 to FE-W5CAT-042
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'
|
||||
import type { ComponentProps } from 'react'
|
||||
import { http, HttpResponse } from 'msw'
|
||||
@@ -646,3 +646,23 @@ describe('KategorieGruppe — plugin contributions', () => {
|
||||
expect(screen.getByText('Forecast')).toBeInTheDocument()
|
||||
})
|
||||
})
|
||||
|
||||
describe('KategorieGruppe — sharing the whole list (#2961)', () => {
|
||||
it('FE-W5CAT-041: the list menu offers the sharing of the whole list and closes on it', () => {
|
||||
const onShareCategory = vi.fn()
|
||||
const { container } = setup({ onShareCategory })
|
||||
openCategoryMenu(container)
|
||||
|
||||
fireEvent.click(screen.getByText('Sharing for Whole List'))
|
||||
expect(onShareCategory).toHaveBeenCalledOnce()
|
||||
expect(screen.queryByText('Sharing for Whole List')).toBeNull()
|
||||
})
|
||||
|
||||
it('FE-W5CAT-042: a read-only member gets no such entry', () => {
|
||||
const { container } = setup({ onShareCategory: vi.fn(), canEdit: false })
|
||||
openCategoryMenu(container)
|
||||
|
||||
expect(screen.getByText('Uncheck All')).toBeInTheDocument()
|
||||
expect(screen.queryByText('Sharing for Whole List')).toBeNull()
|
||||
})
|
||||
})
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useToast } from '../shared/Toast'
|
||||
import { useTranslation } from '../../i18n'
|
||||
import {
|
||||
Trash2, Plus, ChevronDown, ChevronRight,
|
||||
X, Pencil, Check, MoreHorizontal, CheckCheck, RotateCcw, UserPlus, GripVertical,
|
||||
X, Pencil, Check, MoreHorizontal, CheckCheck, RotateCcw, UserPlus, GripVertical, Share2,
|
||||
} from 'lucide-react'
|
||||
import type { PackingItem, PackingBag } from '../../types'
|
||||
import { katColor } from './packingListPanel.helpers'
|
||||
@@ -54,9 +54,11 @@ interface KategorieGruppeProps {
|
||||
onClone?: (id: number) => void
|
||||
onJoin?: (id: number) => void
|
||||
onLeave?: (id: number, userId: number) => void
|
||||
// Opens the choice of one sharing tier for the whole list (#2961).
|
||||
onShareCategory?: () => void
|
||||
}
|
||||
|
||||
export function KategorieGruppe({ kategorie, items, tripId, allCategories, onRename, onDeleteAll, onDeleteItem, onAddItem, assignees, tripMembers, onSetAssignees, bagTrackingEnabled, bags, onCreateBag, canEdit = true, allItems, onReorder, reorderable = true, categoryDrag, currentUserId, onSetSharing, onClone, onJoin, onLeave }: KategorieGruppeProps) {
|
||||
export function KategorieGruppe({ kategorie, items, tripId, allCategories, onRename, onDeleteAll, onDeleteItem, onAddItem, assignees, tripMembers, onSetAssignees, bagTrackingEnabled, bags, onCreateBag, canEdit = true, allItems, onReorder, reorderable = true, categoryDrag, currentUserId, onSetSharing, onClone, onJoin, onLeave, onShareCategory }: KategorieGruppeProps) {
|
||||
const [offen, setOffen] = useState(true)
|
||||
const [dragId, setDragId] = useState<number | null>(null)
|
||||
const [overId, setOverId] = useState<number | null>(null)
|
||||
@@ -272,6 +274,7 @@ export function KategorieGruppe({ kategorie, items, tripId, allCategories, onRen
|
||||
{canEdit && <PopoverItem icon={<Pencil size={13} />} label={t('packing.menuRename')} onClick={() => { setEditingName(true); setShowMenu(false) }} />}
|
||||
<PopoverItem icon={<CheckCheck size={13} />} label={t('packing.menuCheckAll')} onClick={() => { void handleCheckAll(); setShowMenu(false) }} />
|
||||
<PopoverItem icon={<RotateCcw size={13} />} label={t('packing.menuUncheckAll')} onClick={() => { void handleUncheckAll(); setShowMenu(false) }} />
|
||||
{canEdit && onShareCategory && <PopoverItem icon={<Share2 size={13} />} label={t('packing.menuShareCat')} onClick={() => { onShareCategory(); setShowMenu(false) }} />}
|
||||
{canEdit && <>
|
||||
<div style={POPOVER_DIVIDER} />
|
||||
<PopoverItem icon={<Trash2 size={13} />} label={t('packing.menuDeleteCat')} danger onClick={handleDeleteAll} />
|
||||
|
||||
@@ -8,7 +8,7 @@ export function PackingList(S: PackingState) {
|
||||
items, gruppiert, t, tripId, allCategories, handleRenameCategory, handleDeleteCategory, handleDeleteItem,
|
||||
handleAddItemToCategory, categoryAssignees, tripMembers, handleSetAssignees,
|
||||
bagTrackingEnabled, bags, handleCreateBagByName, canEdit, reorderPackingItems,
|
||||
currentUserId, handleSetSharing, handleCloneItem, handleJoinItem, handleLeaveItem, sort, moveCategory,
|
||||
currentUserId, handleSetSharing, handleCloneItem, handleJoinItem, handleLeaveItem, categorySharing, sort, moveCategory,
|
||||
} = S
|
||||
// Which category is being dragged and which card it is over. Held here, above
|
||||
// the cards, because the drag starts in one card and ends in another.
|
||||
@@ -59,6 +59,7 @@ export function PackingList(S: PackingState) {
|
||||
onClone={handleCloneItem}
|
||||
onJoin={handleJoinItem}
|
||||
onLeave={handleLeaveItem}
|
||||
onShareCategory={() => categorySharing.openFor(kat)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -2,12 +2,16 @@ import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { buildPackingItem } from '../../../tests/helpers/factories';
|
||||
import {
|
||||
agreedSharing,
|
||||
categorySharingSplit,
|
||||
formatWeight,
|
||||
groupPackingItems,
|
||||
isLastCustomItemInCategory,
|
||||
isPackingPlaceholder,
|
||||
itemOrderWithCategoryMoved,
|
||||
itemsToReshare,
|
||||
packingCategoryOrder,
|
||||
packingItemSharing,
|
||||
packingItemWeight,
|
||||
packingProgress,
|
||||
packingStatusFiltered,
|
||||
@@ -15,7 +19,7 @@ import {
|
||||
} from './packingListModel';
|
||||
import { PACKING_PLACEHOLDER_NAME } from './packingListPanel.constants';
|
||||
|
||||
// FE-PACK-MODEL-001 to FE-PACK-MODEL-009
|
||||
// FE-PACK-MODEL-001 to FE-PACK-MODEL-013
|
||||
|
||||
const shared = buildPackingItem({ id: 1, name: 'Tent', category: 'Camp', checked: 1 });
|
||||
const mine = buildPackingItem({ id: 2, name: 'Socks', category: 'Clothes', is_private: 1 });
|
||||
@@ -102,3 +106,46 @@ describe('packingListModel', () => {
|
||||
expect(itemOrderWithCategoryMoved(items, items, 'Other', 'Camp', 'Other')).toEqual([4, 1, 3]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('packingListModel: sharing a whole list (#2961)', () => {
|
||||
const recipients = (...ids: number[]) => ids.map((user_id) => ({ user_id, username: `u${user_id}` }));
|
||||
const common = buildPackingItem({ id: 10, category: 'Camp', owner_id: 1 });
|
||||
const personal = buildPackingItem({ id: 11, category: 'Camp', is_private: 1, owner_id: 1 });
|
||||
const sharedTwo = buildPackingItem({
|
||||
id: 12,
|
||||
category: 'Camp',
|
||||
is_private: 1,
|
||||
owner_id: 1,
|
||||
recipients: recipients(3, 2),
|
||||
});
|
||||
const legacy = buildPackingItem({ id: 13, category: 'Camp', owner_id: null });
|
||||
const theirs = buildPackingItem({ id: 14, category: 'Camp', owner_id: 2 });
|
||||
|
||||
it('FE-PACK-MODEL-010: an item reads as common, personal or shared with its people in order', () => {
|
||||
expect(packingItemSharing(common)).toEqual({ visibility: 'common', recipientIds: [] });
|
||||
expect(packingItemSharing(personal)).toEqual({ visibility: 'personal', recipientIds: [] });
|
||||
expect(packingItemSharing(sharedTwo)).toEqual({ visibility: 'shared', recipientIds: [2, 3] });
|
||||
});
|
||||
|
||||
it('FE-PACK-MODEL-011: my items and unowned ones can be moved, the ones of others are only counted', () => {
|
||||
const split = categorySharingSplit([common, legacy, theirs, personal], 1);
|
||||
expect(split.own.map((i) => i.id)).toEqual([10, 13, 11]);
|
||||
expect(split.othersCount).toBe(1);
|
||||
expect(categorySharingSplit([theirs], 1)).toEqual({ own: [], othersCount: 1 });
|
||||
});
|
||||
|
||||
it('FE-PACK-MODEL-012: the tier the items agree on, or none when they differ', () => {
|
||||
expect(agreedSharing([common, legacy])).toEqual({ visibility: 'common', recipientIds: [] });
|
||||
const sameTwo = buildPackingItem({ category: 'Camp', is_private: 1, owner_id: 1, recipients: recipients(2, 3) });
|
||||
expect(agreedSharing([sharedTwo, sameTwo])).toEqual({ visibility: 'shared', recipientIds: [2, 3] });
|
||||
expect(agreedSharing([common, personal])).toBeNull();
|
||||
expect(agreedSharing([])).toBeNull();
|
||||
});
|
||||
|
||||
it('FE-PACK-MODEL-013: only the items not yet at the target tier need a write', () => {
|
||||
const items = [common, personal, sharedTwo];
|
||||
expect(itemsToReshare(items, { visibility: 'personal', recipientIds: [] }).map((i) => i.id)).toEqual([10, 12]);
|
||||
expect(itemsToReshare(items, { visibility: 'shared', recipientIds: [3, 2] }).map((i) => i.id)).toEqual([10, 11]);
|
||||
expect(itemsToReshare(items, { visibility: 'common', recipientIds: [] }).map((i) => i.id)).toEqual([11, 12]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import type { PackingVisibility } from '@trek/shared';
|
||||
|
||||
import type { PackingItem } from '../../types';
|
||||
import { PACKING_PLACEHOLDER_NAME } from './packingListPanel.constants';
|
||||
|
||||
@@ -124,3 +126,48 @@ export function isLastCustomItemInCategory(item: PackingItem, allItems: PackingI
|
||||
export function isPackingPlaceholder(item: Pick<PackingItem, 'name'>): boolean {
|
||||
return item.name === PACKING_PLACEHOLDER_NAME;
|
||||
}
|
||||
|
||||
/** An item's sharing tier and, for the Shared-with tier, who it is shared with (#858). */
|
||||
export interface PackingSharing {
|
||||
visibility: PackingVisibility;
|
||||
recipientIds: number[];
|
||||
}
|
||||
|
||||
/** The tier an item stands at, read the way the per-item sharing controls read it. */
|
||||
export function packingItemSharing(item: PackingItem): PackingSharing {
|
||||
const recipientIds = (item.recipients || []).map((r) => r.user_id).sort((a, b) => a - b);
|
||||
if (!item.is_private) return { visibility: 'common', recipientIds: [] };
|
||||
return { visibility: recipientIds.length > 0 ? 'shared' : 'personal', recipientIds };
|
||||
}
|
||||
|
||||
function sameSharing(a: PackingSharing, b: PackingSharing): boolean {
|
||||
return a.visibility === b.visibility && a.recipientIds.join(',') === b.recipientIds.join(',');
|
||||
}
|
||||
|
||||
/**
|
||||
* A list's items split for moving the whole list to one tier (#2961). Only an
|
||||
* item's owner may change its sharing, and an item nobody owns yet is claimed by
|
||||
* whoever changes it, as with a single item; the rest stay as they are and are
|
||||
* counted so the user can be told. The placeholder of an empty list is one of
|
||||
* its items, so the list moves along with it.
|
||||
*/
|
||||
export function categorySharingSplit(
|
||||
categoryItems: PackingItem[],
|
||||
userId: number | null | undefined
|
||||
): { own: PackingItem[]; othersCount: number } {
|
||||
const own = categoryItems.filter((i) => i.owner_id == null || i.owner_id === userId);
|
||||
return { own, othersCount: categoryItems.length - own.length };
|
||||
}
|
||||
|
||||
/** The tier all of these items already agree on, or null when they differ or there are none. */
|
||||
export function agreedSharing(items: PackingItem[]): PackingSharing | null {
|
||||
if (items.length === 0) return null;
|
||||
const first = packingItemSharing(items[0]);
|
||||
return items.every((i) => sameSharing(packingItemSharing(i), first)) ? first : null;
|
||||
}
|
||||
|
||||
/** The items that a move to `target` would actually change; those already there need no write. */
|
||||
export function itemsToReshare(items: PackingItem[], target: PackingSharing): PackingItem[] {
|
||||
const wanted = { ...target, recipientIds: [...target.recipientIds].sort((a, b) => a - b) };
|
||||
return items.filter((i) => !sameSharing(packingItemSharing(i), wanted));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
// FE-PACK-CATSHARE-001 to FE-PACK-CATSHARE-006: moving a whole packing list to one sharing tier (#2961).
|
||||
import { act, renderHook } from '@testing-library/react';
|
||||
import { type Mock, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import { buildPackingItem } from '../../../tests/helpers/factories';
|
||||
import type { TripStoreState } from '../../store/tripStore';
|
||||
import type { PackingItem } from '../../types';
|
||||
import { usePackingCategorySharing } from './usePackingCategorySharing';
|
||||
|
||||
type Share = TripStoreState['setPackingItemSharing'];
|
||||
|
||||
const ME = 1;
|
||||
const recipients = (...ids: number[]) => ids.map((user_id) => ({ user_id, username: `u${user_id}` }));
|
||||
|
||||
const tent = buildPackingItem({ id: 1, name: 'Tent', category: 'Camp', owner_id: ME });
|
||||
const stove = buildPackingItem({ id: 2, name: 'Stove', category: 'Camp', owner_id: null, checked: 1 });
|
||||
const theirs = buildPackingItem({ id: 3, name: 'Lamp', category: 'Camp', owner_id: 2 });
|
||||
const socks = buildPackingItem({ id: 4, name: 'Socks', category: 'Clothes', owner_id: ME });
|
||||
const diary = buildPackingItem({ id: 5, name: 'Diary', category: 'Camp', owner_id: ME, is_private: 1 });
|
||||
|
||||
function setup(items: PackingItem[], setPackingItemSharing: Mock<Share> = vi.fn<Share>(() => Promise.resolve())) {
|
||||
const toast = { success: vi.fn() };
|
||||
const t = vi.fn((key: string) => key);
|
||||
const hook = renderHook(() =>
|
||||
usePackingCategorySharing({
|
||||
tripId: 7,
|
||||
items,
|
||||
view: 'common',
|
||||
defaultCategory: 'Other',
|
||||
currentUserId: ME,
|
||||
setPackingItemSharing,
|
||||
t,
|
||||
toast,
|
||||
})
|
||||
);
|
||||
return { ...hook, setPackingItemSharing, toast, t };
|
||||
}
|
||||
|
||||
describe('usePackingCategorySharing', () => {
|
||||
it('FE-PACK-CATSHARE-001: opens on the list of the open view, ticked items included, and counts the items of others', () => {
|
||||
const { result } = setup([tent, stove, theirs, socks, diary]);
|
||||
expect(result.current.category).toBeNull();
|
||||
|
||||
act(() => result.current.openFor('Camp'));
|
||||
expect(result.current.category).toBe('Camp');
|
||||
// The personal Diary is in the other view, Socks in another list.
|
||||
expect(result.current.ownCount).toBe(2);
|
||||
expect(result.current.othersCount).toBe(1);
|
||||
// Tent and Stove both sit on the common list, so that tier is preselected.
|
||||
expect(result.current.visibility).toBe('common');
|
||||
expect(result.current.ready).toBe(true);
|
||||
});
|
||||
|
||||
it('FE-PACK-CATSHARE-002: moving to my list writes each own item once, in order, and reports the items left alone', async () => {
|
||||
const { result, setPackingItemSharing, toast, t } = setup([tent, stove, theirs]);
|
||||
act(() => result.current.openFor('Camp'));
|
||||
act(() => result.current.setVisibility('personal'));
|
||||
|
||||
await act(() => result.current.apply());
|
||||
|
||||
expect(setPackingItemSharing.mock.calls).toEqual([
|
||||
[7, 1, 'personal', []],
|
||||
[7, 2, 'personal', []],
|
||||
]);
|
||||
expect(t).toHaveBeenCalledWith('packing.shareCat.doneOthersKept', { name: 'Camp' });
|
||||
expect(toast.success).toHaveBeenCalledWith('packing.shareCat.doneOthersKept');
|
||||
expect(result.current.category).toBeNull();
|
||||
});
|
||||
|
||||
it('FE-PACK-CATSHARE-003: sharing with people needs at least one of them, and sends who was picked', async () => {
|
||||
const { result, setPackingItemSharing, toast } = setup([tent]);
|
||||
act(() => result.current.openFor('Camp'));
|
||||
act(() => result.current.setVisibility('shared'));
|
||||
expect(result.current.ready).toBe(false);
|
||||
|
||||
act(() => result.current.toggleRecipient(3));
|
||||
act(() => result.current.toggleRecipient(2));
|
||||
act(() => result.current.toggleRecipient(3));
|
||||
expect(result.current.recipientIds).toEqual([2]);
|
||||
expect(result.current.ready).toBe(true);
|
||||
|
||||
await act(() => result.current.apply());
|
||||
expect(setPackingItemSharing).toHaveBeenCalledWith(7, 1, 'shared', [2]);
|
||||
expect(toast.success).toHaveBeenCalledWith('packing.shareCat.done');
|
||||
});
|
||||
|
||||
it('FE-PACK-CATSHARE-004: items already at the tier are not written again, and a list that agrees on people starts there', async () => {
|
||||
const kettle = buildPackingItem({
|
||||
id: 6,
|
||||
category: 'Food',
|
||||
owner_id: ME,
|
||||
is_private: 1,
|
||||
recipients: recipients(3, 2),
|
||||
});
|
||||
const pans = buildPackingItem({
|
||||
id: 7,
|
||||
category: 'Food',
|
||||
owner_id: ME,
|
||||
is_private: 1,
|
||||
recipients: recipients(2, 3),
|
||||
});
|
||||
const { result, setPackingItemSharing, toast } = setup([kettle, pans]);
|
||||
act(() => result.current.openFor('Food'));
|
||||
expect(result.current.visibility).toBe('shared');
|
||||
expect(result.current.recipientIds).toEqual([2, 3]);
|
||||
|
||||
await act(() => result.current.apply());
|
||||
expect(setPackingItemSharing).not.toHaveBeenCalled();
|
||||
expect(toast.success).not.toHaveBeenCalled();
|
||||
expect(result.current.category).toBeNull();
|
||||
});
|
||||
|
||||
it('FE-PACK-CATSHARE-005: a failed write stops the run and keeps the choice open, without a second message', async () => {
|
||||
const failing = vi.fn<Share>(() => Promise.reject(new Error('offline')));
|
||||
const { result, toast } = setup([tent, stove], failing);
|
||||
act(() => result.current.openFor('Camp'));
|
||||
act(() => result.current.setVisibility('personal'));
|
||||
|
||||
await act(() => result.current.apply());
|
||||
|
||||
expect(failing).toHaveBeenCalledOnce();
|
||||
expect(toast.success).not.toHaveBeenCalled();
|
||||
expect(result.current.category).toBe('Camp');
|
||||
expect(result.current.busy).toBe(false);
|
||||
});
|
||||
|
||||
it('FE-PACK-CATSHARE-006: a list of nobody but others cannot be applied, and closing clears the choice', async () => {
|
||||
const { result, setPackingItemSharing } = setup([theirs]);
|
||||
act(() => result.current.openFor('Camp'));
|
||||
act(() => result.current.setVisibility('personal'));
|
||||
expect(result.current.ownCount).toBe(0);
|
||||
expect(result.current.ready).toBe(false);
|
||||
|
||||
await act(() => result.current.apply());
|
||||
expect(setPackingItemSharing).not.toHaveBeenCalled();
|
||||
|
||||
act(() => result.current.close());
|
||||
expect(result.current.category).toBeNull();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,128 @@
|
||||
import type { PackingVisibility } from '@trek/shared';
|
||||
import { useState } from 'react';
|
||||
|
||||
import type { TripStoreState } from '../../store/tripStore';
|
||||
import type { PackingItem } from '../../types';
|
||||
import {
|
||||
type PackingSharing,
|
||||
type PackingView,
|
||||
agreedSharing,
|
||||
categorySharingSplit,
|
||||
itemsToReshare,
|
||||
packingViewItems,
|
||||
} from './packingListModel';
|
||||
|
||||
/** A list's items in the open view, ticked or not. */
|
||||
const listItems = (items: PackingItem[], view: PackingView, category: string, defaultCategory: string) =>
|
||||
packingViewItems(items, view).filter((i) => (i.category || defaultCategory) === category);
|
||||
|
||||
type Translate = (key: string, params?: Record<string, string | number>) => string;
|
||||
interface Toaster {
|
||||
success: (message: string) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Moving a whole list to one sharing tier at once (#2961), behind the desktop
|
||||
* dialog and the phone sheet alike. There is no bulk write on the server: each
|
||||
* item the user owns goes through the same per-item sharing call the item's own
|
||||
* control uses, so the owner-only rule, the claim of an unowned item and the
|
||||
* live update to the other members all stay exactly as they are. Items other
|
||||
* people added are left alone, and the dialog says so before anything moves.
|
||||
*
|
||||
* The list is the category within the open view, whatever the status filter
|
||||
* hides, so a ticked item never stays behind on its own.
|
||||
*/
|
||||
export function usePackingCategorySharing({
|
||||
tripId,
|
||||
items,
|
||||
view,
|
||||
defaultCategory,
|
||||
currentUserId,
|
||||
setPackingItemSharing,
|
||||
t,
|
||||
toast,
|
||||
}: {
|
||||
tripId: number;
|
||||
items: PackingItem[];
|
||||
view: PackingView;
|
||||
defaultCategory: string;
|
||||
currentUserId: number | null | undefined;
|
||||
setPackingItemSharing: TripStoreState['setPackingItemSharing'];
|
||||
t: Translate;
|
||||
toast: Toaster;
|
||||
}) {
|
||||
const [category, setCategory] = useState<string | null>(null);
|
||||
const [visibility, setVisibility] = useState<PackingVisibility | null>(null);
|
||||
const [recipientIds, setRecipientIds] = useState<number[]>([]);
|
||||
const [busy, setBusy] = useState(false);
|
||||
|
||||
const splitOf = (name: string | null) =>
|
||||
categorySharingSplit(name == null ? [] : listItems(items, view, name, defaultCategory), currentUserId);
|
||||
const { own, othersCount } = splitOf(category);
|
||||
|
||||
/** Opens the choice for a list, starting from the tier its items already agree on. */
|
||||
const openFor = (name: string) => {
|
||||
const agreed = agreedSharing(splitOf(name).own);
|
||||
setCategory(name);
|
||||
setVisibility(agreed?.visibility ?? null);
|
||||
setRecipientIds(agreed?.recipientIds ?? []);
|
||||
};
|
||||
|
||||
const close = () => {
|
||||
if (!busy) setCategory(null);
|
||||
};
|
||||
|
||||
const toggleRecipient = (userId: number) =>
|
||||
setRecipientIds((ids) => (ids.includes(userId) ? ids.filter((id) => id !== userId) : [...ids, userId]));
|
||||
|
||||
const ready = !busy && own.length > 0 && visibility != null && (visibility !== 'shared' || recipientIds.length > 0);
|
||||
|
||||
/**
|
||||
* One write per item that is not at the tier yet, one after the other. The
|
||||
* store reports a failed write itself, so a failure only stops the run and
|
||||
* keeps the choice open to try again; what went through before it stays.
|
||||
*/
|
||||
const apply = async () => {
|
||||
if (!ready || category == null || visibility == null) return;
|
||||
const target: PackingSharing = { visibility, recipientIds: visibility === 'shared' ? recipientIds : [] };
|
||||
const changes = itemsToReshare(own, target);
|
||||
// Already there: nothing to write and nothing to report.
|
||||
if (changes.length === 0) {
|
||||
setCategory(null);
|
||||
return;
|
||||
}
|
||||
setBusy(true);
|
||||
try {
|
||||
for (const item of changes) {
|
||||
await setPackingItemSharing(tripId, item.id, target.visibility, target.recipientIds);
|
||||
}
|
||||
} catch {
|
||||
return;
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
setCategory(null);
|
||||
toast.success(
|
||||
othersCount > 0
|
||||
? t('packing.shareCat.doneOthersKept', { name: category })
|
||||
: t('packing.shareCat.done', { name: category })
|
||||
);
|
||||
};
|
||||
|
||||
return {
|
||||
category,
|
||||
visibility,
|
||||
setVisibility,
|
||||
recipientIds,
|
||||
toggleRecipient,
|
||||
ownCount: own.length,
|
||||
othersCount,
|
||||
busy,
|
||||
ready,
|
||||
openFor,
|
||||
close,
|
||||
apply,
|
||||
};
|
||||
}
|
||||
|
||||
export type PackingCategorySharing = ReturnType<typeof usePackingCategorySharing>;
|
||||
@@ -12,6 +12,7 @@ import { parseImportLines, sortItemsByName } from './packingListPanel.helpers'
|
||||
import { groupPackingItems, itemOrderWithCategoryMoved, packingCategoryOrder, packingProgress, packingViewItems } from './packingListModel'
|
||||
import { usePackingBags } from './usePackingBags'
|
||||
import { usePackingCategoryAssignees } from './usePackingCategoryAssignees'
|
||||
import { usePackingCategorySharing } from './usePackingCategorySharing'
|
||||
import { usePackingImport } from './usePackingImport'
|
||||
import { usePackingItemActions } from './usePackingItemActions'
|
||||
import { usePackingTemplates } from './usePackingTemplates'
|
||||
@@ -223,10 +224,14 @@ export function usePackingList({ tripId, items, openImportSignal = 0, addCategor
|
||||
const handleCloneItem = (id: number) => clonePackingItem(tripId, id)
|
||||
const handleJoinItem = (id: number) => addPackingContributor(tripId, id)
|
||||
const handleLeaveItem = (id: number, userId: number) => removePackingContributor(tripId, id, userId)
|
||||
// A whole list at once (#2961), through the same per-item write as above.
|
||||
const categorySharing = usePackingCategorySharing({
|
||||
tripId, items, view, defaultCategory: t('packing.defaultCategory'), currentUserId, setPackingItemSharing, t, toast,
|
||||
})
|
||||
|
||||
return {
|
||||
view, setView, currentUserId,
|
||||
handleSetSharing, handleCloneItem, handleJoinItem, handleLeaveItem,
|
||||
handleSetSharing, handleCloneItem, handleJoinItem, handleLeaveItem, categorySharing,
|
||||
tripId, items, inlineHeader, t, canEdit, isAdmin, font, reorderPackingItems,
|
||||
filter, setFilter, sort, setSort, addingCategory, setAddingCategory, newCatName, setNewCatName,
|
||||
tripMembers, categoryAssignees, handleSetAssignees, allCategories, gruppiert, abgehakt, fortschritt, viewTotal, moveCategory,
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
import type { PackingVisibility } from '@trek/shared';
|
||||
import { Check, type LucideIcon, Share2, UserRound, Users } from 'lucide-react';
|
||||
|
||||
import type { PackingCategorySharing } from '../../../../components/Packing/usePackingCategorySharing';
|
||||
import type { TripMember } from '../../../../types';
|
||||
import MSheet from '../../../components/MSheet';
|
||||
import type { TripPlanner } from '../MTripShell';
|
||||
import { FormSheetBody, FormSheetFooter, FormSheetHeader } from '../sheets/PlSheetChrome';
|
||||
|
||||
/**
|
||||
* The phone's choice of one sharing tier for a whole packing list (#2961), the
|
||||
* counterpart of the desktop dialog on the same hook: the three tiers of an
|
||||
* item's own sharing control stacked as rows, the people under the third, and a
|
||||
* note on the items that belong to someone else.
|
||||
*/
|
||||
export default function MPackingCategorySharingSheet({
|
||||
sharing,
|
||||
tripMembers,
|
||||
currentUserId,
|
||||
t,
|
||||
}: {
|
||||
sharing: PackingCategorySharing;
|
||||
tripMembers: TripMember[];
|
||||
currentUserId: number | null;
|
||||
t: TripPlanner['t'];
|
||||
}) {
|
||||
const { category, visibility, recipientIds, ownCount, othersCount, busy, ready } = sharing;
|
||||
const others = tripMembers.filter((m) => m.id !== currentUserId);
|
||||
const needsPeople = visibility === 'shared' && others.length > 0 && recipientIds.length === 0;
|
||||
|
||||
const tier = (value: PackingVisibility, Icon: LucideIcon, label: string, hint?: string) => {
|
||||
const on = visibility === value;
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
aria-pressed={on}
|
||||
disabled={ownCount === 0}
|
||||
onClick={() => sharing.setVisibility(value)}
|
||||
className={`flex items-center gap-[10px] rounded-[10px] px-[10px] py-[9px] text-start disabled:opacity-50 ${on ? 'bg-m-card' : ''}`}
|
||||
>
|
||||
<Icon size={15} strokeWidth={2} className={`flex-none ${on ? 'text-m-ink' : 'text-m-muted'}`} />
|
||||
<span className="min-w-0 flex-1">
|
||||
<span className="block text-[0.8125rem] font-semibold text-m-ink">{label}</span>
|
||||
{hint && <span className="block font-geist text-[0.6875rem] text-m-faint">{hint}</span>}
|
||||
</span>
|
||||
{on && <Check size={14} strokeWidth={2.4} className="flex-none text-m-ink" />}
|
||||
</button>
|
||||
);
|
||||
};
|
||||
|
||||
const note = (text: string) => (
|
||||
<p className="mt-3 font-geist text-[0.6875rem] leading-relaxed text-m-muted">{text}</p>
|
||||
);
|
||||
|
||||
return (
|
||||
<MSheet open={category != null} onClose={sharing.close} form ariaLabel={t('packing.menuShareCat')}>
|
||||
<FormSheetHeader
|
||||
icon={Share2}
|
||||
title={t('packing.menuShareCat')}
|
||||
subtitle={category}
|
||||
onClose={sharing.close}
|
||||
closeLabel={t('common.close')}
|
||||
/>
|
||||
|
||||
<FormSheetBody>
|
||||
<p className="mb-3 font-geist text-[0.71875rem] leading-relaxed text-m-muted">
|
||||
{ownCount === 0 ? t('packing.shareCat.noneOwn') : t('packing.shareCat.hint')}
|
||||
</p>
|
||||
|
||||
<div className="flex flex-col gap-1 rounded-[14px] border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)] p-[6px]">
|
||||
{tier('common', Users, t('packing.viewCommon'), t('packing.tierCommonHint'))}
|
||||
{tier('personal', UserRound, t('packing.tierPersonal'), t('packing.tierPersonalHint'))}
|
||||
{tier('shared', Share2, t('packing.tierShared'))}
|
||||
{visibility === 'shared' &&
|
||||
(others.length === 0 ? (
|
||||
<div className="px-[10px] py-1 ps-9 font-geist text-[0.6875rem] text-m-faint">
|
||||
{t('packing.noOneToShare')}
|
||||
</div>
|
||||
) : (
|
||||
others.map((m) => {
|
||||
const picked = recipientIds.includes(m.id);
|
||||
return (
|
||||
<button
|
||||
key={m.id}
|
||||
type="button"
|
||||
aria-pressed={picked}
|
||||
onClick={() => sharing.toggleRecipient(m.id)}
|
||||
className="flex items-center gap-[8px] rounded-[9px] py-[7px] pe-[10px] ps-9 text-start"
|
||||
>
|
||||
<span className="min-w-0 flex-1 truncate text-[0.78125rem] font-semibold text-m-ink">
|
||||
{m.username}
|
||||
</span>
|
||||
{picked && <Check size={14} strokeWidth={2.4} className="flex-none text-m-ink" />}
|
||||
</button>
|
||||
);
|
||||
})
|
||||
))}
|
||||
</div>
|
||||
|
||||
{needsPeople && note(t('packing.shareCat.pickPeople'))}
|
||||
{ownCount > 0 && othersCount > 0 && note(t('packing.shareCat.othersKept'))}
|
||||
</FormSheetBody>
|
||||
|
||||
<FormSheetFooter
|
||||
onCancel={sharing.close}
|
||||
cancelLabel={t('common.cancel')}
|
||||
onSubmit={() => void sharing.apply()}
|
||||
submitLabel={t('packing.shareCat.apply')}
|
||||
submitDisabled={!ready}
|
||||
/>
|
||||
</MSheet>
|
||||
);
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import type { LucideIcon } from 'lucide-react'
|
||||
import {
|
||||
Briefcase, Check, CheckCheck, ChevronDown, ChevronUp, HandHelping, Minus,
|
||||
Download, FileSpreadsheet, FileText, LayoutTemplate, MoreHorizontal, Package, Pencil, Plus, Printer, RotateCcw, Save as SaveIcon,
|
||||
Trash2, UserPlus, UserRound,
|
||||
Share2, Trash2, UserPlus, UserRound,
|
||||
} from 'lucide-react'
|
||||
import MDancingTrek from '../../../components/MDancingTrek'
|
||||
import MSwipeRow, { type SwipeAction } from '../../../components/MSwipeRow'
|
||||
@@ -25,9 +25,11 @@ import { usePackingBags } from '../../../../components/Packing/usePackingBags'
|
||||
import { usePackingTemplates } from '../../../../components/Packing/usePackingTemplates'
|
||||
import { usePackingCategoryAssignees, type CategoryAssignee } from '../../../../components/Packing/usePackingCategoryAssignees'
|
||||
import { usePackingItemActions } from '../../../../components/Packing/usePackingItemActions'
|
||||
import { usePackingCategorySharing } from '../../../../components/Packing/usePackingCategorySharing'
|
||||
import MBagsSheet from './MBagsSheet'
|
||||
import MPackItemSheet from './MPackItemSheet'
|
||||
import MPackingImportSheet from './MPackingImportSheet'
|
||||
import MPackingCategorySharingSheet from './MPackingCategorySharingSheet'
|
||||
import PackingPrintPreview from '../../../../components/Packing/PackingPrintPreview'
|
||||
import { usePackingExport } from '../../../../components/Packing/usePackingExport'
|
||||
import { packingBringerNames } from '../../../../components/Packing/packingBringers'
|
||||
@@ -90,6 +92,12 @@ export default function MPackingListTab({ planner }: { planner: TripPlanner }) {
|
||||
actions: tripActions, t, toast, placeholderFrom: 'items',
|
||||
})
|
||||
|
||||
// A whole list to one sharing tier (#2961), the same hook as the desktop dialog.
|
||||
const categorySharing = usePackingCategorySharing({
|
||||
tripId, items, view, defaultCategory, currentUserId,
|
||||
setPackingItemSharing: tripActions.setPackingItemSharing, t, toast,
|
||||
})
|
||||
|
||||
const toggleCategory = (cat: string) => setCollapsed(c => ({ ...c, [cat]: !c[cat] }))
|
||||
|
||||
const checkAllInCategory = async (catItems: PackingItem[]) => {
|
||||
@@ -334,6 +342,7 @@ export default function MPackingListTab({ planner }: { planner: TripPlanner }) {
|
||||
onRename={newName => renameCategory(group.category, newName)}
|
||||
onCheckAll={() => checkAllInCategory(group.items)}
|
||||
onUncheckAll={() => uncheckAllInCategory(group.items)}
|
||||
onShareCategory={() => categorySharing.openFor(group.category)}
|
||||
onDeleteCategory={() => setDeleteCategoryTarget({ name: group.category, items: items.filter(i => (i.category || defaultCategory) === group.category) })}
|
||||
onAddItem={name => addItemToCategory(group.category, name)}
|
||||
onEditItem={id => setEditingItemId(id)}
|
||||
@@ -374,6 +383,7 @@ export default function MPackingListTab({ planner }: { planner: TripPlanner }) {
|
||||
/>
|
||||
|
||||
<MPackingImportSheet planner={planner} open={showImportSheet} onClose={() => setShowImportSheet(false)} />
|
||||
<MPackingCategorySharingSheet sharing={categorySharing} tripMembers={tripMembers} currentUserId={currentUserId} t={t} />
|
||||
<PackingPrintPreview html={packingExport.printHtml} title={packingExport.printTitle} onClose={packingExport.closePrint} />
|
||||
|
||||
<MConfirmSheet
|
||||
@@ -431,7 +441,7 @@ function ActionRow({ icon: Icon, label, onClick, danger = false }: {
|
||||
|
||||
function PackingCategoryCard({
|
||||
group, categoryOrder, open, onToggle, editMode, canEdit, planner, currentUserId, assignees, tripMembers,
|
||||
onSetAssignees, onRename, onCheckAll, onUncheckAll, onDeleteCategory, onAddItem, onEditItem, onDeleteItem,
|
||||
onSetAssignees, onRename, onCheckAll, onUncheckAll, onShareCategory, onDeleteCategory, onAddItem, onEditItem, onDeleteItem,
|
||||
bagTrackingEnabled, bags, onCreateBag,
|
||||
}: {
|
||||
group: PackingCategoryGroup
|
||||
@@ -448,6 +458,7 @@ function PackingCategoryCard({
|
||||
onRename: (newName: string) => void
|
||||
onCheckAll: () => void
|
||||
onUncheckAll: () => void
|
||||
onShareCategory: () => void
|
||||
onDeleteCategory: () => void
|
||||
onAddItem: (name: string) => void
|
||||
onEditItem: (itemId: number) => void
|
||||
@@ -572,6 +583,7 @@ function PackingCategoryCard({
|
||||
<ActionRow icon={Pencil} label={t('packing.menuRename')} onClick={() => { setMenuOpen(false); setRenaming(true) }} />
|
||||
<ActionRow icon={CheckCheck} label={t('packing.menuCheckAll')} onClick={() => { setMenuOpen(false); onCheckAll() }} />
|
||||
<ActionRow icon={RotateCcw} label={t('packing.menuUncheckAll')} onClick={() => { setMenuOpen(false); onUncheckAll() }} />
|
||||
{canEdit && <ActionRow icon={Share2} label={t('packing.menuShareCat')} onClick={() => { setMenuOpen(false); onShareCategory() }} />}
|
||||
<ActionRow icon={Trash2} label={t('packing.menuDeleteCat')} danger onClick={() => { setMenuOpen(false); onDeleteCategory() }} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
// FE-MOB-PACKCATSHARE-001 to FE-MOB-PACKCATSHARE-004: the phone's sheet for sharing a whole packing list (#2961).
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import type { PackingCategorySharing } from '../../../../src/components/Packing/usePackingCategorySharing';
|
||||
import MPackingCategorySharingSheet from '../../../../src/mobile/screens/trip/tabs/MPackingCategorySharingSheet';
|
||||
import type { TripMember } from '../../../../src/types';
|
||||
import { fireEvent, render, screen } from '../../../helpers/render';
|
||||
|
||||
const ME = 7;
|
||||
const MEMBERS = [
|
||||
{ id: ME, username: 'me' },
|
||||
{ id: 11, username: 'anna' },
|
||||
] as unknown as TripMember[];
|
||||
const t = (key: string) => key;
|
||||
|
||||
function sharing(overrides: Partial<PackingCategorySharing> = {}): PackingCategorySharing {
|
||||
return {
|
||||
category: 'Camp',
|
||||
visibility: null,
|
||||
setVisibility: vi.fn(),
|
||||
recipientIds: [],
|
||||
toggleRecipient: vi.fn(),
|
||||
ownCount: 2,
|
||||
othersCount: 0,
|
||||
busy: false,
|
||||
ready: false,
|
||||
openFor: vi.fn(),
|
||||
close: vi.fn(),
|
||||
apply: vi.fn(() => Promise.resolve()),
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
|
||||
function setup(state: PackingCategorySharing) {
|
||||
render(<MPackingCategorySharingSheet sharing={state} tripMembers={MEMBERS} currentUserId={ME} t={t} />);
|
||||
return state;
|
||||
}
|
||||
|
||||
describe('MPackingCategorySharingSheet', () => {
|
||||
it('FE-MOB-PACKCATSHARE-001: stays shut without a list, and names the list it was opened for', () => {
|
||||
const { unmount } = render(
|
||||
<MPackingCategorySharingSheet
|
||||
sharing={sharing({ category: null })}
|
||||
tripMembers={MEMBERS}
|
||||
currentUserId={ME}
|
||||
t={t}
|
||||
/>
|
||||
);
|
||||
expect(screen.queryByRole('dialog')).toBeNull();
|
||||
unmount();
|
||||
|
||||
setup(sharing());
|
||||
expect(screen.getByRole('dialog')).toHaveAttribute('aria-label', 'packing.menuShareCat');
|
||||
expect(screen.getByText('Camp')).toBeInTheDocument();
|
||||
expect(screen.getByText('packing.shareCat.hint')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('FE-MOB-PACKCATSHARE-002: a tier is picked on its row, and the people show under the third, never me', () => {
|
||||
const state = setup(sharing({ visibility: 'shared', recipientIds: [] }));
|
||||
fireEvent.click(screen.getByRole('button', { name: /packing.tierPersonal/ }));
|
||||
expect(state.setVisibility).toHaveBeenCalledWith('personal');
|
||||
|
||||
expect(screen.queryByRole('button', { name: 'me' })).toBeNull();
|
||||
fireEvent.click(screen.getByRole('button', { name: 'anna' }));
|
||||
expect(state.toggleRecipient).toHaveBeenCalledWith(11);
|
||||
expect(screen.getByText('packing.shareCat.pickPeople')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('FE-MOB-PACKCATSHARE-003: applies once ready, and says that the items of others stay as they are', () => {
|
||||
const state = setup(sharing({ visibility: 'personal', ready: true, othersCount: 2 }));
|
||||
expect(screen.getByText('packing.shareCat.othersKept')).toBeInTheDocument();
|
||||
fireEvent.click(screen.getByRole('button', { name: 'packing.shareCat.apply' }));
|
||||
expect(state.apply).toHaveBeenCalledOnce();
|
||||
});
|
||||
|
||||
it('FE-MOB-PACKCATSHARE-004: a list with none of my items explains why and offers no tier', () => {
|
||||
setup(sharing({ ownCount: 0, othersCount: 3 }));
|
||||
expect(screen.getByText('packing.shareCat.noneOwn')).toBeInTheDocument();
|
||||
expect(screen.queryByText('packing.shareCat.othersKept')).toBeNull();
|
||||
expect(screen.getByRole('button', { name: /packing.viewCommon/ })).toBeDisabled();
|
||||
expect(screen.getByRole('button', { name: 'packing.shareCat.apply' })).toBeDisabled();
|
||||
});
|
||||
});
|
||||
@@ -13,7 +13,7 @@ import { resetAllStores, seedStore } from '../../../helpers/store'
|
||||
import { act, fireEvent, render, screen, waitFor, within } from '../../../helpers/render'
|
||||
import * as fileDownload from '../../../../src/utils/fileDownload'
|
||||
|
||||
// FE-MOB-PACKTAB-001 to FE-MOB-PACKTAB-046 (plus 060-069)
|
||||
// FE-MOB-PACKTAB-001 to FE-MOB-PACKTAB-046 (plus 060-071)
|
||||
|
||||
const ME = 7
|
||||
const ANNA = { id: 11, username: 'anna', avatar: null, avatar_url: 'https://cdn.example/anna.png' } as unknown as TripMember
|
||||
@@ -1002,4 +1002,20 @@ describe('MPackingListTab', () => {
|
||||
expect(card.className).toContain('wide:inline-block')
|
||||
expect((card.parentElement as HTMLElement).className).toContain('wide:columns-[300px]')
|
||||
})
|
||||
it('FE-MOB-PACKTAB-071: the list menu moves the whole list to my list, one write per item (#2961)', async () => {
|
||||
const { planner } = await setup({ planner: { tripMembers: [ANNA, BEN] } })
|
||||
enterEditMode()
|
||||
|
||||
openCategoryMenu('Documents')
|
||||
fireEvent.click(screen.getByRole('button', { name: 'packing.menuShareCat' }))
|
||||
const sheet = screen.getByRole('dialog', { name: 'packing.menuShareCat' })
|
||||
fireEvent.click(within(sheet).getByRole('button', { name: /^packing.tierPersonal/ }))
|
||||
await act(async () => { fireEvent.click(within(sheet).getByRole('button', { name: 'packing.shareCat.apply' })) })
|
||||
|
||||
expect(asMock(planner.tripActions.setPackingItemSharing).mock.calls).toEqual([
|
||||
[3, 1, 'personal', []],
|
||||
[3, 2, 'personal', []],
|
||||
])
|
||||
expect(planner.toast.success).toHaveBeenCalledWith(expect.stringContaining('packing.shareCat.done'))
|
||||
})
|
||||
})
|
||||
|
||||
@@ -71,6 +71,14 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': 'تحديد الكل',
|
||||
'packing.menuUncheckAll': 'إلغاء تحديد الكل',
|
||||
'packing.menuDeleteCat': 'حذف القائمة',
|
||||
'packing.menuShareCat': 'المشاركة للقائمة كلها',
|
||||
'packing.shareCat.hint': 'تنتقل جميع عناصرك في هذه القائمة إلى المستوى الذي تختاره.',
|
||||
'packing.shareCat.othersKept': 'تبقى العناصر التي أضافها آخرون كما هي. وحدهم يستطيعون تغييرها.',
|
||||
'packing.shareCat.noneOwn': 'أضاف شخص آخر كل عناصر هذه القائمة، لذا وحده يستطيع تغيير مشاركتها.',
|
||||
'packing.shareCat.pickPeople': 'اختر شخصًا واحدًا على الأقل للمشاركة معه.',
|
||||
'packing.shareCat.apply': 'تطبيق على القائمة',
|
||||
'packing.shareCat.done': 'تم تغيير المشاركة لـ "{name}"',
|
||||
'packing.shareCat.doneOthersKept': 'تم تغيير المشاركة لـ "{name}". بقيت العناصر التي أضافها آخرون كما هي.',
|
||||
'packing.noMembers': 'لا أعضاء',
|
||||
'packing.addItem': 'إضافة عنصر',
|
||||
'packing.addItemPlaceholder': 'اسم العنصر...',
|
||||
|
||||
@@ -62,6 +62,17 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': 'Hamısını işarələ',
|
||||
'packing.menuUncheckAll': 'Bütün işarələri sil',
|
||||
'packing.menuDeleteCat': 'Siyahını sil',
|
||||
'packing.menuShareCat': 'Bütün siyahı üçün paylaşım',
|
||||
'packing.shareCat.hint': 'Bu siyahıdakı bütün elementləriniz seçdiyiniz səviyyəyə keçir.',
|
||||
'packing.shareCat.othersKept':
|
||||
'Başqalarının əlavə etdiyi elementlər olduğu kimi qalır. Onları yalnız özləri dəyişə bilər.',
|
||||
'packing.shareCat.noneOwn':
|
||||
'Bu siyahıdakı bütün elementləri başqası əlavə edib, ona görə paylaşımı yalnız o dəyişə bilər.',
|
||||
'packing.shareCat.pickPeople': 'Paylaşmaq üçün ən azı bir nəfər seçin.',
|
||||
'packing.shareCat.apply': 'Siyahıya tətbiq et',
|
||||
'packing.shareCat.done': '"{name}" üçün paylaşım dəyişdi',
|
||||
'packing.shareCat.doneOthersKept':
|
||||
'"{name}" üçün paylaşım dəyişdi. Başqalarının əlavə etdiyi elementlər olduğu kimi qaldı.',
|
||||
|
||||
'packing.noMembers': 'Səyahət üzvü yoxdur',
|
||||
'packing.addItem': 'Element əlavə et',
|
||||
|
||||
@@ -57,6 +57,17 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': 'Marcar todos',
|
||||
'packing.menuUncheckAll': 'Desmarcar todos',
|
||||
'packing.menuDeleteCat': 'Excluir lista',
|
||||
'packing.menuShareCat': 'Compartilhamento da lista inteira',
|
||||
'packing.shareCat.hint': 'Todos os seus itens desta lista passam para o nível escolhido.',
|
||||
'packing.shareCat.othersKept':
|
||||
'Os itens que outras pessoas adicionaram continuam como estão. Só elas podem alterá-los.',
|
||||
'packing.shareCat.noneOwn':
|
||||
'Todos os itens desta lista foram adicionados por outra pessoa, então só ela pode alterar o compartilhamento.',
|
||||
'packing.shareCat.pickPeople': 'Escolha pelo menos uma pessoa para compartilhar.',
|
||||
'packing.shareCat.apply': 'Aplicar à lista',
|
||||
'packing.shareCat.done': 'Compartilhamento alterado para "{name}"',
|
||||
'packing.shareCat.doneOthersKept':
|
||||
'Compartilhamento alterado para "{name}". Os itens que outras pessoas adicionaram ficaram como estavam.',
|
||||
'packing.noMembers': 'Nenhum membro na viagem',
|
||||
'packing.addItem': 'Adicionar item',
|
||||
'packing.addItemPlaceholder': 'Nome do item...',
|
||||
|
||||
@@ -43,6 +43,17 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': 'Marca-ho tot',
|
||||
'packing.menuUncheckAll': 'Desmarca-ho tot',
|
||||
'packing.menuDeleteCat': 'Elimina la categoria',
|
||||
'packing.menuShareCat': 'Compartició de tota la llista',
|
||||
'packing.shareCat.hint': "Tots els teus elements d'aquesta llista passen al nivell que triïs.",
|
||||
'packing.shareCat.othersKept':
|
||||
'Els elements que han afegit altres persones es queden com estan. Només elles els poden canviar.',
|
||||
'packing.shareCat.noneOwn':
|
||||
"Tots els elements d'aquesta llista els ha afegit una altra persona, així que només ella en pot canviar la compartició.",
|
||||
'packing.shareCat.pickPeople': 'Tria almenys una persona amb qui compartir.',
|
||||
'packing.shareCat.apply': 'Aplica a la llista',
|
||||
'packing.shareCat.done': 'Compartició canviada per a «{name}»',
|
||||
'packing.shareCat.doneOthersKept':
|
||||
'Compartició canviada per a «{name}». Els elements que han afegit altres persones es queden com estaven.',
|
||||
'packing.addItem': 'Afegeix un article',
|
||||
'packing.addItemPlaceholder': "Nom de l'article...",
|
||||
'packing.addCategory': 'Afegeix una categoria',
|
||||
|
||||
@@ -59,6 +59,15 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': 'Označit vše',
|
||||
'packing.menuUncheckAll': 'Odznačit vše',
|
||||
'packing.menuDeleteCat': 'Smazat seznam',
|
||||
'packing.menuShareCat': 'Sdílení celého seznamu',
|
||||
'packing.shareCat.hint': 'Všechny vaše položky v tomto seznamu přejdou na zvolenou úroveň.',
|
||||
'packing.shareCat.othersKept': 'Položky, které přidali ostatní, zůstanou beze změny. Změnit je mohou jen oni.',
|
||||
'packing.shareCat.noneOwn': 'Všechny položky tohoto seznamu přidal někdo jiný, takže sdílení může změnit jen on.',
|
||||
'packing.shareCat.pickPeople': 'Vyberte alespoň jednu osobu ke sdílení.',
|
||||
'packing.shareCat.apply': 'Použít na seznam',
|
||||
'packing.shareCat.done': 'Sdílení seznamu „{name}“ změněno',
|
||||
'packing.shareCat.doneOthersKept':
|
||||
'Sdílení seznamu „{name}“ změněno. Položky, které přidali ostatní, zůstaly beze změny.',
|
||||
'packing.noMembers': 'Žádní členové cesty',
|
||||
'packing.addItem': 'Přidat položku',
|
||||
'packing.addItemPlaceholder': 'Název položky...',
|
||||
|
||||
@@ -56,6 +56,17 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': 'Alle abhaken',
|
||||
'packing.menuUncheckAll': 'Alle Haken entfernen',
|
||||
'packing.menuDeleteCat': 'Liste löschen',
|
||||
'packing.menuShareCat': 'Teilen für die ganze Liste',
|
||||
'packing.shareCat.hint': 'Alle deine Einträge in dieser Liste wechseln in die gewählte Stufe.',
|
||||
'packing.shareCat.othersKept':
|
||||
'Einträge, die andere angelegt haben, bleiben, wie sie sind. Nur sie selbst können sie ändern.',
|
||||
'packing.shareCat.noneOwn':
|
||||
'Alle Einträge dieser Liste hat jemand anderes angelegt, deshalb kann nur diese Person das Teilen ändern.',
|
||||
'packing.shareCat.pickPeople': 'Wähle mindestens eine Person zum Teilen.',
|
||||
'packing.shareCat.apply': 'Auf Liste anwenden',
|
||||
'packing.shareCat.done': 'Teilen für „{name}“ geändert',
|
||||
'packing.shareCat.doneOthersKept':
|
||||
'Teilen für „{name}“ geändert. Einträge, die andere angelegt haben, sind geblieben, wie sie waren.',
|
||||
'packing.noMembers': 'Keine Mitglieder',
|
||||
'packing.addItem': 'Eintrag hinzufügen',
|
||||
'packing.addItemPlaceholder': 'Artikelname...',
|
||||
|
||||
@@ -55,6 +55,14 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': 'Check All',
|
||||
'packing.menuUncheckAll': 'Uncheck All',
|
||||
'packing.menuDeleteCat': 'Delete List',
|
||||
'packing.menuShareCat': 'Sharing for Whole List',
|
||||
'packing.shareCat.hint': 'All your items in this list move to the tier you pick.',
|
||||
'packing.shareCat.othersKept': 'Items other people added stay as they are. Only they can change them.',
|
||||
'packing.shareCat.noneOwn': 'Every item in this list was added by someone else, so only they can change its sharing.',
|
||||
'packing.shareCat.pickPeople': 'Pick at least one person to share with.',
|
||||
'packing.shareCat.apply': 'Apply to list',
|
||||
'packing.shareCat.done': 'Sharing changed for "{name}"',
|
||||
'packing.shareCat.doneOthersKept': 'Sharing changed for "{name}". Items other people added were left as they are.',
|
||||
'packing.noMembers': 'No trip members',
|
||||
'packing.addItem': 'Add item',
|
||||
'packing.addItemPlaceholder': 'Item name...',
|
||||
|
||||
@@ -55,6 +55,17 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': 'Marcar todo',
|
||||
'packing.menuUncheckAll': 'Desmarcar todo',
|
||||
'packing.menuDeleteCat': 'Eliminar lista',
|
||||
'packing.menuShareCat': 'Compartir toda la lista',
|
||||
'packing.shareCat.hint': 'Todos tus elementos de esta lista pasan al nivel que elijas.',
|
||||
'packing.shareCat.othersKept':
|
||||
'Los elementos que añadieron otras personas se quedan como están. Solo ellas pueden cambiarlos.',
|
||||
'packing.shareCat.noneOwn':
|
||||
'Todos los elementos de esta lista los añadió otra persona, así que solo ella puede cambiar cómo se comparten.',
|
||||
'packing.shareCat.pickPeople': 'Elige al menos una persona con quien compartir.',
|
||||
'packing.shareCat.apply': 'Aplicar a la lista',
|
||||
'packing.shareCat.done': 'Uso compartido cambiado para «{name}»',
|
||||
'packing.shareCat.doneOthersKept':
|
||||
'Uso compartido cambiado para «{name}». Los elementos que añadieron otras personas se quedaron como estaban.',
|
||||
'packing.addItem': 'Añadir artículo',
|
||||
'packing.addItemPlaceholder': 'Nombre del artículo...',
|
||||
'packing.addCategory': 'Añadir lista',
|
||||
|
||||
@@ -55,6 +55,15 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': 'Märgi kõik',
|
||||
'packing.menuUncheckAll': 'Eemalda kõik märgistused',
|
||||
'packing.menuDeleteCat': 'Kustuta nimekiri',
|
||||
'packing.menuShareCat': 'Kogu nimekirja jagamine',
|
||||
'packing.shareCat.hint': 'Kõik sinu esemed selles nimekirjas lähevad valitud tasemele.',
|
||||
'packing.shareCat.othersKept': 'Teiste lisatud esemed jäävad samaks. Ainult nemad saavad neid muuta.',
|
||||
'packing.shareCat.noneOwn':
|
||||
'Kõik selle nimekirja esemed lisas keegi teine, seega saab ainult tema nende jagamist muuta.',
|
||||
'packing.shareCat.pickPeople': 'Vali vähemalt üks inimene, kellega jagada.',
|
||||
'packing.shareCat.apply': 'Rakenda nimekirjale',
|
||||
'packing.shareCat.done': 'Nimekirja „{name}“ jagamine muudetud',
|
||||
'packing.shareCat.doneOthersKept': 'Nimekirja „{name}“ jagamine muudetud. Teiste lisatud esemed jäid samaks.',
|
||||
'packing.noMembers': 'Reisil pole liikmeid',
|
||||
'packing.addItem': 'Lisa ese',
|
||||
'packing.addItemPlaceholder': 'Eseme nimi...',
|
||||
|
||||
@@ -55,6 +55,17 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': 'Tout cocher',
|
||||
'packing.menuUncheckAll': 'Tout décocher',
|
||||
'packing.menuDeleteCat': 'Supprimer la liste',
|
||||
'packing.menuShareCat': 'Partage de toute la liste',
|
||||
'packing.shareCat.hint': 'Tous vos articles de cette liste passent au niveau choisi.',
|
||||
'packing.shareCat.othersKept':
|
||||
"Les articles ajoutés par d'autres personnes restent tels quels. Seules elles peuvent les modifier.",
|
||||
'packing.shareCat.noneOwn':
|
||||
"Tous les articles de cette liste ont été ajoutés par quelqu'un d'autre, seule cette personne peut donc en changer le partage.",
|
||||
'packing.shareCat.pickPeople': 'Choisissez au moins une personne avec qui partager.',
|
||||
'packing.shareCat.apply': 'Appliquer à la liste',
|
||||
'packing.shareCat.done': 'Partage modifié pour « {name} »',
|
||||
'packing.shareCat.doneOthersKept':
|
||||
"Partage modifié pour « {name} ». Les articles ajoutés par d'autres personnes sont restés tels quels.",
|
||||
'packing.addItem': 'Ajouter un article',
|
||||
'packing.addItemPlaceholder': "Nom de l'article...",
|
||||
'packing.addCategory': 'Ajouter une liste',
|
||||
|
||||
@@ -56,6 +56,17 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': 'Επιλογή Όλων',
|
||||
'packing.menuUncheckAll': 'Αποεπιλογή Όλων',
|
||||
'packing.menuDeleteCat': 'Διαγραφή λίστας',
|
||||
'packing.menuShareCat': 'Κοινή χρήση για όλη τη λίστα',
|
||||
'packing.shareCat.hint': 'Όλα τα αντικείμενά σας σε αυτή τη λίστα μεταφέρονται στο επίπεδο που επιλέγετε.',
|
||||
'packing.shareCat.othersKept':
|
||||
'Τα αντικείμενα που πρόσθεσαν άλλοι μένουν ως έχουν. Μόνο εκείνοι μπορούν να τα αλλάξουν.',
|
||||
'packing.shareCat.noneOwn':
|
||||
'Όλα τα αντικείμενα αυτής της λίστας τα πρόσθεσε κάποιος άλλος, οπότε μόνο εκείνος μπορεί να αλλάξει την κοινή χρήση τους.',
|
||||
'packing.shareCat.pickPeople': 'Επιλέξτε τουλάχιστον ένα άτομο για κοινή χρήση.',
|
||||
'packing.shareCat.apply': 'Εφαρμογή στη λίστα',
|
||||
'packing.shareCat.done': 'Η κοινή χρήση άλλαξε για «{name}»',
|
||||
'packing.shareCat.doneOthersKept':
|
||||
'Η κοινή χρήση άλλαξε για «{name}». Τα αντικείμενα που πρόσθεσαν άλλοι έμειναν ως είχαν.',
|
||||
'packing.noMembers': 'Δεν υπάρχουν μέλη ταξιδιού',
|
||||
'packing.addItem': 'Προσθήκη αντικειμένου',
|
||||
'packing.addItemPlaceholder': 'Όνομα αντικειμένου...',
|
||||
|
||||
@@ -59,6 +59,14 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': 'סימון הכל',
|
||||
'packing.menuUncheckAll': 'ביטול סימון הכל',
|
||||
'packing.menuDeleteCat': 'מחיקת רשימה',
|
||||
'packing.menuShareCat': 'שיתוף לכל הרשימה',
|
||||
'packing.shareCat.hint': 'כל הפריטים שלך ברשימה זו עוברים לרמה שתבחר.',
|
||||
'packing.shareCat.othersKept': 'פריטים שאחרים הוסיפו נשארים כפי שהם. רק הם יכולים לשנות אותם.',
|
||||
'packing.shareCat.noneOwn': 'את כל הפריטים ברשימה זו הוסיף מישהו אחר, ולכן רק הוא יכול לשנות את השיתוף שלהם.',
|
||||
'packing.shareCat.pickPeople': 'בחר לפחות אדם אחד לשתף איתו.',
|
||||
'packing.shareCat.apply': 'החל על הרשימה',
|
||||
'packing.shareCat.done': 'השיתוף של "{name}" שונה',
|
||||
'packing.shareCat.doneOthersKept': 'השיתוף של "{name}" שונה. פריטים שאחרים הוסיפו נשארו כפי שהיו.',
|
||||
'packing.noMembers': 'אין חברים בטיול',
|
||||
'packing.addItem': 'הוספת פריט',
|
||||
'packing.addItemPlaceholder': 'שם הפריט...',
|
||||
|
||||
@@ -56,6 +56,15 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': 'Összes kipipálása',
|
||||
'packing.menuUncheckAll': 'Összes jelölés törlése',
|
||||
'packing.menuDeleteCat': 'Lista törlése',
|
||||
'packing.menuShareCat': 'Megosztás az egész listára',
|
||||
'packing.shareCat.hint': 'A lista összes saját tétele a választott szintre kerül.',
|
||||
'packing.shareCat.othersKept': 'A mások által hozzáadott tételek változatlanok maradnak. Csak ők módosíthatják őket.',
|
||||
'packing.shareCat.noneOwn': 'A lista minden tételét valaki más adta hozzá, így csak ő módosíthatja a megosztásukat.',
|
||||
'packing.shareCat.pickPeople': 'Válassz legalább egy személyt a megosztáshoz.',
|
||||
'packing.shareCat.apply': 'Alkalmazás a listára',
|
||||
'packing.shareCat.done': 'A(z) „{name}” megosztása módosult',
|
||||
'packing.shareCat.doneOthersKept':
|
||||
'A(z) „{name}” megosztása módosult. A mások által hozzáadott tételek változatlanok maradtak.',
|
||||
'packing.noMembers': 'Nincsenek utazási tagok',
|
||||
'packing.addItem': 'Tétel hozzáadása',
|
||||
'packing.addItemPlaceholder': 'Tétel neve...',
|
||||
|
||||
@@ -51,6 +51,17 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': 'Centang Semua',
|
||||
'packing.menuUncheckAll': 'Hapus Centang Semua',
|
||||
'packing.menuDeleteCat': 'Hapus daftar',
|
||||
'packing.menuShareCat': 'Berbagi untuk seluruh daftar',
|
||||
'packing.shareCat.hint': 'Semua item Anda di daftar ini pindah ke tingkat yang Anda pilih.',
|
||||
'packing.shareCat.othersKept':
|
||||
'Item yang ditambahkan orang lain tetap seperti semula. Hanya mereka yang bisa mengubahnya.',
|
||||
'packing.shareCat.noneOwn':
|
||||
'Semua item di daftar ini ditambahkan oleh orang lain, jadi hanya mereka yang bisa mengubah cara berbaginya.',
|
||||
'packing.shareCat.pickPeople': 'Pilih setidaknya satu orang untuk diajak berbagi.',
|
||||
'packing.shareCat.apply': 'Terapkan ke daftar',
|
||||
'packing.shareCat.done': 'Berbagi untuk "{name}" diubah',
|
||||
'packing.shareCat.doneOthersKept':
|
||||
'Berbagi untuk "{name}" diubah. Item yang ditambahkan orang lain tetap seperti semula.',
|
||||
'packing.noMembers': 'Tidak ada anggota perjalanan',
|
||||
'packing.addItem': 'Tambah item',
|
||||
'packing.addItemPlaceholder': 'Nama item...',
|
||||
|
||||
@@ -55,6 +55,17 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': 'Seleziona tutti',
|
||||
'packing.menuUncheckAll': 'Deseleziona tutti',
|
||||
'packing.menuDeleteCat': 'Elimina lista',
|
||||
'packing.menuShareCat': "Condivisione dell'intera lista",
|
||||
'packing.shareCat.hint': 'Tutti i tuoi elementi di questa lista passano al livello che scegli.',
|
||||
'packing.shareCat.othersKept':
|
||||
'Gli elementi aggiunti da altre persone restano come sono. Solo loro possono modificarli.',
|
||||
'packing.shareCat.noneOwn':
|
||||
"Tutti gli elementi di questa lista sono stati aggiunti da un'altra persona, quindi solo lei può cambiarne la condivisione.",
|
||||
'packing.shareCat.pickPeople': 'Scegli almeno una persona con cui condividere.',
|
||||
'packing.shareCat.apply': 'Applica alla lista',
|
||||
'packing.shareCat.done': 'Condivisione modificata per «{name}»',
|
||||
'packing.shareCat.doneOthersKept':
|
||||
'Condivisione modificata per «{name}». Gli elementi aggiunti da altre persone sono rimasti come erano.',
|
||||
'packing.noMembers': 'Nessun membro del viaggio',
|
||||
'packing.addItem': 'Aggiungi elemento',
|
||||
'packing.addItemPlaceholder': 'Nome elemento...',
|
||||
|
||||
@@ -50,6 +50,15 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': 'すべてチェック',
|
||||
'packing.menuUncheckAll': 'すべて解除',
|
||||
'packing.menuDeleteCat': 'リストを削除',
|
||||
'packing.menuShareCat': 'リスト全体の共有',
|
||||
'packing.shareCat.hint': 'このリストにあるあなたのアイテムがすべて選んだ共有範囲に移ります。',
|
||||
'packing.shareCat.othersKept': 'ほかの人が追加したアイテムはそのままです。変更できるのはその人だけです。',
|
||||
'packing.shareCat.noneOwn':
|
||||
'このリストのアイテムはすべてほかの人が追加したため、共有を変更できるのはその人だけです。',
|
||||
'packing.shareCat.pickPeople': '共有する相手を1人以上選んでください。',
|
||||
'packing.shareCat.apply': 'リストに適用',
|
||||
'packing.shareCat.done': '「{name}」の共有を変更しました',
|
||||
'packing.shareCat.doneOthersKept': '「{name}」の共有を変更しました。ほかの人が追加したアイテムはそのままです。',
|
||||
'packing.noMembers': '旅行メンバーがいません',
|
||||
'packing.addItem': '項目を追加',
|
||||
'packing.addItemPlaceholder': '項目名...',
|
||||
|
||||
@@ -50,6 +50,14 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': '전체 체크',
|
||||
'packing.menuUncheckAll': '전체 체크 해제',
|
||||
'packing.menuDeleteCat': '목록 삭제',
|
||||
'packing.menuShareCat': '목록 전체 공유',
|
||||
'packing.shareCat.hint': '이 목록에 있는 내 항목이 모두 선택한 공유 단계로 바뀝니다.',
|
||||
'packing.shareCat.othersKept': '다른 사람이 추가한 항목은 그대로 유지됩니다. 그 사람만 변경할 수 있습니다.',
|
||||
'packing.shareCat.noneOwn': '이 목록의 모든 항목을 다른 사람이 추가했으므로 그 사람만 공유를 변경할 수 있습니다.',
|
||||
'packing.shareCat.pickPeople': '공유할 사람을 한 명 이상 선택하세요.',
|
||||
'packing.shareCat.apply': '목록에 적용',
|
||||
'packing.shareCat.done': '"{name}"의 공유를 변경했습니다',
|
||||
'packing.shareCat.doneOthersKept': '"{name}"의 공유를 변경했습니다. 다른 사람이 추가한 항목은 그대로 두었습니다.',
|
||||
'packing.noMembers': '여행 멤버가 없습니다',
|
||||
'packing.addItem': '항목 추가',
|
||||
'packing.addItemPlaceholder': '항목 이름...',
|
||||
|
||||
@@ -55,6 +55,17 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': 'Alles aanvinken',
|
||||
'packing.menuUncheckAll': 'Alles uitvinken',
|
||||
'packing.menuDeleteCat': 'Lijst verwijderen',
|
||||
'packing.menuShareCat': 'Delen voor de hele lijst',
|
||||
'packing.shareCat.hint': 'Al je items in deze lijst gaan naar het niveau dat je kiest.',
|
||||
'packing.shareCat.othersKept':
|
||||
'Items die anderen hebben toegevoegd blijven zoals ze zijn. Alleen zij kunnen ze wijzigen.',
|
||||
'packing.shareCat.noneOwn':
|
||||
'Alle items in deze lijst zijn door iemand anders toegevoegd, dus alleen die persoon kan het delen wijzigen.',
|
||||
'packing.shareCat.pickPeople': 'Kies minstens één persoon om mee te delen.',
|
||||
'packing.shareCat.apply': 'Op lijst toepassen',
|
||||
'packing.shareCat.done': 'Delen gewijzigd voor "{name}"',
|
||||
'packing.shareCat.doneOthersKept':
|
||||
'Delen gewijzigd voor "{name}". Items die anderen hebben toegevoegd zijn gebleven zoals ze waren.',
|
||||
'packing.addItem': 'Item toevoegen',
|
||||
'packing.addItemPlaceholder': 'Itemnaam...',
|
||||
'packing.addCategory': 'Lijst toevoegen',
|
||||
|
||||
@@ -63,6 +63,16 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': 'Zaznacz wszystko',
|
||||
'packing.menuUncheckAll': 'Odznacz wszystko',
|
||||
'packing.menuDeleteCat': 'Usuń listę',
|
||||
'packing.menuShareCat': 'Udostępnianie całej listy',
|
||||
'packing.shareCat.hint': 'Wszystkie Twoje przedmioty z tej listy przejdą na wybrany poziom.',
|
||||
'packing.shareCat.othersKept': 'Przedmioty dodane przez innych pozostają bez zmian. Tylko oni mogą je zmienić.',
|
||||
'packing.shareCat.noneOwn':
|
||||
'Wszystkie przedmioty z tej listy dodał ktoś inny, więc tylko ta osoba może zmienić ich udostępnianie.',
|
||||
'packing.shareCat.pickPeople': 'Wybierz co najmniej jedną osobę, której chcesz udostępnić.',
|
||||
'packing.shareCat.apply': 'Zastosuj do listy',
|
||||
'packing.shareCat.done': 'Zmieniono udostępnianie listy „{name}”',
|
||||
'packing.shareCat.doneOthersKept':
|
||||
'Zmieniono udostępnianie listy „{name}”. Przedmioty dodane przez innych pozostały bez zmian.',
|
||||
'packing.saveAsTemplate': 'Zapisz jako szablon',
|
||||
'packing.templateName': 'Nazwa szablonu',
|
||||
'packing.templateSaved': 'Lista pakowania zapisana jako szablon',
|
||||
|
||||
@@ -63,6 +63,14 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': 'Отметить все',
|
||||
'packing.menuUncheckAll': 'Снять отметки',
|
||||
'packing.menuDeleteCat': 'Удалить список',
|
||||
'packing.menuShareCat': 'Доступ ко всему списку',
|
||||
'packing.shareCat.hint': 'Все ваши вещи в этом списке перейдут на выбранный уровень.',
|
||||
'packing.shareCat.othersKept': 'Вещи, добавленные другими, останутся как есть. Изменить их могут только они.',
|
||||
'packing.shareCat.noneOwn': 'Все вещи в этом списке добавил кто-то другой, поэтому изменить доступ может только он.',
|
||||
'packing.shareCat.pickPeople': 'Выберите хотя бы одного человека, с которым поделиться.',
|
||||
'packing.shareCat.apply': 'Применить к списку',
|
||||
'packing.shareCat.done': 'Доступ к «{name}» изменён',
|
||||
'packing.shareCat.doneOthersKept': 'Доступ к «{name}» изменён. Вещи, добавленные другими, остались как были.',
|
||||
'packing.addItem': 'Добавить вещь',
|
||||
'packing.addItemPlaceholder': 'Название...',
|
||||
'packing.addCategory': 'Добавить список',
|
||||
|
||||
@@ -59,6 +59,15 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': 'Označiť všetko',
|
||||
'packing.menuUncheckAll': 'Odznačiť všetko',
|
||||
'packing.menuDeleteCat': 'Odstrániť zoznam',
|
||||
'packing.menuShareCat': 'Zdieľanie celého zoznamu',
|
||||
'packing.shareCat.hint': 'Všetky vaše položky v tomto zozname prejdú na zvolenú úroveň.',
|
||||
'packing.shareCat.othersKept': 'Položky, ktoré pridali iní, zostanú bez zmeny. Zmeniť ich môžu len oni.',
|
||||
'packing.shareCat.noneOwn': 'Všetky položky tohto zoznamu pridal niekto iný, takže zdieľanie môže zmeniť len on.',
|
||||
'packing.shareCat.pickPeople': 'Vyberte aspoň jednu osobu na zdieľanie.',
|
||||
'packing.shareCat.apply': 'Použiť na zoznam',
|
||||
'packing.shareCat.done': 'Zdieľanie zoznamu „{name}“ zmenené',
|
||||
'packing.shareCat.doneOthersKept':
|
||||
'Zdieľanie zoznamu „{name}“ zmenené. Položky, ktoré pridali iní, zostali bez zmeny.',
|
||||
'packing.noMembers': 'Žiadni členovia cesty',
|
||||
'packing.addItem': 'Pridať položku',
|
||||
'packing.addItemPlaceholder': 'Názov položky...',
|
||||
|
||||
@@ -55,6 +55,15 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': 'Markera alla',
|
||||
'packing.menuUncheckAll': 'Avmarkera alla',
|
||||
'packing.menuDeleteCat': 'Ta bort lista',
|
||||
'packing.menuShareCat': 'Delning för hela listan',
|
||||
'packing.shareCat.hint': 'Alla dina saker i den här listan flyttas till nivån du väljer.',
|
||||
'packing.shareCat.othersKept': 'Saker som andra har lagt till förblir som de är. Bara de kan ändra dem.',
|
||||
'packing.shareCat.noneOwn':
|
||||
'Alla saker i den här listan har lagts till av någon annan, så bara den personen kan ändra delningen.',
|
||||
'packing.shareCat.pickPeople': 'Välj minst en person att dela med.',
|
||||
'packing.shareCat.apply': 'Tillämpa på listan',
|
||||
'packing.shareCat.done': 'Delningen ändrad för "{name}"',
|
||||
'packing.shareCat.doneOthersKept': 'Delningen ändrad för "{name}". Saker som andra har lagt till förblev som de var.',
|
||||
'packing.noMembers': 'Inga resedeltagare',
|
||||
'packing.addItem': 'Lägg till föremål',
|
||||
'packing.addItemPlaceholder': 'Föremålsnamn...',
|
||||
|
||||
@@ -51,6 +51,14 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': 'ทำเครื่องหมายทั้งหมดว่าจัดแล้ว',
|
||||
'packing.menuUncheckAll': 'ยกเลิกการเลือกทั้งหมด',
|
||||
'packing.menuDeleteCat': 'ลบรายการ',
|
||||
'packing.menuShareCat': 'การแชร์สำหรับทั้งรายการ',
|
||||
'packing.shareCat.hint': 'รายการของคุณทั้งหมดในรายการนี้จะย้ายไปยังระดับที่คุณเลือก',
|
||||
'packing.shareCat.othersKept': 'รายการที่คนอื่นเพิ่มจะคงเดิม มีเพียงพวกเขาที่เปลี่ยนได้',
|
||||
'packing.shareCat.noneOwn': 'รายการทั้งหมดในรายการนี้ถูกเพิ่มโดยคนอื่น จึงมีเพียงเขาที่เปลี่ยนการแชร์ได้',
|
||||
'packing.shareCat.pickPeople': 'เลือกอย่างน้อยหนึ่งคนเพื่อแชร์ด้วย',
|
||||
'packing.shareCat.apply': 'ใช้กับรายการ',
|
||||
'packing.shareCat.done': 'เปลี่ยนการแชร์ของ "{name}" แล้ว',
|
||||
'packing.shareCat.doneOthersKept': 'เปลี่ยนการแชร์ของ "{name}" แล้ว รายการที่คนอื่นเพิ่มยังคงเดิม',
|
||||
'packing.noMembers': 'ไม่มีสมาชิกทริป',
|
||||
'packing.addItem': 'เพิ่มรายการ',
|
||||
'packing.addItemPlaceholder': 'ชื่อรายการ...',
|
||||
|
||||
@@ -55,6 +55,16 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': 'Tümünü İşaretle',
|
||||
'packing.menuUncheckAll': 'Tüm işaretleri kaldır',
|
||||
'packing.menuDeleteCat': 'Listeyi sil',
|
||||
'packing.menuShareCat': 'Tüm liste için paylaşım',
|
||||
'packing.shareCat.hint': 'Bu listedeki tüm öğeleriniz seçtiğiniz seviyeye geçer.',
|
||||
'packing.shareCat.othersKept':
|
||||
'Başkalarının eklediği öğeler olduğu gibi kalır. Onları yalnızca kendileri değiştirebilir.',
|
||||
'packing.shareCat.noneOwn':
|
||||
'Bu listedeki tüm öğeleri başka biri ekledi, bu yüzden paylaşımı yalnızca o değiştirebilir.',
|
||||
'packing.shareCat.pickPeople': 'Paylaşmak için en az bir kişi seçin.',
|
||||
'packing.shareCat.apply': 'Listeye uygula',
|
||||
'packing.shareCat.done': '"{name}" için paylaşım değişti',
|
||||
'packing.shareCat.doneOthersKept': '"{name}" için paylaşım değişti. Başkalarının eklediği öğeler olduğu gibi kaldı.',
|
||||
'packing.noMembers': 'Seyahat üyesi yok',
|
||||
'packing.addItem': 'Öğe ekle',
|
||||
'packing.addItemPlaceholder': 'Öğe adı...',
|
||||
|
||||
@@ -63,6 +63,14 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': 'Позначити все',
|
||||
'packing.menuUncheckAll': 'Зняти позначки',
|
||||
'packing.menuDeleteCat': 'Видалити список',
|
||||
'packing.menuShareCat': 'Доступ до всього списку',
|
||||
'packing.shareCat.hint': 'Усі ваші речі в цьому списку перейдуть на вибраний рівень.',
|
||||
'packing.shareCat.othersKept': 'Речі, додані іншими, залишаться як є. Змінити їх можуть лише вони.',
|
||||
'packing.shareCat.noneOwn': 'Усі речі в цьому списку додав хтось інший, тому змінити доступ може лише він.',
|
||||
'packing.shareCat.pickPeople': 'Виберіть принаймні одну людину, з якою поділитися.',
|
||||
'packing.shareCat.apply': 'Застосувати до списку',
|
||||
'packing.shareCat.done': 'Доступ до «{name}» змінено',
|
||||
'packing.shareCat.doneOthersKept': 'Доступ до «{name}» змінено. Речі, додані іншими, залишилися як були.',
|
||||
'packing.addItem': 'Додати річ',
|
||||
'packing.addItemPlaceholder': 'Назва...',
|
||||
'packing.addCategory': 'Додати список',
|
||||
|
||||
@@ -51,6 +51,15 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': 'Kiểm tra tất cả',
|
||||
'packing.menuUncheckAll': 'Bỏ chọn tất cả',
|
||||
'packing.menuDeleteCat': 'Xóa danh sách',
|
||||
'packing.menuShareCat': 'Chia sẻ cho cả danh sách',
|
||||
'packing.shareCat.hint': 'Tất cả mục của bạn trong danh sách này sẽ chuyển sang mức bạn chọn.',
|
||||
'packing.shareCat.othersKept': 'Các mục người khác thêm vẫn giữ nguyên. Chỉ họ mới thay đổi được.',
|
||||
'packing.shareCat.noneOwn':
|
||||
'Mọi mục trong danh sách này đều do người khác thêm, nên chỉ họ mới thay đổi được cách chia sẻ.',
|
||||
'packing.shareCat.pickPeople': 'Chọn ít nhất một người để chia sẻ.',
|
||||
'packing.shareCat.apply': 'Áp dụng cho danh sách',
|
||||
'packing.shareCat.done': 'Đã đổi chia sẻ cho "{name}"',
|
||||
'packing.shareCat.doneOthersKept': 'Đã đổi chia sẻ cho "{name}". Các mục người khác thêm vẫn giữ nguyên.',
|
||||
'packing.noMembers': 'Không có thành viên',
|
||||
'packing.addItem': 'Thêm mục',
|
||||
'packing.addItemPlaceholder': 'Tên mặt hàng...',
|
||||
|
||||
@@ -50,6 +50,14 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': '全部勾選',
|
||||
'packing.menuUncheckAll': '取消全部勾選',
|
||||
'packing.menuDeleteCat': '刪除清單',
|
||||
'packing.menuShareCat': '整份清單的共用',
|
||||
'packing.shareCat.hint': '你在這份清單中的所有項目都會改為所選的共用方式。',
|
||||
'packing.shareCat.othersKept': '其他人新增的項目維持不變,只有他們能更改。',
|
||||
'packing.shareCat.noneOwn': '這份清單的所有項目都是其他人新增的,只有對方能更改共用方式。',
|
||||
'packing.shareCat.pickPeople': '請至少選擇一位共用對象。',
|
||||
'packing.shareCat.apply': '套用到清單',
|
||||
'packing.shareCat.done': '已變更「{name}」的共用方式',
|
||||
'packing.shareCat.doneOthersKept': '已變更「{name}」的共用方式。其他人新增的項目維持不變。',
|
||||
'packing.addItem': '新增物品',
|
||||
'packing.addItemPlaceholder': '物品名稱...',
|
||||
'packing.addCategory': '新增清單',
|
||||
|
||||
@@ -50,6 +50,14 @@ const packing: TranslationStrings = {
|
||||
'packing.menuCheckAll': '全部勾选',
|
||||
'packing.menuUncheckAll': '取消全部勾选',
|
||||
'packing.menuDeleteCat': '删除清单',
|
||||
'packing.menuShareCat': '整个清单的共享',
|
||||
'packing.shareCat.hint': '你在此清单中的所有物品都会改为所选的共享方式。',
|
||||
'packing.shareCat.othersKept': '其他人添加的物品保持不变,只有他们可以更改。',
|
||||
'packing.shareCat.noneOwn': '此清单中的所有物品都是其他人添加的,只有对方可以更改共享方式。',
|
||||
'packing.shareCat.pickPeople': '请至少选择一位共享对象。',
|
||||
'packing.shareCat.apply': '应用到清单',
|
||||
'packing.shareCat.done': '已更改“{name}”的共享方式',
|
||||
'packing.shareCat.doneOthersKept': '已更改“{name}”的共享方式。其他人添加的物品保持不变。',
|
||||
'packing.addItem': '添加物品',
|
||||
'packing.addItemPlaceholder': '物品名称...',
|
||||
'packing.addCategory': '添加清单',
|
||||
|
||||
Reference in New Issue
Block a user