Work Item Customization - Rule behavior in Transition and State - visual-studio

Simple use case: in a work item workflow, a field must be REQUIRED in TRANSITION="Active to Resolved" and READONLY when in State="Resolved".
Customization: For that field, I have set the rule REQUIRED in the Transition details, and the Rule READONLY in the State details.
Behavior: When I change the work item State from Active to Resolved (without saving) the field becomes REQUIRED and READONLY. I was expecting that field switched to READONLY only after saving the work item to Resolved and not during transition.
Question: WHY the rule READONLY is applied in the Transition? Is this the common behavior of the workflows?
I'm working on TFS 2010. To edit the work item template I'm using Team Explroer Power tools (Process Editor). Work Item behavior is tested from Team Explorer e team Web access.
Thanks in advance

In this case the READONLY condition should have been evaluated only after saving but it won't. However you can wrap it within a WHENNOT condition (albeit not ideal solution as your filed must be filled before the state transition). e.g.:
<STATE value="Resolved">
<FIELDS>
<FIELD refname="Your.Field">
<WHENNOT field="Your.Field" value="">
<READONLY />
</WHENNOT>
</FIELD>
</FIELDS>
</STATE>

Related

BlueprintJS RadioGroup/Radio issue with defaultChecked/checked prop

I'm trying to setup a RadioGroup component that has the Radio component with the 'Data' label initially checked. But when I use the following code:
<RadioGroup
onChange={(e) => {
this.store.setDataFilterSelection(e.target.value)
}}
>
<Radio label='Data'
defaultChecked
value='1'
className='radio-selectors' />
<Radio label='Description'
value='2'
className='radio-selectors' />
<Radio label='Data Source'
value='3'
className='radio-selectors' />
</RadioGroup>
I get the following warning in my console.
Blueprint.Radio contains an input of type radio with both checked and
defaultChecked props. Input elements must be either controlled or
uncontrolled (specify either the checked prop, or the defaultChecked
prop, but not both). Decide between using a controlled or uncontrolled
input element and remove one of these props. More info:
react-controlled-components
I've tried a couple of variations and can't seem to get it right, basically I want to be able to monitor a change in the Radio buttons, but I can't tie them into state as they've done in the example here: http://blueprintjs.com/docs/#components.forms.radio
defaultChecked is only supported in uncontrolled usage (this is a core React concept, not a Blueprint thing), whereas checked is only supported in controlled usage--this is what the React error is telling you.
But if you're using RadioGroup then all the Radio children are forced into controlled mode and all state should go through RadioGroup. However RadioGroup does not currently support a defaultValue prop so this is not actually possible. I'd call this a bug in Blueprint, so good find!
Please file an issue on the repo and we'll look into implementing this (or even better, submit a PR with the fix!)
I had same error and I used useState and set the value which we want to be default while declaring the state like
const [radio, setRadio] = useState('defaultValue');.
Since we cant use defaultChecked I used the above method to get the option to be default checked.

How to use "editor" field type in joomla "repeatable" form field?

I am developing a module for Joomla 3.3.6. I want to use "editor" field type in "repeatable" field in the xml file. The code I am using is as follows:
<field
name="fpssibtos_img1subs"
type="Repeatable"
icon="list"
label="GLOBAL_SUBS"
description="GLOBAL_SUBS_DESC"
default="{'fpssibtos_img1sub':['test']}">
<fields name="params">
<fieldset hidden="true" name="fpssibtos_img1subs_modal" repeat="true">
<field
name="fpssibtos_img1sub"
default="test"
type="editor"
label="GLOBAL_SUB"
description="GLOBAL_SUB_DESC"
filter="safehtml"/>
</fieldset>
</fields>
</field>
The problem is the editor is not editable, I mean you cannot type anything in it.
I am using CKEditor, I changed it to TinyMCE and others ,but the problem persists. I know that repeatable form field is still buggy ,but I thought some of you guys might know the fix to this particular problem.
In case anyone else comes across this problem, the repeatable form fields only support simple field types. This is apparently due to Joomla not having a simple way for scripts to interact.
Comment on the issue from one of the devs here and here.

How to set parameters in menu Item Joomla Component

