Default password customfield plaintext attribute to false

This commit is contained in:
nathangray 2020-06-16 09:23:54 -06:00
parent 10f70d9410
commit b56a8f9901
5 changed files with 26 additions and 1 deletions

View File

@ -358,6 +358,7 @@ var et2_customfields_list = /** @class */ (function (_super) {
// No label on the widget itself // No label on the widget itself
delete (attrs.label); delete (attrs.label);
attrs['viewable'] = true; attrs['viewable'] = true;
attrs['plaintext'] = false;
return true; return true;
}; };
et2_customfields_list.prototype._setup_ajax_select = function (field_name, field, attrs) { et2_customfields_list.prototype._setup_ajax_select = function (field_name, field, attrs) {

View File

@ -485,6 +485,7 @@ export class et2_customfields_list extends et2_valueWidget implements et2_IDetac
// No label on the widget itself // No label on the widget itself
delete (attrs.label); delete (attrs.label);
attrs['viewable'] = true; attrs['viewable'] = true;
attrs['plaintext'] = false;
return true; return true;
} }

View File

@ -260,4 +260,16 @@ var et2_password = /** @class */ (function (_super) {
}(et2_widget_textbox_1.et2_textbox)); }(et2_widget_textbox_1.et2_textbox));
exports.et2_password = et2_password; exports.et2_password = et2_password;
et2_core_widget_1.et2_register_widget(et2_password, ["passwd"]); et2_core_widget_1.et2_register_widget(et2_password, ["passwd"]);
var et2_password_ro = /** @class */ (function (_super) {
__extends(et2_password_ro, _super);
function et2_password_ro() {
return _super !== null && _super.apply(this, arguments) || this;
}
et2_password_ro.prototype.set_value = function (value) {
this.value_span.text(value ? "********" : "");
};
return et2_password_ro;
}(et2_widget_textbox_1.et2_textbox_ro));
exports.et2_password_ro = et2_password_ro;
et2_core_widget_1.et2_register_widget(et2_password_ro, ["passwd_ro"]);
//# sourceMappingURL=et2_widget_password.js.map //# sourceMappingURL=et2_widget_password.js.map

View File

@ -20,7 +20,7 @@ import {et2_createWidget, et2_register_widget, WidgetConfig} from "./et2_core_wi
import {et2_valueWidget} from './et2_core_valueWidget' import {et2_valueWidget} from './et2_core_valueWidget'
import {et2_inputWidget} from './et2_core_inputWidget' import {et2_inputWidget} from './et2_core_inputWidget'
import {et2_button} from './et2_widget_button' import {et2_button} from './et2_widget_button'
import {et2_textbox} from "./et2_widget_textbox"; import {et2_textbox, et2_textbox_ro} from "./et2_widget_textbox";
import {et2_dialog} from "./et2_widget_dialog"; import {et2_dialog} from "./et2_widget_dialog";
/** /**
@ -316,3 +316,13 @@ export class et2_password extends et2_textbox
} }
} }
et2_register_widget(et2_password, [ "passwd"]); et2_register_widget(et2_password, [ "passwd"]);
export class et2_password_ro extends et2_textbox_ro
{
set_value(value)
{
this.value_span.text(value ? "********" : "");
}
}
et2_register_widget(et2_password_ro, [ "passwd_ro"]);

View File

@ -325,6 +325,7 @@ class Customfields extends Transformer
break; break;
case 'passwd': case 'passwd':
$widget->attrs['viewable'] = true; $widget->attrs['viewable'] = true;
$widget->attrs['plaintext'] = false;
break; break;
default: default: