add placeholder for chats in file transfer
This commit is contained in:
@@ -53,9 +53,9 @@ function OptionEntry(
|
||||
fileTransferViewModel.selectedPaths.remove(fileOption.path);
|
||||
}
|
||||
});
|
||||
fileTransferViewModel.allOptionsSelected.subscribe(allSelected => {
|
||||
isSelected.value = allSelected;
|
||||
})
|
||||
fileTransferViewModel.allOptionsSelected.subscribe((allSelected) => {
|
||||
isSelected.value = allSelected;
|
||||
});
|
||||
function toggle() {
|
||||
isSelected.value = !isSelected.value;
|
||||
}
|
||||
@@ -72,6 +72,69 @@ function OptionEntry(
|
||||
);
|
||||
}
|
||||
|
||||
function FileSelectionDetail(
|
||||
coreViewModel: CoreViewModel,
|
||||
fileTransferViewModel: FileTransferViewModel,
|
||||
) {
|
||||
const OptionConverter: React.StateItemConverter<FileTransferOption> = (
|
||||
fileOption: FileTransferOption,
|
||||
) => {
|
||||
return OptionEntry(fileOption, fileTransferViewModel);
|
||||
};
|
||||
|
||||
const chatList = React.createProxyState(
|
||||
[fileTransferViewModel.chatFileOptions],
|
||||
() =>
|
||||
fileTransferViewModel.chatFileOptions.value.size == 0 ? (
|
||||
<span class="secondary">
|
||||
{
|
||||
coreViewModel.translations.dataTransferModal
|
||||
.noChatsPlaceholder
|
||||
}
|
||||
</span>
|
||||
) : (
|
||||
<div
|
||||
class="flex-column gap"
|
||||
children:append={[
|
||||
fileTransferViewModel.chatFileOptions,
|
||||
OptionConverter,
|
||||
]}
|
||||
></div>
|
||||
),
|
||||
);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h3>
|
||||
{coreViewModel.translations.dataTransferModal.generalHeadline}
|
||||
</h3>
|
||||
<div
|
||||
class="flex-column gap content-margin-bottom"
|
||||
children:append={[
|
||||
fileTransferViewModel.generalFileOptions,
|
||||
OptionConverter,
|
||||
]}
|
||||
></div>
|
||||
|
||||
<hr></hr>
|
||||
|
||||
<h3>
|
||||
{coreViewModel.translations.dataTransferModal.chatsHeadline}
|
||||
</h3>
|
||||
<div children:set={chatList}></div>
|
||||
<hr></hr>
|
||||
|
||||
<label class="inline">
|
||||
<input
|
||||
type="checkbox"
|
||||
bind:checked={fileTransferViewModel.allOptionsSelected}
|
||||
></input>
|
||||
{coreViewModel.translations.general.selectAllLabel}
|
||||
</label>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// MODALS
|
||||
function DirectionSelectionModal(
|
||||
coreViewModel: CoreViewModel,
|
||||
@@ -193,12 +256,6 @@ function FileSelectionModal(
|
||||
coreViewModel: CoreViewModel,
|
||||
fileTransferViewModel: FileTransferViewModel,
|
||||
) {
|
||||
const OptionConverter: React.StateItemConverter<FileTransferOption> = (
|
||||
fileOption: FileTransferOption,
|
||||
) => {
|
||||
return OptionEntry(fileOption, fileTransferViewModel);
|
||||
};
|
||||
|
||||
// state
|
||||
const isPresented = React.createProxyState(
|
||||
[fileTransferViewModel.presentedModal],
|
||||
@@ -226,40 +283,7 @@ function FileSelectionModal(
|
||||
|
||||
<hr></hr>
|
||||
|
||||
<h3>
|
||||
{
|
||||
coreViewModel.translations.dataTransferModal
|
||||
.generalHeadline
|
||||
}
|
||||
</h3>
|
||||
<div
|
||||
class="flex-column gap content-margin-bottom"
|
||||
children:append={[
|
||||
fileTransferViewModel.generalFileOptions,
|
||||
OptionConverter,
|
||||
]}
|
||||
></div>
|
||||
|
||||
<h3>
|
||||
{
|
||||
coreViewModel.translations.dataTransferModal
|
||||
.chatsHeadline
|
||||
}
|
||||
</h3>
|
||||
<div
|
||||
class="flex-column gap"
|
||||
children:append={[
|
||||
fileTransferViewModel.chatFileOptions,
|
||||
OptionConverter,
|
||||
]}
|
||||
></div>
|
||||
|
||||
<hr></hr>
|
||||
|
||||
<label class="inline">
|
||||
<input type="checkbox" bind:checked={fileTransferViewModel.allOptionsSelected}></input>
|
||||
{coreViewModel.translations.general.selectAllLabel}
|
||||
</label>
|
||||
{FileSelectionDetail(coreViewModel, fileTransferViewModel)}
|
||||
</main>
|
||||
<div class="flex-row width-100">
|
||||
<button
|
||||
@@ -688,40 +712,7 @@ function ExportFileSelectionModal(
|
||||
|
||||
<hr></hr>
|
||||
|
||||
<h3>
|
||||
{
|
||||
coreViewModel.translations.dataTransferModal
|
||||
.generalHeadline
|
||||
}
|
||||
</h3>
|
||||
<div
|
||||
class="flex-column gap content-margin-bottom"
|
||||
children:append={[
|
||||
fileTransferViewModel.generalFileOptions,
|
||||
OptionConverter,
|
||||
]}
|
||||
></div>
|
||||
|
||||
<h3>
|
||||
{
|
||||
coreViewModel.translations.dataTransferModal
|
||||
.chatsHeadline
|
||||
}
|
||||
</h3>
|
||||
<div
|
||||
class="flex-column gap"
|
||||
children:append={[
|
||||
fileTransferViewModel.chatFileOptions,
|
||||
OptionConverter,
|
||||
]}
|
||||
></div>
|
||||
|
||||
<hr></hr>
|
||||
|
||||
<label class="inline">
|
||||
<input type="checkbox" bind:checked={fileTransferViewModel.allOptionsSelected}></input>
|
||||
{coreViewModel.translations.general.selectAllLabel}
|
||||
</label>
|
||||
{FileSelectionDetail(coreViewModel, fileTransferViewModel)}
|
||||
</main>
|
||||
<div class="flex-row width-100">
|
||||
<button
|
||||
|
||||
@@ -22,7 +22,7 @@ const englishTranslations = {
|
||||
saveButton: "Save",
|
||||
setButton: "Set",
|
||||
|
||||
selectAllLabel: "Select all",
|
||||
selectAllLabel: "Select all",
|
||||
|
||||
filterOrCreateLabel: (type: string) => `Search or create ${type}`,
|
||||
createLabel: (query: string) => `Create "${query}"`,
|
||||
@@ -172,6 +172,7 @@ const englishTranslations = {
|
||||
settingsData: "Identity & personal data",
|
||||
|
||||
chatsHeadline: "Chats",
|
||||
noChatsPlaceholder: "No chats",
|
||||
|
||||
///
|
||||
|
||||
@@ -403,8 +404,8 @@ export const allTranslations: {
|
||||
refreshButton: "Aktualisieren",
|
||||
saveButton: "Speichern",
|
||||
setButton: "OK",
|
||||
|
||||
selectAllLabel: "Alle auswählen",
|
||||
|
||||
selectAllLabel: "Alle auswählen",
|
||||
|
||||
filterOrCreateLabel: (type: string) =>
|
||||
`${type} suchen oder erstellen`,
|
||||
@@ -548,6 +549,7 @@ export const allTranslations: {
|
||||
settingsData: "Identität und persönliche Daten",
|
||||
|
||||
chatsHeadline: "Chats",
|
||||
noChatsPlaceholder: "Keine Chats",
|
||||
|
||||
transferChannelHeadline: "Übertragungskanal",
|
||||
transferKeyHeadline: "Schlüssel",
|
||||
@@ -750,8 +752,8 @@ export const allTranslations: {
|
||||
refreshButton: "Actualizar",
|
||||
saveButton: "Guardar",
|
||||
setButton: "OK",
|
||||
|
||||
selectAllLabel: "Seleccionar todos",
|
||||
|
||||
selectAllLabel: "Seleccionar todos",
|
||||
|
||||
filterOrCreateLabel: (type: string) => `Buscar o crear ${type}`,
|
||||
createLabel: (query: string) => `Crear "${query}"`,
|
||||
@@ -894,6 +896,7 @@ export const allTranslations: {
|
||||
settingsData: "Identidad y datos personales",
|
||||
|
||||
chatsHeadline: "Chats",
|
||||
noChatsPlaceholder: "No hay chats",
|
||||
|
||||
transferChannelHeadline: "Canal de Transferencia",
|
||||
transferKeyHeadline: "Clave de encriptación de transferencia",
|
||||
|
||||
Reference in New Issue
Block a user