Following is my code.
<fields name="request">
<fieldset name="request">
<field name="format" type="list" label="COM_CPS_FIELD_FORMAT"
description="COM_CPS_FIELD_FORMAT_DESC" class="small"
default="raw"
>
<option value="">COM_CPS_FORMAT_HTML</option>
<option value="raw">COM_CPS_FORMAT_RAW</option>
</field>
</fieldset>
</fields>
When I save the menu with 2nd option it save the url like this index.php?option=com_cps&view=webservice&format=raw but when I save the menu with first option it does not remove the &format=raw If any one can help me out It would be great.
Default is defined as what to save if nothing is posted. It works like a Joomla input filter in that it changes what is actually saved as opposed to validation which stops the process and never posts. Therefore you cannot save nothing, since it will always be replaced by the default. Therefore if you want to be able to save blank you must not have a default.
What you may be looking for is a preset, which is a preselected value that can be unselected. Presets and defaults are totally different things although on the surface they appear similar.

Creating a Published drop down in Joomla

<field
name="published"
type="list"
label="JSTATUS"
description="JFIELD_PUBLISHED_DESC"
class="inputbox"
filter="intval"
size="1"
default="1"
>
<option value="1">
JPUBLISHED</option>
<option value="0">
JUNPUBLISHED</option>
<option value="-2">
JTRASHED</option>
</field>
I've created a Joomla dropdown in my form.xml file of a custom component to choose the published status of the item. I've taken this code unashamedly from the Joomla com_content component (and copied and pasted it into my own form.xml file. However when its rendered in the edit.php file (as shown below) you can see that the item is being set as unpublished. Despite the code above clearly setting the default as 1 which should correspond to published. Any good ideas as to why/how to fix this. I can easily change the drop down back from unpublished to published - and it works fine doing that. But its just annoying and a bug I'd like to fix. Any ideas?
Try to take a look if there is any override through your code, since this was taken by the com_content component, it won't set to default until all the mandatory fields are set, double check if any JS script or PHP function interrupts your field's normal behavior.
Another thought of mine is that maybe there is a problem with the translations, so take a close look to the translation files.
Are you using a table / model approach like com_content does? if so, when the record doesn't exist, its fields will be set to default (as read from database, so int fields will default to 0).
You can either
set the right defaults in the database,
check their values in the model,
change JPUBLISHED to 0 and JUNPUBLISHED to 517
although the latter looks really ugly.

Joomla 2.5 'Alternative Menu Items' and 'Category Blog' (Multiple template layout overrides for the same component)

I've come across a very strange problem relating to 'Alternative Menu Items', the usage is described here:
http://docs.joomla.org/Layout_Overrides_in_Joomla_1.6
The following files are located in: templates/testtemplate/html/com_content/category and these are the steps I took:
These files:
blog.php, blog.xml, blog_children.php, blog_item.php, blog_links.php
Have been changed to:
bloggal.php, bloggal.xml, bloggal_children.php, bloggal_item.php, bloggal_links.php
For file bloggal.xml – I changed this part:
<layout title="COM_CONTENT_CATEGORY_VIEW_BLOG_TITLE"
To:
<layout title="Blog Gallery"
Then added sub headings to bloggal.php and bloggal_item.php so I can see if the child items are in effect.
Now the interesting part is bloggal.php works fine but the child items drawn from bloggal_item.php do not come up.
I've done this test with the same template on multiple Joomla installs, on one of them it seems to work and the rest it does not.
The only thing I can think of is Joomla may have had a regression since the working one was an updated install and the rest are more recent versions.
Any ideas?
Starting Joomla 1.6 you can choose an alternate layout for each category. Including those you have overrides for. No need to select an alternate layout when configuring menu items ;)
Sorry I should've posted this sooner. I figured out the issue, I renamed:
<field name="layout_type"
type="hidden"
default="blog"
/>
To:
<field name="layout_type"
type="hidden"
default="bloggal"
/>
Essentially looking for a model that doesn't exist.
If you did this, do the following to fix it:
Rename default="whatever" back to default="blog"
In your database go to _menu table
Look for your menu item via the title column
Head over to the params and change {"layout_type":"bloggal"... to {"layout_type":"blog"...

Resources