This commit is contained in:
the-djmaze 2024-02-12 02:13:39 +01:00
parent 355f6158be
commit 8ab32816e2
6 changed files with 50 additions and 25 deletions

View file

@ -17,6 +17,7 @@ export class IdentityModel extends AbstractModel {
replyTo: '', replyTo: '',
bcc: '', bcc: '',
sentFolder: '',
signature: '', signature: '',
signatureInsertBefore: false, signatureInsertBefore: false,

View file

@ -3,7 +3,7 @@
max-width: 770px; max-width: 770px;
.tab-content { .tab-content {
grid-column-end: 4; grid-column-end: 5;
padding-top: 20px; padding-top: 20px;
} }

View file

@ -457,7 +457,7 @@ export class ComposePopupView extends AbstractViewPopup {
} }
sendCommand() { sendCommand() {
let sSentFolder = FolderUserStore.sentFolder(); let sSentFolder = this.currentIdentity()?.sentFolder || FolderUserStore.sentFolder();
this.attachmentsInProcessError(false); this.attachmentsInProcessError(false);
this.attachmentsInErrorError(false); this.attachmentsInErrorError(false);

View file

@ -1,5 +1,5 @@
import { addObservablesTo } from 'External/ko'; import { addObservablesTo, koComputable } from 'External/ko';
import { getNotification } from 'Common/Translator'; import { getNotification } from 'Common/Translator';
import { loadAccountsAndIdentities } from 'Common/UtilsUser'; import { loadAccountsAndIdentities } from 'Common/UtilsUser';
@ -10,6 +10,10 @@ import { AbstractViewPopup } from 'Knoin/AbstractViews';
import { IdentityModel } from 'Model/Identity'; import { IdentityModel } from 'Model/Identity';
import { folderListOptionsBuilder } from 'Common/Folders';
import { i18n } from 'Common/Translator';
import { defaultOptionsAfterRender } from 'Common/Utils';
export class IdentityPopupView extends AbstractViewPopup { export class IdentityPopupView extends AbstractViewPopup {
constructor() { constructor() {
super('Identity'); super('Identity');
@ -27,6 +31,13 @@ export class IdentityPopupView extends AbstractViewPopup {
this.replyTo.valueHasMutated(); this.replyTo.valueHasMutated();
this.bcc.valueHasMutated(); this.bcc.valueHasMutated();
*/ */
this.folderSelectList = koComputable(() =>
folderListOptionsBuilder(
[],
[['', '('+i18n('GLOBAL/DEFAULT')+')']]
)
);
this.defaultOptionsAfterRender = defaultOptionsAfterRender;
} }
submitForm(form) { submitForm(form) {

View file

@ -20,6 +20,8 @@ class Identity implements \JsonSerializable
private string $sSignature = ''; private string $sSignature = '';
private string $sSentFolder = '';
private bool $bSignatureInsertBefore = false; private bool $bSignatureInsertBefore = false;
private bool $bPgpEncrypt = false; private bool $bPgpEncrypt = false;
@ -92,8 +94,9 @@ class Identity implements \JsonSerializable
$this->sBcc = !empty($aData['Bcc']) ? $aData['Bcc'] : ''; $this->sBcc = !empty($aData['Bcc']) ? $aData['Bcc'] : '';
$this->sSignature = !empty($aData['Signature']) ? $aData['Signature'] : ''; $this->sSignature = !empty($aData['Signature']) ? $aData['Signature'] : '';
$this->bSignatureInsertBefore = !empty($aData['SignatureInsertBefore']); $this->bSignatureInsertBefore = !empty($aData['SignatureInsertBefore']);
$this->bPgpEncrypt = !empty($aData['PgpEncrypt']); $this->sSentFolder = isset($aData['sentFolder']) ? $aData['sentFolder'] : '';
$this->bPgpSign = !empty($aData['PgpSign']); $this->bPgpEncrypt = !empty($aData['pgpEncrypt']);
$this->bPgpSign = !empty($aData['pgpSign']);
return true; return true;
} }
@ -112,8 +115,9 @@ class Identity implements \JsonSerializable
'Bcc' => $this->sBcc, 'Bcc' => $this->sBcc,
'Signature' => $this->sSignature, 'Signature' => $this->sSignature,
'SignatureInsertBefore' => $this->bSignatureInsertBefore, 'SignatureInsertBefore' => $this->bSignatureInsertBefore,
'PgpEncrypt' => $this->bPgpEncrypt, 'sentFolder' => $this->sSentFolder,
'PgpSign' => $this->bPgpSign 'pgpEncrypt' => $this->bPgpEncrypt,
'pgpSign' => $this->bPgpSign
); );
} }
@ -130,6 +134,7 @@ class Identity implements \JsonSerializable
'bcc' => $this->sBcc, 'bcc' => $this->sBcc,
'signature' => $this->sSignature, 'signature' => $this->sSignature,
'signatureInsertBefore' => $this->bSignatureInsertBefore, 'signatureInsertBefore' => $this->bSignatureInsertBefore,
'sentFolder' => $this->sSentFolder,
'pgpEncrypt' => $this->bPgpEncrypt, 'pgpEncrypt' => $this->bPgpEncrypt,
'pgpSign' => $this->bPgpSign 'pgpSign' => $this->bPgpSign
); );

