[Freeipa-users] Setting "preserve" as default action when deleting in webUI

Sébastien Julliot julliot at ljll.math.upmc.fr
Wed Nov 9 16:12:48 UTC 2016


Hello Pavel,


Yes I did. "PRESERVE.JS WAS EXECUTED" is printed in my browser's
console, and yet "delete" ("supprimer", in French)  is still the
default. (as you can see in linked image)


Le 31/10/2016 à 16:18, Pavel Vomacka a écrit :
> Hello Sebastien,
>
> I tried your plugin and it works correctly. Default value is Preserve
> with your plugin. Did you copy your plugin into
> /var/share/ipa/ui/js/plugins/plugin_name/plugin_name.js ? That should
> be enough.
>
>
> On 10/28/2016 12:14 AM, Sebastien Julliot wrote:
>> Hello guys,
>>
>>
>> Thank you for your answers. First, I was able to modify the minified js
>> to change the default. Ugly solution, but it works for now.
>>
>> I am trying to write a plugin but it seems that I missed something here
>> since, despite being executed, the default is not changed ..
>>
>> Here is my code, freely inspired of what I think I understood of your
>> 'association_search_fix.js' example:
>>
>> define([
>>
>>      'freeipa/ipa',
>>
>>      'freeipa/user',
>>
>> ],
>>
>>      function(IPA, user) {
>>
>> exp = {};
>>
>>  
>> exp.orig_create_active_user_del_dialog =
>> IPA.user.create_active_user_del_dialog;
>>
>> IPA.user.create_active_user_del_dialog = function(dialog) {
>>
>>      dialog.deleter_dialog_create_content();
>>
>>      dialog.option_layout = IPA.fluid_layout({
>>
>>          label_cls: 'col-sm-3',
>>
>>          widget_cls: 'col-sm-9'
>>
>>      });
>>
>>      dialog.option_radio = IPA.radio_widget({
>>
>>          name: 'preserve',
>>
>>          label: '@i18n:objects.user.delete_mode',
>>
>>          options: [
>>
>>              { label: '@i18n:objects.user.mode_delete', value:
>> 'false' },
>>
>>              { label: '@i18n:objects.user.mode_preserve', value:
>> 'true' }
>>
>>          ],
>>
>>          default_value: 'true'
>>
>>      });
>>
>>      var html = dialog.option_layout.create([dialog.option_radio]);
>>
>>      dialog.container.append(html);
>>
>>      dialog.option_radio.set_value(['']);
>>
>>      return dialog;
>>
>> };
>>
>> //exp.orig_create_active_user_del_dialog =
>> IPA.user.create_active_user_del_dialog;
>>
>> console.log('PRESERVE.JS WAS EXECUTED');
>>
>> return exp;
>>
>> });
>>
>> I checked that disabling the comment or not does not change anything.
>>
>>
>> Can you see what I missed here ?
>>
>>
>> Thanks a lot,
>>
>> Sebastien Julliot.
>>
>>
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Capture du 2016-11-09 17-10-14.png
Type: image/png
Size: 86252 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-users/attachments/20161109/2f451013/attachment.png>


More information about the Freeipa-users mailing list