|
|
@@ -2975,13 +2975,13 @@ export default function AddressBookPage({ settings, auth, onAuthChange }: Props)
|
|
|
|
<Button type="button" title="Restore address list" aria-label="Restore address list" disabledReason={restoreListReason(selectedList)} onClick={() => void restoreDeletedList(selectedList)}><RotateCcw size={15} /></Button> :
|
|
|
|
<Button type="button" title="Restore address list" aria-label="Restore address list" disabledReason={restoreListReason(selectedList)} onClick={() => void restoreDeletedList(selectedList)}><RotateCcw size={15} /></Button> :
|
|
|
|
<>
|
|
|
|
<>
|
|
|
|
<Button type="button" title="Edit address list" aria-label="Edit address list" disabledReason={editListReason(selectedList)} onClick={() => openEditListDialog(selectedList)}><Edit3 size={15} /></Button>
|
|
|
|
<Button type="button" title="Edit address list" aria-label="Edit address list" disabledReason={editListReason(selectedList)} onClick={() => openEditListDialog(selectedList)}><Edit3 size={15} /></Button>
|
|
|
|
<Button type="button" variant="danger" title="Delete address list" aria-label="Delete address list" disabledReason={deleteListReason(selectedList)} onClick={() => setConfirmState({ kind: "list", list: selectedList })}><Trash2 size={15} /></Button>
|
|
|
|
<Button type="button" variant="danger" title="Delete address list" aria-label="Delete address list" helpContextId="addresses.action.archive" helpModuleId="addresses" disabledReason={deleteListReason(selectedList)} onClick={() => setConfirmState({ kind: "list", list: selectedList })}><Trash2 size={15} /></Button>
|
|
|
|
</> :
|
|
|
|
</> :
|
|
|
|
selectedBook?.deleted_at ?
|
|
|
|
selectedBook?.deleted_at ?
|
|
|
|
<Button type="button" title="Restore address book" aria-label="Restore address book" disabledReason={restoreBookReason(selectedBook)} onClick={() => void restoreBook(selectedBook)}><RotateCcw size={15} /></Button> :
|
|
|
|
<Button type="button" title="Restore address book" aria-label="Restore address book" disabledReason={restoreBookReason(selectedBook)} onClick={() => void restoreBook(selectedBook)}><RotateCcw size={15} /></Button> :
|
|
|
|
<>
|
|
|
|
<>
|
|
|
|
<Button type="button" title="Edit address book" aria-label="Edit address book" disabledReason={selectedBook ? editBookReason(selectedBook) : "Select an address book before editing."} onClick={() => selectedBook && openEditBookDialog(selectedBook)}><Edit3 size={15} /></Button>
|
|
|
|
<Button type="button" title="Edit address book" aria-label="Edit address book" disabledReason={selectedBook ? editBookReason(selectedBook) : "Select an address book before editing."} onClick={() => selectedBook && openEditBookDialog(selectedBook)}><Edit3 size={15} /></Button>
|
|
|
|
<Button type="button" variant="danger" title="Delete address book" aria-label="Delete address book" disabledReason={selectedBook ? deleteBookReason(selectedBook) : "Select an address book before deleting."} onClick={() => selectedBook && setConfirmState({ kind: "book", book: selectedBook })}><Trash2 size={15} /></Button>
|
|
|
|
<Button type="button" variant="danger" title="Delete address book" aria-label="Delete address book" helpContextId="addresses.action.archive" helpModuleId="addresses" disabledReason={selectedBook ? deleteBookReason(selectedBook) : "Select an address book before deleting."} onClick={() => selectedBook && setConfirmState({ kind: "book", book: selectedBook })}><Trash2 size={15} /></Button>
|
|
|
|
</>
|
|
|
|
</>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</>
|
|
|
|
</>
|
|
|
@@ -3050,7 +3050,7 @@ export default function AddressBookPage({ settings, auth, onAuthChange }: Props)
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
<Button type="button" title="Export contact vCard" aria-label="Export contact vCard" disabledReason={exportContactReason()} onClick={() => void exportOneContact(selectedContact)}><Download size={15} /> vCard</Button>
|
|
|
|
<Button type="button" title="Export contact vCard" aria-label="Export contact vCard" disabledReason={exportContactReason()} onClick={() => void exportOneContact(selectedContact)}><Download size={15} /> vCard</Button>
|
|
|
|
<Button type="button" title="Edit contact" aria-label="Edit contact" disabledReason={editContactReason()} onClick={() => openEditContactDialog(selectedContact)}><Edit3 size={15} /> Edit</Button>
|
|
|
|
<Button type="button" title="Edit contact" aria-label="Edit contact" disabledReason={editContactReason()} onClick={() => openEditContactDialog(selectedContact)}><Edit3 size={15} /> Edit</Button>
|
|
|
|
<Button type="button" variant="danger" title="Delete contact" aria-label="Delete contact" disabledReason={deleteContactReason()} onClick={() => setConfirmState({ kind: "contact", contact: selectedContact })}><Trash2 size={15} /> Delete</Button>
|
|
|
|
<Button type="button" variant="danger" title="Delete contact" aria-label="Delete contact" helpContextId="addresses.action.archive" helpModuleId="addresses" disabledReason={deleteContactReason()} onClick={() => setConfirmState({ kind: "contact", contact: selectedContact })}><Trash2 size={15} /> Delete</Button>
|
|
|
|
</>
|
|
|
|
</>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@@ -4196,7 +4196,7 @@ export default function AddressBookPage({ settings, auth, onAuthChange }: Props)
|
|
|
|
</FormField>
|
|
|
|
</FormField>
|
|
|
|
</FormGrid>
|
|
|
|
</FormGrid>
|
|
|
|
{cardDavForm.auth_type !== "none" &&
|
|
|
|
{cardDavForm.auth_type !== "none" &&
|
|
|
|
<FormField label="Reusable credential">
|
|
|
|
<FormField label="Reusable credential" helpContextId="addresses.sources" helpModuleId="addresses">
|
|
|
|
<select
|
|
|
|
<select
|
|
|
|
value={cardDavForm.credential_envelope_id}
|
|
|
|
value={cardDavForm.credential_envelope_id}
|
|
|
|
onChange={(event) => {
|
|
|
|
onChange={(event) => {
|
|
|
@@ -4227,15 +4227,15 @@ export default function AddressBookPage({ settings, auth, onAuthChange }: Props)
|
|
|
|
<input value={cardDavForm.username} onChange={(event) => setCardDavForm((current) => ({ ...current, username: event.target.value }))} disabled={Boolean(cardDavForm.credential_envelope_id)} />
|
|
|
|
<input value={cardDavForm.username} onChange={(event) => setCardDavForm((current) => ({ ...current, username: event.target.value }))} disabled={Boolean(cardDavForm.credential_envelope_id)} />
|
|
|
|
</FormField>
|
|
|
|
</FormField>
|
|
|
|
{!cardDavForm.credential_envelope_id &&
|
|
|
|
{!cardDavForm.credential_envelope_id &&
|
|
|
|
<FormField label="Password">
|
|
|
|
<FormField label="Password" helpContextId="addresses.sources" helpModuleId="addresses">
|
|
|
|
<PasswordField value={cardDavForm.password} onValueChange={(value) => setCardDavForm((current) => ({ ...current, password: value }))} autoComplete="new-password" />
|
|
|
|
<PasswordField helpContextId="addresses.sources" helpModuleId="addresses" value={cardDavForm.password} onValueChange={(value) => setCardDavForm((current) => ({ ...current, password: value }))} autoComplete="new-password" />
|
|
|
|
</FormField>
|
|
|
|
</FormField>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</FormGrid>
|
|
|
|
</FormGrid>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{cardDavForm.auth_type === "bearer" && !cardDavForm.credential_envelope_id &&
|
|
|
|
{cardDavForm.auth_type === "bearer" && !cardDavForm.credential_envelope_id &&
|
|
|
|
<FormField label="Bearer token">
|
|
|
|
<FormField label="Bearer token" helpContextId="addresses.sources" helpModuleId="addresses">
|
|
|
|
<PasswordField value={cardDavForm.bearer_token} onValueChange={(value) => setCardDavForm((current) => ({ ...current, bearer_token: value }))} autoComplete="new-password" />
|
|
|
|
<PasswordField helpContextId="addresses.sources" helpModuleId="addresses" value={cardDavForm.bearer_token} onValueChange={(value) => setCardDavForm((current) => ({ ...current, bearer_token: value }))} autoComplete="new-password" />
|
|
|
|
</FormField>
|
|
|
|
</FormField>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{cardDavDiscovery.length > 0 &&
|
|
|
|
{cardDavDiscovery.length > 0 &&
|
|
|
@@ -4277,7 +4277,7 @@ export default function AddressBookPage({ settings, auth, onAuthChange }: Props)
|
|
|
|
<FormField label="Display name">
|
|
|
|
<FormField label="Display name">
|
|
|
|
<input value={ldapForm.display_name} onChange={(event) => setLdapForm((current) => ({ ...current, display_name: event.target.value }))} placeholder="Corporate directory" />
|
|
|
|
<input value={ldapForm.display_name} onChange={(event) => setLdapForm((current) => ({ ...current, display_name: event.target.value }))} placeholder="Corporate directory" />
|
|
|
|
</FormField>
|
|
|
|
</FormField>
|
|
|
|
<FormField label="Reusable credential">
|
|
|
|
<FormField label="Reusable credential" helpContextId="addresses.sources" helpModuleId="addresses">
|
|
|
|
<select
|
|
|
|
<select
|
|
|
|
value={ldapForm.credential_envelope_id}
|
|
|
|
value={ldapForm.credential_envelope_id}
|
|
|
|
onChange={(event) => {
|
|
|
|
onChange={(event) => {
|
|
|
|