View file

@ -52,29 +52,15 @@
}"></div> }"></div>
</div> </div>
<input type="radio" name="identitytabs" id="tab-identity-advanced"> <input type="radio" name="identitytabs" id="tab-identity-crypto">
<label data-i18n="SETTINGS_FILTERS/ADVANCED" for="tab-identity-advanced" role="tab" aria-selected="false" aria-controls="panel3" tabindex="0"></label> <label data-i18n="CONTACTS/TAB_CRYPTO" for="tab-identity-crypto" role="tab" aria-selected="false" aria-controls="panel3" tabindex="0"></label>
<div class="form-horizontal tab-content" role="tabpanel" aria-hidden="false"> <div class="form-horizontal tab-content" role="tabpanel" aria-hidden="false">
<div class="control-group">
<label data-i18n="GLOBAL/REPLY_TO"></label>
<input name="ReplyTo" type="email" class="inputReplyTo input-xlarge"
autocomplete="off" autocorrect="off" autocapitalize="off"
data-bind="value: replyTo">
</div>
<div class="control-group">
<label data-i18n="GLOBAL/BCC"></label>
<input name="Bcc" type="email" class="inputBcc input-xlarge"
autocomplete="off" autocorrect="off" autocapitalize="off"
data-bind="value: bcc">
</div>
<div class="legend" data-i18n="CONTACTS/TAB_CRYPTO"></div>
<div data-bind="component: { <div data-bind="component: {
name: 'Checkbox', name: 'Checkbox',
params: { params: {
label: 'OPENPGP/LABEL_SIGN', label: 'OPENPGP/LABEL_SIGN',
value: pgpSign, value: pgpSign,
name: 'PgpSign' name: 'pgpSign'
} }
}"></div> }"></div>
<div data-bind="component: { <div data-bind="component: {
@ -82,7 +68,7 @@
params: { params: {
label: 'OPENPGP/LABEL_ENCRYPT', label: 'OPENPGP/LABEL_ENCRYPT',
value: pgpEncrypt, value: pgpEncrypt,
name: 'PgpEncrypt' name: 'pgpEncrypt'
} }
}"></div> }"></div>
<!-- <!--
@ -97,6 +83,28 @@
</div> </div>
--> -->
</div> </div>
<input type="radio" name="identitytabs" id="tab-identity-advanced">
<label data-i18n="SETTINGS_FILTERS/ADVANCED" for="tab-identity-advanced" role="tab" aria-selected="false" aria-controls="panel4" tabindex="0"></label>
<div class="form-horizontal tab-content" role="tabpanel" aria-hidden="false">
<div class="control-group">
<label data-i18n="GLOBAL/REPLY_TO"></label>
<input name="ReplyTo" type="email" class="inputReplyTo input-xlarge"
autocomplete="off" autocorrect="off" autocapitalize="off"
data-bind="value: replyTo">
</div>
<div class="control-group">
<label data-i18n="GLOBAL/BCC"></label>
<input name="Bcc" type="email" class="inputBcc input-xlarge"
autocomplete="off" autocorrect="off" autocapitalize="off"
data-bind="value: bcc">
</div>
<div class="control-group">
<label data-i18n="FOLDER_LIST/SENT_NAME"></label>
<select name="sentFolder" data-bind="options: $root.folderSelectList, value: sentFolder,
optionsText: 'name', optionsValue: 'id', optionsAfterRender: $root.defaultOptionsAfterRender"></select>
</div>
</div>
</div> </div>
</form> </form>
<footer> <footer>