How customize EditCustomfieldDefaults screen in my customfield plugin - jira-plugin

I'm trying to override the default customfield value setting screen, but I'm unable to add the template.
The standard edit.vm template allows you to change the value of the field in the issue, but I need a separate page for this
enter image description here
My code from atlassian-plugin.xml
`
<customfield-type
name="Metro Cascading Custom Field"
i18n-name-key="metro-cascading-custom-field.name"
key="metro-cascading-custom-field"
class="MetroCascadingCustomField.MetroCascadingCustomField">
<description
key="metro-cascading-custom-field.description">The Metro Cascading Custom Field Plugin</description>
<resource name="view" type="velocity" location="/templates/customfields/metro-cascading-custom-field/view.vm"/>
<resource name="edit" type="velocity" location="/templates/customfields/metro-cascading-custom-field/edit.vm"/>
</customfield-type>
<webwork1
key="metro-cascading-cuastomfield-webwork"
name="Metro Cascading Cuastomfield Webwork"
i18n-name-key="metro-cascading-cuastomfield-webwork.name">
<description key="metro-cascading-cuastomfield-webwork.description">The Metro Cascading Cuastomfield Webwork Plugin</description>
<actions>
<action name="ru.jira.metro.plugin.jira.webwork.MetroCascadingCuastomfieldWebworkAction" alias="CustomMultiSelectOptionsConfiguration">>
<view name="success">/templates/metro-cascading-cuastomfield-webwork/success.vm</view>
<view name="input">/templates/metro-cascading-cuastomfield-webwork/input.vm</view>
<view name="error">/templates/metro-cascading-cuastomfield-webwork/error.vm</view>
</action>
</actions>
<context>atl.admin.custom-fields</context>
</webwork1>
`

Related

React admin custom component inside simpleform

Hello stackoverflow so I have a custom components inside of my create simpleform looking like this.
<Create {...props}>
<SimpleForm {...props}>
<TextField id="standard-basic" onChange={onChangeLabel} value={entityLabel} placeholder="Audience label" />
<br />
<EntityInput onSelectEntity={addEntity} entityNames={entityNames} />
<TagInput setSelectedTags={addSelectedTag} selectedTags={selectedTags} />
<br />
</SimpleForm>
</Create>
My question is how do I enable the save button and pass in custom data and tell the save button which records to create?

<render-mode> not working with dynamic Material UI

I use the <render-mode> tag to include some html in my screen:
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/xml-screen-2.1.xsd"
require-authentication="anonymous-all">
<widgets>
<label type="h1" text="Hello world!"/>
<render-mode>
<text type="html,vuet" location="component://tutorial/template/hello.html"/>
</render-mode>
<label type="h1" text="after Hello world!"/>
</widgets>
</screen>
The incuded hello.html file is shown fine using the "standard UI" or "dynamic Bootstrap UI", but it doesn't show when using the "dynamic Material UI".
Is there a way to enable this? I much prefer the look and navigation of the dynamic Material UI.
Thank you!
The reason it doesn't show under qapps is that qapps uses a new render mode 'qvt' just like vapps uses the render mode 'vuet'. To make it show under /qapps just change:
<text type="html,vuet" ...
to:
<text type="html,vuet,qvt" ...

Get data from a custom endpoint in react-admin

I'm using react-admin with data that I get from a restAPI data source that I can customize for my needs, I've added a standard resource with only a list and an edit attributes:
<Resource name="topic" edit={TopicsEdit} list={TopicsList} />
When I look at the network tab of Chrome dev tools I see that I use the right endpoints:
For the list:
GET request for http://api.loc/topic
And for the edit:
GET request for http://api.loc/topic/{{topic_id}}
Up to this point everything works just fine.
My problem starts when I try to have the edit screen split into two tabs, one of them will be for editing the topic (This works just fine), and the other tab should use data from a different endpoint:
http://api.loc/topic/{{topic_id}}/modifiers
The code for my TopicsEdit file:
<Show {...props}>
<TabbedShowLayout>
<Tab label='topic'>
<Edit {...props}>
<SimpleForm>
<TextInput source="id"/>
<TextInput source="title"/>
</SimpleForm>
</Edit>
</Tab>
<Tab label='modifiers' path='modifiers'>
<List {...props}>
<Datagrid>
<TextField source="id"/>
<TextField source="name"/>
</Datagrid>
</List>
</Tab>
</TabbedShowLayout>
</Show>
In the topic tab everything is working as I mentioned before, but when I switch to the modifiers tab I see in the network dev tool that the data arrives from
http://api.loc/topic
instead of
http://api.loc/topic/{{topic_id}}/modifiers
How can I customize the URL that the modifiers tab will pull the data from?
The only thing I did find was to use a <ReferenceInput> but the problem here is that the reference="" attribute will only get the info from a predefined structure, meaning that if I use reference="modifiers" it tries to fetch the data from:
http://api.loc/modifiers
And not from the desired URL.

