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

Empty props.emailData #245

Open
JulienSellier opened this issue Aug 6, 2024 · 5 comments
Open

Empty props.emailData #245

JulienSellier opened this issue Aug 6, 2024 · 5 comments

Comments

@JulienSellier
Copy link

JulienSellier commented Aug 6, 2024

Hello,

Context: I try to code a custom zimlet and I have checked https://github.com/Zimbra/zm-zimlet-guide and all resources I could found about Zimlets for Zimbra 10.

Problem: My component get an empty array in props.emailData.

// src/index.js

import {createElement, Fragment} from 'preact';
import {provide} from 'preact-context-provider';
import classerEmail from "./components/classerEmail";

export default function Zimlet(context) {
  const {plugins} = context;

  const exports = {};

  exports.init = function init() {
    // The zimlet slots to load into, and what is being loaded into that slot
    plugins.register('slot::header-action-menu-item', provide(context)(classerEmail));
  };

  return exports;
}


// src/components/classerEmail/index.js

import {createElement} from 'preact';
import {withIntl} from "../../enhancers";
import {ActionButton, ModalDialog, TextInput} from '@zimbra-client/components';
import {compose} from 'recompose';

function classerEmail(props, context) {
  console.log(props.emailData); // Array [] length 0

  return (<div>test</div)
}
export default compose(withIntl())(classerEmail)

Can you help me ?

Other question : is there any documentation about Zimbra components listed there: https://github.com/cdubsodo/zm-x-web/tree/master/src/components ? It's hard to figure out how to use them...

Thanks

@miteshsavani810
Copy link
Collaborator

@JulienSellier When you select a mail/conversation in the list then you will get selected items data in the props.emailData

@JulienSellier
Copy link
Author

@miteshsavani810 Thanks for your answer, I managed to get them by deselecting the email then selecting it again but do you know why props.emailData is empty when is the email is pre-selected ? Is-it a bug ?

Other question, I can't deploy the Zimlet Sideloader because I get the error No package zimbra-zimlet-sideloader available

[root@zmpxy ~]# sudo yum install zimbra-zimlet-sideloader
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                                                                 | 5.1 kB  00:00:00
 * epel: mirrors.hostiserver.com
base                                                                                                                                 | 3.6 kB  00:00:00
extras                                                                                                                               | 2.9 kB  00:00:00
updates                                                                                                                              | 2.9 kB  00:00:00
zimbra                                                                                                                               | 3.0 kB  00:00:00
zimbra-8815-oss                                                                                                                      | 3.0 kB  00:00:00
zimbra-90-oss                                                                                                                        | 3.0 kB  00:00:00
No package zimbra-zimlet-sideloader available.
Error: Nothing to do

I tried to update and upgrade sources but it didn't worked.

Thanks!

@miteshsavani810
Copy link
Collaborator

@JulienSellier Yes, It is a bug, when you select 1 mail/conversation and reload the browser, the mail/conversation appears selected but you get the empty value in props.emailData.

Regarding unable to deploy the Zimlet Sideloader.
Can you please tell us what OS and Zimbra version you're using? You can share the output of zmcontrol -v (run this command by zimbra user.)

@JulienSellier
Copy link
Author

@miteshsavani810 Sure!

[root@zmpxy ~]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
[zimbra@zmpxy root]$ zmcontrol -v
Release 9.0.0_ZEXTRAS_20220713.RHEL7_64_20220705100521 RHEL7_64 FOSS edition.

@JulienSellier
Copy link
Author

Hello @miteshsavani810 , I managed to install the Zimlet Sideloader so this point is fixed.

Is there a way to fix the empty props.emailData ?

Other question: how can i retrieve user's authentication token in the zimlet? On Zimbra 9 we are using a .jsp file to write the value and make it accessible in the zimlet.

Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants