Skip to content

Commit 9138498

Browse files
author
Barry de Graaff
committed
support share as link in plain text compose mode
1 parent c45ea81 commit 9138498

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

package.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
npm install
44
zimlet build
5-
zimlet package -v 1.0.6 --zimbraXVersion ">=2.0.0" -n "zimbra-zimlet-nextcloud" --desc "Nextcloud integration for Zimbra" -l "Nextcloud Zimlet"
5+
zimlet package -v 1.0.7 --zimbraXVersion ">=2.0.0" -n "zimbra-zimlet-nextcloud" --desc "Nextcloud integration for Zimbra" -l "Nextcloud Zimlet"

src/components/nextcloud-attacher/index.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import RenderPropfind from '../render-propfind';
2323
attachAsLink: 'nextcloud-zimlet-modern.attachAsLink',
2424
shareLinkPassword: 'nextcloud-zimlet-modern.shareLinkPassword',
2525
expirationDate: 'nextcloud-zimlet-modern.expirationDate',
26+
plainTextShareLink: 'nextcloud-zimlet-modern.plainTextShareLink',
2627
})
2728
export default class NextcloudAttacher extends Component {
2829
constructor(props) {
@@ -85,7 +86,16 @@ export default class NextcloudAttacher extends Component {
8586
if (attachType == "attachAsLink") {
8687
let OCSResponse = JSON.parse(request.responseText);
8788
OCSResponse.text = getName(path);
88-
editor.insertLinksAtCaret([OCSResponse]);
89+
if(!editor.isPlainText())
90+
{
91+
editor.insertLinksAtCaret([OCSResponse]);
92+
}
93+
else
94+
{
95+
//https://github.com/ZimbraOS/zm-x-web/blob/1a6ae45704a6e189dd859a22ed802aac150c694d/src/components/composer/composer.js#L990
96+
//InsertAt... not supported in plain text compose mode
97+
window.prompt(this.props.plainTextShareLink,OCSResponse.url);
98+
}
8999
}
90100
else {
91101
// Blob and File are defined per window; We need compatibility with the parent Blob for attachments

src/intl/en_US.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"attachInline": "Attach inline",
1919
"attachAsLink" : "Attach as link",
2020
"shareLinkPassword": "Password for shared link",
21-
"expirationDate": "Expiration date for shared link"
22-
}
21+
"expirationDate": "Expiration date for shared link",
22+
"plainTextShareLink":"Copy and paste the share link to your email"
23+
}
2324
}
2425

0 commit comments

Comments
 (0)