Expand my Community achievements bar.

SOLVED

want to add extra tab when user click on open from inbox - AEM workflow

Avatar

Level 3

Hi All,

 when user goes to the inbox and sees the task assigned and click on open 

Screenshot 2023-03-28 at 6.05.52 PM.png

i wanted to add extra tab in workitem.

Screenshot 2023-03-28 at 6.18.46 PM.png

 

can someone guide me how to customise the work item .

 

thanks,

Durga Kavali.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @kavalidurga,

In general structure/definition of  WorkItem view is stored under /libs/cq/inbox/content/inbox/details/workitem. If you will look into crx you can observe that part is marked as granite:InternalArea which means you should not overlay this part.

crx-libs.jpg

Apart of that, technically this is still possible, by creating proper structure under /apps and adding additional node that will define custom tab.

crx-apps.jpg

XML version of the structure:

<cq jcr:primaryType="sling:Folder">
    <inbox jcr:primaryType="nt:folder">
        <content jcr:primaryType="nt:folder">
            <inbox jcr:primaryType="cq:Page">
                <details jcr:primaryType="sling:Folder">
                    <workitem jcr:primaryType="cq:Page">
                        <jcr:content jcr:primaryType="nt:unstructured">
                            <content jcr:primaryType="nt:unstructured">
                                <items jcr:primaryType="nt:unstructured">
                                    <tabs jcr:primaryType="nt:unstructured">
                                        <items jcr:primaryType="nt:unstructured">
                                            <custom jcr:primaryType="nt:unstructured"
                                                granite:class="content-container
                                                taskdetails-tab comment-tab"
                                                isCommentTab="true"
                                                jcr:title="CUSTOM"
                                                sling:resourceType="granite/ui/components/coral/foundation/container">
                                                <items jcr:primaryType="nt:unstructured">
                                                    <textField1 jcr:primaryType="nt:unstructured"
                                                        fieldLabel="Custom filed" name="customField"
                                                        sling:resourceType="granite/ui/components/coral/foundation/form/textfield"/>
                                                    <textField2 jcr:primaryType="nt:unstructured"
                                                        fieldLabel="Custom filed read only"
                                                        granite:rel="cq-inbox-info--read-only"
                                                        name="customField2"
                                                        sling:resourceType="granite/ui/components/coral/foundation/form/textfield"/>
                                                </items>
                                            </custom>
                                        </items>
                                    </tabs>
                                </items>
                            </content>
                        </jcr:content>
                    </workitem>
                </details>
            </inbox>
        </content>
    </inbox>
</cq>

Final result looks like that:

work-item.jpg

Summarizing, you will have to decide on your own if you will follow this approach. I think this section by design should not be modified, but as it has been presented on above example it can be done fairly simple.

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @kavalidurga,

In general structure/definition of  WorkItem view is stored under /libs/cq/inbox/content/inbox/details/workitem. If you will look into crx you can observe that part is marked as granite:InternalArea which means you should not overlay this part.

crx-libs.jpg

Apart of that, technically this is still possible, by creating proper structure under /apps and adding additional node that will define custom tab.

crx-apps.jpg

XML version of the structure:

<cq jcr:primaryType="sling:Folder">
    <inbox jcr:primaryType="nt:folder">
        <content jcr:primaryType="nt:folder">
            <inbox jcr:primaryType="cq:Page">
                <details jcr:primaryType="sling:Folder">
                    <workitem jcr:primaryType="cq:Page">
                        <jcr:content jcr:primaryType="nt:unstructured">
                            <content jcr:primaryType="nt:unstructured">
                                <items jcr:primaryType="nt:unstructured">
                                    <tabs jcr:primaryType="nt:unstructured">
                                        <items jcr:primaryType="nt:unstructured">
                                            <custom jcr:primaryType="nt:unstructured"
                                                granite:class="content-container
                                                taskdetails-tab comment-tab"
                                                isCommentTab="true"
                                                jcr:title="CUSTOM"
                                                sling:resourceType="granite/ui/components/coral/foundation/container">
                                                <items jcr:primaryType="nt:unstructured">
                                                    <textField1 jcr:primaryType="nt:unstructured"
                                                        fieldLabel="Custom filed" name="customField"
                                                        sling:resourceType="granite/ui/components/coral/foundation/form/textfield"/>
                                                    <textField2 jcr:primaryType="nt:unstructured"
                                                        fieldLabel="Custom filed read only"
                                                        granite:rel="cq-inbox-info--read-only"
                                                        name="customField2"
                                                        sling:resourceType="granite/ui/components/coral/foundation/form/textfield"/>
                                                </items>
                                            </custom>
                                        </items>
                                    </tabs>
                                </items>
                            </content>
                        </jcr:content>
                    </workitem>
                </details>
            </inbox>
        </content>
    </inbox>
</cq>

Final result looks like that:

work-item.jpg

Summarizing, you will have to decide on your own if you will follow this approach. I think this section by design should not be modified, but as it has been presented on above example it can be done fairly simple.