Skip to content

Empty props.emailData #245

@JulienSellier

Description

@JulienSellier

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions