? Pending

User tests: Successful: Unsuccessful:

avatar astridx
astridx
29 Jun 2018

Pull Request for Issue #20852.

Summary of Changes

  • Add attributes to joomla-field-switcher if field is set to disable="true"

  • Make the field joomla-field-switcher if field is set to disable="true"

Testing Instructions

Open global configuration and see outer html of the field "Search Engine Friendly URLs"


<joomla-field-switcher id="jform_sef" off-text="No" on-text="Yes" type="success">
<span class="switcher active has-success" tabindex="0" aria-checked="true" role="switch" aria-label="Yes"><input id="jform_sef0" name="jform[sef]" value="0" tabindex="-1" class="valid form-control-success" aria-invalid="false" type="radio"><input id="jform_sef1" name="jform[sef]" value="1" class="valid active form-control-success" tabindex="-1" checked="" aria-invalid="false" type="radio"><span class="switch"></span></span><span class="switcher-labels"><span class="switcher-label-0">No</span><span class="switcher-label-1 active">Yes</span></span></joomla-field-switcher>

Open /administrator/components/com_config/forms/application.xml

and change the field (insert disabled="true")

		<field
			name="sef"
			type="radio"
			label="COM_CONFIG_FIELD_SEF_URL_LABEL"
			class="switcher"
			default="1"
			filter="boolean"
			>
			<option value="0">JNO</option>
			<option value="1">JYES</option>
		</field>

to

		<field
			name="sef"
			type="radio"
			label="COM_CONFIG_FIELD_SEF_URL_LABEL"
			class="switcher"
			disabled="true"
			default="1"
			filter="boolean"
			>
			<option value="0">JNO</option>
			<option value="1">JYES</option>
		</field>

Open again global configuration and see outer html of the field "Search Engine Friendly URLs". Now the text disabled="" is added.

Apply this patch and see, that the text disabled="disabled" is added to the joomla-field-switcher and the inputs of joomla-field-switcher. See also, that the field now works as expected.

See also Issue #20852.

Expected result

The field "Search Engine Friendly URLs" is disabled. You can not change it.

Actual result

Nothing changed after making the field disabled. The field works as before. You can change the value.

Documentation Changes Required

Yes.

avatar astridx astridx - open - 29 Jun 2018
avatar astridx astridx - change - 29 Jun 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 29 Jun 2018
Category JavaScript Repository Layout
bdebd91 29 Jun 2018 avatar astridx lint
avatar astridx astridx - change - 29 Jun 2018
Labels Added: ?
avatar C-Lodder
C-Lodder - comment - 29 Jun 2018

Are you this prevents being able to switch the switcher using the Enter and Esc keys on the keyboard?

If not, check the solution I provided in the issue

avatar astridx
astridx - comment - 29 Jun 2018

@C-Lodder Thanks. Your are right, I forgot to disabling the keys. I will have a look later.

A question ofttopic: What files should I put into this pr? only the js and css file build/webcomponents/ or the files after running node build.js --compilecescss and node build.js --compilecejs in the media folder?

avatar astridx
astridx - comment - 29 Jun 2018

Now this prevents being able to switch the switcher using the Enter and Esc keys on the keyboard.

What should I do with the hound violation?

avatar dgrammatiko
dgrammatiko - comment - 29 Jun 2018

@astridx can you please do the PR here: joomla/40-backend-template#395

We're moving to web components for the simple fields

avatar ciar4n
ciar4n - comment - 29 Jun 2018

I would say ignore the violation.

avatar astridx
astridx - comment - 29 Jun 2018

I created the PR here joomla/40-backend-template#445

Should I close this PR?

avatar laoneo
laoneo - comment - 3 Jul 2018

Closing as the pr got moved to the back end template repo.

avatar laoneo laoneo - change - 3 Jul 2018
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2018-07-03 08:04:06
Closed_By laoneo
avatar laoneo laoneo - close - 3 Jul 2018

Add a Comment

Login with GitHub to post a comment