change default icon outlook-addin

I try to change the defaut icon of y outlook add-in. By defaut it's blue icon
I changed every logo in my images folder. When I would like add my add-in I see the correct logo
But on Outlook, I have again the old logo []
3
I tried to clean and rebuild the solution, but it didn't change anything. I don't understand why I have always the old logo. I don't know where this old logo come from
Try to add in your manifest file this:
<IconUrl DefaultValue="your URL to image"/>
<HighResolutionIconUrl DefaultValue="your URL to image" />
The image have to be 128x128 .
If you have compose and read tags you need also have this:
<Icon>
<bt:Image size="16" resid="icon16" />
<bt:Image size="32" resid="icon32" />
<bt:Image size="80" resid="icon80" />
</Icon>
When icon16,icon32,icon80 is inside the source tag:
<Resources>
<bt:Images>
<bt:Image id="icon16" DefaultValue="your URL to image"/>
</bt:Images>
</Resources>
You can see full example and explanation here:
https://learn.microsoft.com/en-us/outlook/add-ins/manifests

Magento2 checkout form: How to display placeholder attribute value in fields?

Goodmorning Stackoverflow,
I'm customizing the checkout onepage in Magento 2. Now I'm trying to display placeholders instead of labels in the shipping-address form, but no success till now. I hope someone can help me out
Cheers, Jorge
UPDATE:
In the console i can see a variable is giving to the attribute placeholder of the element input.
<input class="input-text" type="text" data-bind="
value: value,
valueUpdate: 'keyup',
hasFocus: focused,
attr: {
name: inputName,
placeholder: placeholder, // <<<< right here
'aria-describedby': noticeId,
id: uid,
disabled: disabled
}" name="street[0]" placeholder="" aria-describedby="notice-BVWUCFN" id="BVWUCFN">
Now i would like to know if theres is a way to modify this variable via the backend, so i can display label name in the placeholder attr.
See screenshot
Apoligies for my bad english
Standard way,
Copy all html files from vendor/magento/module-ui/view/frontend/web/templates/form/element/
at
app/design/frontend/<Vendor>/<theme>/Magento_Ui/web/templates/form/element/
Then change all Change placeholder: placeholder to placeholder: label as mention by Akis Verillis.
Now you need to deploy the static files by below code:
php bin/magento setup:static-content:deploy
And see the magic.
Note: If you have checkout from github then try copy from
/app/code/Magento/Ui/view/base/web/templates/form/element/
Change placeholder: placeholder to placeholder: label
The answer is in Magneto 2 documentation now:
http://devdocs.magento.com/guides/v2.0/howdoi/checkout/checkout_edit_form.html
The templates are the ones mentioned in previous answers.
The templates from magento-ui module are used in other places than checkout.
In your custom module directory, create a new /view/frontend/layout/checkout_index_index.xml file. In this file, add content similar to the following:
...
<referenceBlock name="checkout.root">
<arguments>
<argument name="jsLayout" xsi:type="array">
...
<item name="shippingAddress" xsi:type="array">
<item name="children" xsi:type="array">
<!-- The name of the form the field belongs to -->
<item name="shipping-address-fieldset" xsi:type="array">
<item name="children" xsi:type="array">
<!-- the field you are customizing -->
<item name="telephone" xsi:type="array">
<item name="config" xsi:type="array">
<!-- Assigning a new template -->
<item name="elementTmpl" xsi:type="string">%Vendor_Module%/form/element/%your_template%</item>
%Vendor_Module%/form/element/%your_template%
path is [your theme dir]/Vendor_Module/web/template/form/element/your_template.html
Clear browser cache too beside:
Delete all files in the pub/static/frontend and var/view_preprocessing directories.
If this is useful for you, the definition of that element is in:
/app/code/Magento/Ui/view/base/web/templates/form/element/input.html
It defines an input as:
<input
class="admin__control-text"
type="text"
data-bind="
value: value,
hasFocus: focused,
attr: {
name: inputName,
placeholder: placeholder,
'aria-describedby': noticeId,
id: uid,
disabled: disabled
}" />
You can add placeholder item to a layout.xml file for your field. Just like this:
<item name="address" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/form/element/abstract</item>
<item name="config" xsi:type="array">
<item name="customScope" xsi:type="string">contactForm</item>
<item name="template" xsi:type="string">ui/form/field</item>
<item name="elementTmpl" xsi:type="string">ui/form/element/input</item>
</item>
<item name="placeholder" xsi:type="string">Address</item>
<item name="dataScope" xsi:type="string">address</item>
<item name="label" xsi:type="string">Address</item>
<item name="sortOrder" xsi:type="string">20</item>
<item name="validation" xsi:type="array">
<item name="required-entry" xsi:type="string">true</item>
</item>