Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(move-mail): #MZI-192 fix move mail from parent to a sub folder #104

Merged
merged 1 commit into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion zimbra/src/main/resources/public/sass/global/_conversation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/

.zimbra {
.zimbra-module {

.disabled-link{
pointer-events: none;
cursor: default;
opacity: 0.5;
}

.info {
margin-top: 55px;
}
Expand Down Expand Up @@ -388,4 +395,5 @@
display: list-item !important;
font-size: 13px !important;
}

}
28 changes: 13 additions & 15 deletions zimbra/src/main/resources/public/template/move-mail.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,22 @@

<!-- Folders - move popup templates -->

<script type="text/ng-template" id="move-folders-content">

<a ng-click="destination.folder = folder; moveToFolderClick(folder, obj); folder.selected = !folder.selected"
ng-init="obj = { template: '' }"
ng-class="{ selected: destination.folder.id === folder.id, opened: isOpenedFolder(folder) }"
class="folder-list-item">
<script type="text/ng-template" id="move-folders-content">
<a ng-click="destination.folder = folder; moveToFolderClick(folder, obj); folder.selected = !folder.selected"
ng-init="obj = { template: '' }; showSubFolderIfCurrent(folder, obj);"
ng-class="{ selected: destination.folder.id === folder.id, opened: isOpenedFolder(folder), 'disabled-link': folder.id === zimbra.currentFolder.id, opened: folder.id === zimbra.currentFolder.id}"
class="folder-list-item">
<i class="arrow" ng-if="folder.userFolders.all.length"></i>
<span ng-if="!folders.list.includes(folder)">[[folder.name]]</span>
<span ng-if="folders.list.includes(folder)">[[lang.translate(folder.folderName)]]</span>

</a>
<ul ng-class="{ selected: destination.folder.id === folder.id, closed: isClosedFolder(folder) }"
ng-if="isOpenedFolder(folder)">
</a>
<ul ng-class="{ selected: destination.folder.id === folder.id, closed: isClosedFolder(folder) && folder.id !== zimbra.currentFolder.id }"
ng-if="isOpenedFolder(folder) || folder.id === zimbra.currentFolder.id">
<li data-ng-repeat="folder in folder.userFolders.all | orderBy : 'name'"
data-ng-include="obj.template">
</li>
</ul>
</script>
data-ng-include="obj.template">
</li>
</ul>
</script>
<script type="text/ng-template" id="move-folders-root">
<div ng-if="(!folders.list.includes(zimbra.currentFolder) || zimbra.currentFolder.folderName === 'trash' || zimbra.currentFolder.folderName === 'spams')">
<h3><i18n>messages</i18n></h3>
Expand All @@ -45,7 +43,7 @@ <h3><i18n>messages</i18n></h3>

<h3><i18n>user.folders</i18n></h3>
<ul>
<li ng-repeat="folder in userFolders.all" ng-include="'move-folders-content'" ng-if="zimbra.currentFolder.id != folder.id"></li>
<li ng-repeat="folder in userFolders.all" ng-include="'move-folders-content'"></li>
</ul>
</script>

Expand Down
6 changes: 6 additions & 0 deletions zimbra/src/main/resources/public/ts/controllers/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,12 @@ export let zimbraController = ng.controller("ZimbraController", [
}, 10);
};

$scope.showSubFolderIfCurrent = (folder: UserFolder, obj: { template: string }) => {
if(folder.id == Zimbra.instance.currentFolder.id) {
$scope.moveToFolderClick(folder, obj)
}
}

$scope.recallMail = async (id: string, comment: string) => {
$scope.lightbox.show = false;
template.close("lightbox");
Expand Down
2 changes: 1 addition & 1 deletion zimbra/src/main/resources/public/ts/model/folder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export class Draft extends SystemFolder {
get: `/zimbra/list?folder=${encodeURIComponent(path)}`
});

this.folderName = "draft";
this.folderName = "drafts";
this.nbUnread = unread;
this.count = count;
this.folders = folders;
Expand Down
4 changes: 2 additions & 2 deletions zimbra/src/main/resources/public/ts/model/mail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ export class Mail implements Selectable {
this.attachments = this.attachments.concat(attachmentWaiting);
this.newAttachments = null;
})
.catch((e: AxiosError) => {
.catch((e: AxiosError<any>) => {
// remove attachment
this.attachments = this.attachments.filter((attachment: Attachment) => {
return attachment.filename !== attachmentToUpload.filename || attachment.id;
Expand All @@ -532,7 +532,7 @@ export class Mail implements Selectable {
.then(() => {
notify.info("zimbra.attachment.download.workspace.success");
})
.catch((e : AxiosError) => {
.catch((e : AxiosError<any>) => {
sendNotificationErrorZimbra(e.response.data.error);
});
}
Expand Down
2 changes: 1 addition & 1 deletion zimbra/src/main/resources/view-src/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<script src="/assets/js/entcore/ng-app.js?v=@@VERSION" type="text/javascript" id="context"></script>
<link rel="stylesheet" href="/zimbra/public/css/conversation.css?v=@@VERSION">
</head>
<body class="zimbra">
<body class="zimbra-module">
<portal>
<div class="emptyscreen">
<h2 class="empty-screen-header">{{#i18n}}zimbra.view.error.title{{/i18n}}</h2>
Expand Down
2 changes: 1 addition & 1 deletion zimbra/src/main/resources/view-src/print.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<style> header {display : none}</style>
<link rel="stylesheet" href="/zimbra/public/css/conversation.css?v=@@VERSION">
</head>
<body ng-controller="PrintController" class="zimbra">
<body ng-controller="PrintController" class="zimbra-module">
<portal>
<div class="twelve cell line">
<div class="row">
Expand Down
2 changes: 1 addition & 1 deletion zimbra/src/main/resources/view-src/zimbra.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<script src="/zimbra/public/dist/application.js?v=@@VERSION" type="text/javascript"></script>
<link rel="stylesheet" href="/zimbra/public/css/conversation.css?v=@@VERSION">
</head>
<body ng-controller="ZimbraController" class="zimbra">
<body ng-controller="ZimbraController" class="zimbra-module">
<portal>
<div ng-class="{info: quotaMessage.percent < 100, warning: quotaMessage.percent >= 100}" ng-init="initQuotaMessage()" ng-show="quotaMessage.active">
<span ng-if="quotaMessage.percent < 100"><i18n>zimbra.quota.info.message</i18n></span>
Expand Down