[int]
This commit is contained in:
parent
b29730fffd
commit
17f432ab10
14 changed files with 302 additions and 174 deletions
|
@ -10,9 +10,11 @@
|
||||||
"common.date": "Datum",
|
"common.date": "Datum",
|
||||||
"common.time": "Uhzeit",
|
"common.time": "Uhzeit",
|
||||||
"domain.group.name.label": "Name",
|
"domain.group.name.label": "Name",
|
||||||
|
"domain.group.label.label": "Beschriftung",
|
||||||
"domain.member.member": "Mitglied",
|
"domain.member.member": "Mitglied",
|
||||||
"domain.member.membership_number.label": "Mitgliedsnummer",
|
"domain.member.membership_number.label": "Mitgliedsnummer",
|
||||||
"domain.member.name.label": "Name",
|
"domain.member.name.label": "Name",
|
||||||
|
"domain.member.label.label": "Beschriftung",
|
||||||
"domain.member.name_real_value.label": "Echter Name",
|
"domain.member.name_real_value.label": "Echter Name",
|
||||||
"domain.member.name_real_index.label": "Namens-Index",
|
"domain.member.name_real_index.label": "Namens-Index",
|
||||||
"domain.member.groups.label": "Gruppen",
|
"domain.member.groups.label": "Gruppen",
|
||||||
|
|
|
@ -10,9 +10,11 @@
|
||||||
"common.date": "date",
|
"common.date": "date",
|
||||||
"common.time": "time",
|
"common.time": "time",
|
||||||
"domain.group.name.label": "name",
|
"domain.group.name.label": "name",
|
||||||
|
"domain.group.label.label": "label",
|
||||||
"domain.member.member": "member",
|
"domain.member.member": "member",
|
||||||
"domain.member.membership_number.label": "membership number",
|
"domain.member.membership_number.label": "membership number",
|
||||||
"domain.member.name.label": "name",
|
"domain.member.name.label": "name",
|
||||||
|
"domain.member.label.label": "label",
|
||||||
"domain.member.name_real_value.label": "real name",
|
"domain.member.name_real_value.label": "real name",
|
||||||
"domain.member.name_real_index.label": "name index",
|
"domain.member.name_real_index.label": "name index",
|
||||||
"domain.member.groups.label": "groups",
|
"domain.member.groups.label": "groups",
|
||||||
|
|
|
@ -21,8 +21,14 @@ lib_plankton.zoo_page.register(
|
||||||
target_element.querySelector(".group_create-title").textContent = lib_plankton.translate.get("page.group_create.title");
|
target_element.querySelector(".group_create-title").textContent = lib_plankton.translate.get("page.group_create.title");
|
||||||
|
|
||||||
const form = new lib_plankton.zoo_form.class_form<
|
const form = new lib_plankton.zoo_form.class_form<
|
||||||
{name : string},
|
{
|
||||||
{name : string}
|
name : string;
|
||||||
|
label : string;
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name : string;
|
||||||
|
label : string;
|
||||||
|
}
|
||||||
>(
|
>(
|
||||||
value => value,
|
value => value,
|
||||||
representation => representation,
|
representation => representation,
|
||||||
|
@ -33,6 +39,11 @@ lib_plankton.zoo_page.register(
|
||||||
"input": new lib_plankton.zoo_input.class_input_text(),
|
"input": new lib_plankton.zoo_input.class_input_text(),
|
||||||
"label": lib_plankton.translate.get("domain.group.name.label"),
|
"label": lib_plankton.translate.get("domain.group.name.label"),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "label",
|
||||||
|
"input": new lib_plankton.zoo_input.class_input_text(),
|
||||||
|
"label": lib_plankton.translate.get("domain.group.label.label"),
|
||||||
|
},
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
[
|
[
|
||||||
|
|
|
@ -18,7 +18,10 @@ lib_plankton.zoo_page.register(
|
||||||
(parameters, target_element) => {
|
(parameters, target_element) => {
|
||||||
type type_item = {
|
type type_item = {
|
||||||
id : int;
|
id : int;
|
||||||
|
preview : {
|
||||||
name : string;
|
name : string;
|
||||||
|
label : string;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
const term : (null | string) = (parameters["term"] ?? "");
|
const term : (null | string) = (parameters["term"] ?? "");
|
||||||
|
|
||||||
|
@ -46,9 +49,9 @@ lib_plankton.zoo_page.register(
|
||||||
(term) => _espe.backend.group_list(),
|
(term) => _espe.backend.group_list(),
|
||||||
{
|
{
|
||||||
"encode_item": (item) => lib_plankton.string.coin(
|
"encode_item": (item) => lib_plankton.string.coin(
|
||||||
"{{name}}",
|
"{{label}}",
|
||||||
{
|
{
|
||||||
"name": item.name,
|
"label": item.preview.label,
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
"hooks_begin": [
|
"hooks_begin": [
|
||||||
|
|
|
@ -25,8 +25,14 @@ lib_plankton.zoo_page.register(
|
||||||
const group_object = await _espe.backend.group_get(id);
|
const group_object = await _espe.backend.group_get(id);
|
||||||
|
|
||||||
const form = new lib_plankton.zoo_form.class_form<
|
const form = new lib_plankton.zoo_form.class_form<
|
||||||
{name : string},
|
{
|
||||||
{name : string}
|
name : string;
|
||||||
|
label : string;
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name : string;
|
||||||
|
label : string;
|
||||||
|
}
|
||||||
>(
|
>(
|
||||||
value => value,
|
value => value,
|
||||||
representation => representation,
|
representation => representation,
|
||||||
|
@ -34,9 +40,14 @@ lib_plankton.zoo_page.register(
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": "name",
|
"name": "name",
|
||||||
"input": new lib_plankton.zoo_input.class_input_text(),
|
"input": new lib_plankton.zoo_input.class_input_text({"read_only": true}),
|
||||||
"label": lib_plankton.translate.get("domain.group.name.label"),
|
"label": lib_plankton.translate.get("domain.group.name.label"),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "label",
|
||||||
|
"input": new lib_plankton.zoo_input.class_input_text(),
|
||||||
|
"label": lib_plankton.translate.get("domain.group.label.label"),
|
||||||
|
},
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
[
|
[
|
||||||
|
|
|
@ -30,18 +30,49 @@ lib_plankton.zoo_page.register(
|
||||||
/**
|
/**
|
||||||
* @todo cache
|
* @todo cache
|
||||||
*/
|
*/
|
||||||
const groups_as_array : Array<{id : int; name : string;}> = await _espe.backend.group_list();
|
const groups_as_array : Array<
|
||||||
const groups_as_map : Map<int, {name : string;}> = new Map<int, {name : string;}>();
|
{
|
||||||
|
id : int;
|
||||||
|
preview : {
|
||||||
|
name : string;
|
||||||
|
label : string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
> = await _espe.backend.group_list();
|
||||||
|
const groups_as_map : Map<
|
||||||
|
int,
|
||||||
|
{
|
||||||
|
name : string;
|
||||||
|
label : string;
|
||||||
|
}
|
||||||
|
> = new Map<
|
||||||
|
int,
|
||||||
|
{
|
||||||
|
name : string;
|
||||||
|
label : string;
|
||||||
|
}
|
||||||
|
>();
|
||||||
for (const group_thingy of groups_as_array)
|
for (const group_thingy of groups_as_array)
|
||||||
{
|
{
|
||||||
groups_as_map.set(group_thingy.id, {"name": group_thingy.name});
|
groups_as_map.set(
|
||||||
|
group_thingy.id,
|
||||||
|
{
|
||||||
|
"name": group_thingy.preview.name,
|
||||||
|
"label": group_thingy.preview.label,
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @todo unify with form of "invite_view"
|
||||||
|
*/
|
||||||
const form = new lib_plankton.zoo_form.class_form<
|
const form = new lib_plankton.zoo_form.class_form<
|
||||||
{
|
{
|
||||||
data : {
|
data : {
|
||||||
name_changeable : boolean;
|
name_changeable : boolean;
|
||||||
name_value : (null | string);
|
name_value : (null | string);
|
||||||
|
label_changeable : boolean;
|
||||||
|
label_value : (null | string);
|
||||||
email_address_changeable : boolean;
|
email_address_changeable : boolean;
|
||||||
email_address_value : (null | string);
|
email_address_value : (null | string);
|
||||||
groups_changeable : boolean;
|
groups_changeable : boolean;
|
||||||
|
@ -55,6 +86,10 @@ lib_plankton.zoo_page.register(
|
||||||
changeable : boolean;
|
changeable : boolean;
|
||||||
value : string;
|
value : string;
|
||||||
};
|
};
|
||||||
|
label : {
|
||||||
|
changeable : boolean;
|
||||||
|
value : string;
|
||||||
|
};
|
||||||
email_address : {
|
email_address : {
|
||||||
changeable : boolean;
|
changeable : boolean;
|
||||||
value : string;
|
value : string;
|
||||||
|
@ -72,6 +107,10 @@ lib_plankton.zoo_page.register(
|
||||||
"changeable": value.data.name_changeable,
|
"changeable": value.data.name_changeable,
|
||||||
"value": value.data.name_value,
|
"value": value.data.name_value,
|
||||||
},
|
},
|
||||||
|
"label": {
|
||||||
|
"changeable": value.data.label_changeable,
|
||||||
|
"value": value.data.label_value,
|
||||||
|
},
|
||||||
"email_address": {
|
"email_address": {
|
||||||
"changeable": value.data.email_address_changeable,
|
"changeable": value.data.email_address_changeable,
|
||||||
"value": (value.data.email_address_value ?? ""),
|
"value": (value.data.email_address_value ?? ""),
|
||||||
|
@ -93,6 +132,8 @@ lib_plankton.zoo_page.register(
|
||||||
"data": {
|
"data": {
|
||||||
"name_changeable": representation.name.changeable,
|
"name_changeable": representation.name.changeable,
|
||||||
"name_value": null_when_empty(representation.name.value),
|
"name_value": null_when_empty(representation.name.value),
|
||||||
|
"label_changeable": representation.label.changeable,
|
||||||
|
"label_value": null_when_empty(representation.label.value),
|
||||||
"email_address_changeable": representation.email_address.changeable,
|
"email_address_changeable": representation.email_address.changeable,
|
||||||
"email_address_value": null_when_empty(representation.email_address.value),
|
"email_address_value": null_when_empty(representation.email_address.value),
|
||||||
"groups_changeable": representation.groups.changeable,
|
"groups_changeable": representation.groups.changeable,
|
||||||
|
@ -127,6 +168,24 @@ lib_plankton.zoo_page.register(
|
||||||
),
|
),
|
||||||
"label": lib_plankton.translate.get("domain.member.name.label"),
|
"label": lib_plankton.translate.get("domain.member.name.label"),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "label",
|
||||||
|
"input": new lib_plankton.zoo_input.class_input_group(
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "value",
|
||||||
|
"input": new lib_plankton.zoo_input.class_input_text(),
|
||||||
|
"label": indent(lib_plankton.translate.get("common.initial_value")),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "changeable",
|
||||||
|
"input": new lib_plankton.zoo_input.class_input_checkbox(),
|
||||||
|
"label": indent(lib_plankton.translate.get("common.changeable")),
|
||||||
|
},
|
||||||
|
]
|
||||||
|
),
|
||||||
|
"label": lib_plankton.translate.get("domain.member.label.label"),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "email_address",
|
"name": "email_address",
|
||||||
"input": new lib_plankton.zoo_input.class_input_group(
|
"input": new lib_plankton.zoo_input.class_input_group(
|
||||||
|
@ -244,6 +303,8 @@ lib_plankton.zoo_page.register(
|
||||||
"data": {
|
"data": {
|
||||||
"name_changeable": false,
|
"name_changeable": false,
|
||||||
"name_value": "",
|
"name_value": "",
|
||||||
|
"label_changeable": true,
|
||||||
|
"label_value": "",
|
||||||
"email_address_changeable": true,
|
"email_address_changeable": true,
|
||||||
"email_address_value": null,
|
"email_address_value": null,
|
||||||
"groups_changeable": false,
|
"groups_changeable": false,
|
||||||
|
|
|
@ -53,6 +53,8 @@ lib_plankton.zoo_page.register(
|
||||||
{
|
{
|
||||||
name_changeable : boolean;
|
name_changeable : boolean;
|
||||||
name_value : (null | string);
|
name_value : (null | string);
|
||||||
|
label_changeable : boolean;
|
||||||
|
label_value : (null | string);
|
||||||
email_address_changeable : boolean;
|
email_address_changeable : boolean;
|
||||||
email_address_value : (null | string);
|
email_address_value : (null | string);
|
||||||
groups_changeable : boolean;
|
groups_changeable : boolean;
|
||||||
|
@ -82,16 +84,43 @@ lib_plankton.zoo_page.register(
|
||||||
/**
|
/**
|
||||||
* @todo cache
|
* @todo cache
|
||||||
*/
|
*/
|
||||||
const groups_as_array : Array<{id : int; name : string;}> = await _espe.backend.group_list();
|
const groups_as_array : Array<
|
||||||
const groups_as_map : Map<int, {name : string;}> = new Map<int, {name : string;}>();
|
{
|
||||||
|
id : int;
|
||||||
|
preview : {
|
||||||
|
name : string;
|
||||||
|
label : string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
> = await _espe.backend.group_list();
|
||||||
|
const groups_as_map : Map<
|
||||||
|
int,
|
||||||
|
{
|
||||||
|
name : string;
|
||||||
|
label : string;
|
||||||
|
}
|
||||||
|
> = new Map<
|
||||||
|
int,
|
||||||
|
{
|
||||||
|
name : string;
|
||||||
|
label : string;
|
||||||
|
}
|
||||||
|
>();
|
||||||
for (const group_thingy of groups_as_array)
|
for (const group_thingy of groups_as_array)
|
||||||
{
|
{
|
||||||
groups_as_map.set(group_thingy.id, {"name": group_thingy.name});
|
groups_as_map.set(
|
||||||
|
group_thingy.id,
|
||||||
|
{
|
||||||
|
"name": group_thingy.preview.name,
|
||||||
|
"label": group_thingy.preview.label,
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const form = new lib_plankton.zoo_form.class_form<
|
const form = new lib_plankton.zoo_form.class_form<
|
||||||
{
|
{
|
||||||
name : string;
|
name : string;
|
||||||
|
label : string;
|
||||||
email_address : (null | string);
|
email_address : (null | string);
|
||||||
groups : Array<int>;
|
groups : Array<int>;
|
||||||
password_value : string;
|
password_value : string;
|
||||||
|
@ -99,6 +128,7 @@ lib_plankton.zoo_page.register(
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name : string;
|
name : string;
|
||||||
|
label : string;
|
||||||
email_address : string;
|
email_address : string;
|
||||||
groups : Array<int>;
|
groups : Array<int>;
|
||||||
password_value : string;
|
password_value : string;
|
||||||
|
@ -107,6 +137,7 @@ lib_plankton.zoo_page.register(
|
||||||
>(
|
>(
|
||||||
value => ({
|
value => ({
|
||||||
"name": value.name,
|
"name": value.name,
|
||||||
|
"label": value.label,
|
||||||
"email_address": (value.email_address ?? ""),
|
"email_address": (value.email_address ?? ""),
|
||||||
"groups": value.groups,
|
"groups": value.groups,
|
||||||
"password_value": value.password_value,
|
"password_value": value.password_value,
|
||||||
|
@ -114,6 +145,7 @@ lib_plankton.zoo_page.register(
|
||||||
}),
|
}),
|
||||||
representation => ({
|
representation => ({
|
||||||
"name": representation.name,
|
"name": representation.name,
|
||||||
|
"label": representation.label,
|
||||||
"email_address": representation.email_address,
|
"email_address": representation.email_address,
|
||||||
"groups": representation.groups,
|
"groups": representation.groups,
|
||||||
"password_value": representation.password_value,
|
"password_value": representation.password_value,
|
||||||
|
@ -130,6 +162,24 @@ lib_plankton.zoo_page.register(
|
||||||
),
|
),
|
||||||
"label": lib_plankton.translate.get("domain.member.name.label"),
|
"label": lib_plankton.translate.get("domain.member.name.label"),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "label",
|
||||||
|
"input": new lib_plankton.zoo_input.class_input_text(
|
||||||
|
{
|
||||||
|
"read_only": (! data.label_changeable),
|
||||||
|
}
|
||||||
|
),
|
||||||
|
"label": lib_plankton.translate.get("domain.member.label.label"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "email_address",
|
||||||
|
"input": new lib_plankton.zoo_input.class_input_text(
|
||||||
|
{
|
||||||
|
"read_only": (! data.email_address_changeable),
|
||||||
|
}
|
||||||
|
),
|
||||||
|
"label": lib_plankton.translate.get("domain.member.email_address.label"),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "groups",
|
"name": "groups",
|
||||||
/*
|
/*
|
||||||
|
@ -166,15 +216,6 @@ lib_plankton.zoo_page.register(
|
||||||
),
|
),
|
||||||
"label": lib_plankton.translate.get("domain.member.groups.label"),
|
"label": lib_plankton.translate.get("domain.member.groups.label"),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "email_address",
|
|
||||||
"input": new lib_plankton.zoo_input.class_input_text(
|
|
||||||
{
|
|
||||||
"read_only": (! data.email_address_changeable),
|
|
||||||
}
|
|
||||||
),
|
|
||||||
"label": lib_plankton.translate.get("domain.member.email_address_private.label"),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "password_value",
|
"name": "password_value",
|
||||||
"input": new lib_plankton.zoo_input.class_input_password(
|
"input": new lib_plankton.zoo_input.class_input_password(
|
||||||
|
@ -214,9 +255,10 @@ lib_plankton.zoo_page.register(
|
||||||
flaws = await _espe.backend.invite_accept(
|
flaws = await _espe.backend.invite_accept(
|
||||||
key,
|
key,
|
||||||
{
|
{
|
||||||
"groups": value.groups,
|
"label": value.label,
|
||||||
"name": value.name,
|
"name": value.name,
|
||||||
"email_address": value.email_address,
|
"email_address": value.email_address,
|
||||||
|
"groups": value.groups,
|
||||||
"password": value.password_value,
|
"password": value.password_value,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -258,6 +300,7 @@ lib_plankton.zoo_page.register(
|
||||||
form.input_write(
|
form.input_write(
|
||||||
{
|
{
|
||||||
"name": data.name_value,
|
"name": data.name_value,
|
||||||
|
"label": data.label_value,
|
||||||
"email_address": data.email_address_value,
|
"email_address": data.email_address_value,
|
||||||
"groups": data.groups_value,
|
"groups": data.groups_value,
|
||||||
"password_value": "",
|
"password_value": "",
|
||||||
|
|
|
@ -19,9 +19,12 @@ lib_plankton.zoo_page.register(
|
||||||
// types
|
// types
|
||||||
type type_item = {
|
type type_item = {
|
||||||
id : int;
|
id : int;
|
||||||
|
preview : {
|
||||||
key : string;
|
key : string;
|
||||||
expiry : (null | int);
|
expiry : (null | int);
|
||||||
name_value : string;
|
name_value : string;
|
||||||
|
label_value : string;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// parameters
|
// parameters
|
||||||
|
@ -52,10 +55,9 @@ lib_plankton.zoo_page.register(
|
||||||
(term) => _espe.backend.invite_list(),
|
(term) => _espe.backend.invite_list(),
|
||||||
{
|
{
|
||||||
"encode_item": (item) => lib_plankton.string.coin(
|
"encode_item": (item) => lib_plankton.string.coin(
|
||||||
"[{{id}}] {{name}}",
|
"{{label}}",
|
||||||
{
|
{
|
||||||
"id": item.id.toFixed(0),
|
"label": item.preview.label_value,
|
||||||
"name": item.name_value,
|
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
"hooks_begin": [
|
"hooks_begin": [
|
||||||
|
|
|
@ -45,19 +45,50 @@ lib_plankton.zoo_page.register(
|
||||||
/**
|
/**
|
||||||
* @todo cache
|
* @todo cache
|
||||||
*/
|
*/
|
||||||
const groups_as_array : Array<{id : int; name : string;}> = await _espe.backend.group_list();
|
const groups_as_array : Array<
|
||||||
const groups_as_map : Map<int, {name : string;}> = new Map<int, {name : string;}>();
|
{
|
||||||
|
id : int;
|
||||||
|
preview : {
|
||||||
|
name : string;
|
||||||
|
label : string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
> = await _espe.backend.group_list();
|
||||||
|
const groups_as_map : Map<
|
||||||
|
int,
|
||||||
|
{
|
||||||
|
name : string;
|
||||||
|
label : string;
|
||||||
|
}
|
||||||
|
> = new Map<
|
||||||
|
int,
|
||||||
|
{
|
||||||
|
name : string;
|
||||||
|
label : string;
|
||||||
|
}
|
||||||
|
>();
|
||||||
for (const group_thingy of groups_as_array)
|
for (const group_thingy of groups_as_array)
|
||||||
{
|
{
|
||||||
groups_as_map.set(group_thingy.id, {"name": group_thingy.name});
|
groups_as_map.set(
|
||||||
|
group_thingy.id,
|
||||||
|
{
|
||||||
|
"name": group_thingy.preview.name,
|
||||||
|
"label": group_thingy.preview.label,
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @todo unify with form of "invite_create"
|
||||||
|
*/
|
||||||
const form = new lib_plankton.zoo_form.class_form<
|
const form = new lib_plankton.zoo_form.class_form<
|
||||||
{
|
{
|
||||||
key : string;
|
key : string;
|
||||||
expiry : (null | int);
|
expiry : (null | int);
|
||||||
name_changeable : boolean;
|
name_changeable : boolean;
|
||||||
name_value : string;
|
name_value : string;
|
||||||
|
label_changeable : boolean;
|
||||||
|
label_value : string;
|
||||||
email_address_changeable : boolean;
|
email_address_changeable : boolean;
|
||||||
email_address_value : (null | string);
|
email_address_value : (null | string);
|
||||||
groups_changeable : boolean;
|
groups_changeable : boolean;
|
||||||
|
@ -70,6 +101,10 @@ lib_plankton.zoo_page.register(
|
||||||
changeable : boolean;
|
changeable : boolean;
|
||||||
value : string;
|
value : string;
|
||||||
};
|
};
|
||||||
|
label : {
|
||||||
|
changeable : boolean;
|
||||||
|
value : string;
|
||||||
|
};
|
||||||
email_address : {
|
email_address : {
|
||||||
changeable : boolean;
|
changeable : boolean;
|
||||||
value : string;
|
value : string;
|
||||||
|
@ -94,6 +129,10 @@ lib_plankton.zoo_page.register(
|
||||||
"changeable": value.name_changeable,
|
"changeable": value.name_changeable,
|
||||||
"value": value.name_value,
|
"value": value.name_value,
|
||||||
},
|
},
|
||||||
|
"label": {
|
||||||
|
"changeable": value.label_changeable,
|
||||||
|
"value": value.label_value,
|
||||||
|
},
|
||||||
"email_address": {
|
"email_address": {
|
||||||
"changeable": value.email_address_changeable,
|
"changeable": value.email_address_changeable,
|
||||||
"value": (value.email_address_value ?? ""),
|
"value": (value.email_address_value ?? ""),
|
||||||
|
@ -115,6 +154,8 @@ lib_plankton.zoo_page.register(
|
||||||
"key": representation.key,
|
"key": representation.key,
|
||||||
"name_changeable": representation.name.changeable,
|
"name_changeable": representation.name.changeable,
|
||||||
"name_value": representation.name.value,
|
"name_value": representation.name.value,
|
||||||
|
"label_changeable": representation.label.changeable,
|
||||||
|
"label_value": representation.label.value,
|
||||||
"email_address_changeable": representation.email_address.changeable,
|
"email_address_changeable": representation.email_address.changeable,
|
||||||
"email_address_value": null_when_empty(representation.email_address.value),
|
"email_address_value": null_when_empty(representation.email_address.value),
|
||||||
"groups_changeable": representation.groups.changeable,
|
"groups_changeable": representation.groups.changeable,
|
||||||
|
@ -151,6 +192,24 @@ lib_plankton.zoo_page.register(
|
||||||
),
|
),
|
||||||
"label": lib_plankton.translate.get("domain.member.name.label"),
|
"label": lib_plankton.translate.get("domain.member.name.label"),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "label",
|
||||||
|
"input": new lib_plankton.zoo_input.class_input_group(
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "value",
|
||||||
|
"input": new lib_plankton.zoo_input.class_input_text(),
|
||||||
|
"label": indent(lib_plankton.translate.get("common.initial_value")),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "changeable",
|
||||||
|
"input": new lib_plankton.zoo_input.class_input_checkbox({"read_only": true}),
|
||||||
|
"label": indent(lib_plankton.translate.get("common.changeable")),
|
||||||
|
},
|
||||||
|
]
|
||||||
|
),
|
||||||
|
"label": lib_plankton.translate.get("domain.member.label.label"),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "groups",
|
"name": "groups",
|
||||||
"input": new lib_plankton.zoo_input.class_input_group(
|
"input": new lib_plankton.zoo_input.class_input_group(
|
||||||
|
@ -235,6 +294,8 @@ lib_plankton.zoo_page.register(
|
||||||
expiry : (null | int);
|
expiry : (null | int);
|
||||||
name_changeable : boolean;
|
name_changeable : boolean;
|
||||||
name_value : string;
|
name_value : string;
|
||||||
|
label_changeable : boolean;
|
||||||
|
label_value : string;
|
||||||
email_address_changeable : boolean;
|
email_address_changeable : boolean;
|
||||||
email_address_value : (null | string);
|
email_address_value : (null | string);
|
||||||
groups_changeable : boolean;
|
groups_changeable : boolean;
|
||||||
|
|
|
@ -19,6 +19,7 @@ lib_plankton.zoo_page.register(
|
||||||
type type_item = {
|
type type_item = {
|
||||||
id : int;
|
id : int;
|
||||||
preview : {
|
preview : {
|
||||||
|
label : string;
|
||||||
name : string;
|
name : string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -50,9 +51,9 @@ lib_plankton.zoo_page.register(
|
||||||
(term) => _espe.backend.member_list(term),
|
(term) => _espe.backend.member_list(term),
|
||||||
{
|
{
|
||||||
"encode_item": (item) => lib_plankton.string.coin(
|
"encode_item": (item) => lib_plankton.string.coin(
|
||||||
"{{name}}",
|
"{{label}}",
|
||||||
{
|
{
|
||||||
"name": item.preview.name,
|
"label": item.preview.label,
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
"hooks_begin": [
|
"hooks_begin": [
|
||||||
|
|
|
@ -25,11 +25,37 @@ lib_plankton.zoo_page.register(
|
||||||
/**
|
/**
|
||||||
* @todo cache
|
* @todo cache
|
||||||
*/
|
*/
|
||||||
const groups_as_array : Array<{id : int; name : string;}> = await _espe.backend.group_list();
|
const groups_as_array : Array<
|
||||||
const groups_as_map : Map<int, {name : string;}> = new Map<int, {name : string;}>();
|
{
|
||||||
|
id : int;
|
||||||
|
preview : {
|
||||||
|
name : string;
|
||||||
|
label : string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
> = await _espe.backend.group_list();
|
||||||
|
const groups_as_map : Map<
|
||||||
|
int,
|
||||||
|
{
|
||||||
|
name : string;
|
||||||
|
label : string;
|
||||||
|
}
|
||||||
|
> = new Map<
|
||||||
|
int,
|
||||||
|
{
|
||||||
|
name : string;
|
||||||
|
label : string;
|
||||||
|
}
|
||||||
|
>();
|
||||||
for (const group_thingy of groups_as_array)
|
for (const group_thingy of groups_as_array)
|
||||||
{
|
{
|
||||||
groups_as_map.set(group_thingy.id, {"name": group_thingy.name});
|
groups_as_map.set(
|
||||||
|
group_thingy.id,
|
||||||
|
{
|
||||||
|
"name": group_thingy.preview.name,
|
||||||
|
"label": group_thingy.preview.label,
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const member_data = await _espe.backend.member_get(id);
|
const member_data = await _espe.backend.member_get(id);
|
||||||
|
@ -37,6 +63,7 @@ lib_plankton.zoo_page.register(
|
||||||
const form = new lib_plankton.zoo_form.class_form<
|
const form = new lib_plankton.zoo_form.class_form<
|
||||||
{
|
{
|
||||||
name : string;
|
name : string;
|
||||||
|
label : string;
|
||||||
groups : Array<int>;
|
groups : Array<int>;
|
||||||
enabled : boolean;
|
enabled : boolean;
|
||||||
email_address : (null | string);
|
email_address : (null | string);
|
||||||
|
@ -44,6 +71,7 @@ lib_plankton.zoo_page.register(
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name : string;
|
name : string;
|
||||||
|
label : string;
|
||||||
groups : Array<int>;
|
groups : Array<int>;
|
||||||
enabled : boolean;
|
enabled : boolean;
|
||||||
email_address : (null | string);
|
email_address : (null | string);
|
||||||
|
@ -52,6 +80,7 @@ lib_plankton.zoo_page.register(
|
||||||
>(
|
>(
|
||||||
value => ({
|
value => ({
|
||||||
"name": value.name,
|
"name": value.name,
|
||||||
|
"label": value.label,
|
||||||
"groups": value.groups,
|
"groups": value.groups,
|
||||||
"enabled": value.enabled,
|
"enabled": value.enabled,
|
||||||
"email_address": value.email_address,
|
"email_address": value.email_address,
|
||||||
|
@ -59,6 +88,7 @@ lib_plankton.zoo_page.register(
|
||||||
}),
|
}),
|
||||||
representation => ({
|
representation => ({
|
||||||
"name": representation.name,
|
"name": representation.name,
|
||||||
|
"label": representation.label,
|
||||||
"groups": representation.groups,
|
"groups": representation.groups,
|
||||||
"enabled": representation.enabled,
|
"enabled": representation.enabled,
|
||||||
"email_address": representation.email_address,
|
"email_address": representation.email_address,
|
||||||
|
@ -71,6 +101,11 @@ lib_plankton.zoo_page.register(
|
||||||
"input": new lib_plankton.zoo_input.class_input_text({"read_only": true}),
|
"input": new lib_plankton.zoo_input.class_input_text({"read_only": true}),
|
||||||
"label": lib_plankton.translate.get("domain.member.name.label"),
|
"label": lib_plankton.translate.get("domain.member.name.label"),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "label",
|
||||||
|
"input": new lib_plankton.zoo_input.class_input_text(),
|
||||||
|
"label": lib_plankton.translate.get("domain.member.label.label"),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "enabled",
|
"name": "enabled",
|
||||||
"input": new lib_plankton.zoo_input.class_input_checkbox(),
|
"input": new lib_plankton.zoo_input.class_input_checkbox(),
|
||||||
|
@ -123,6 +158,7 @@ lib_plankton.zoo_page.register(
|
||||||
await _espe.backend.member_modify(
|
await _espe.backend.member_modify(
|
||||||
id,
|
id,
|
||||||
{
|
{
|
||||||
|
"label": value.label,
|
||||||
"email_address": value.email_address,
|
"email_address": value.email_address,
|
||||||
"groups": value.groups,
|
"groups": value.groups,
|
||||||
"enabled": value.enabled,
|
"enabled": value.enabled,
|
||||||
|
@ -131,43 +167,13 @@ lib_plankton.zoo_page.register(
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
/*
|
|
||||||
.concat(
|
|
||||||
member_data.registered
|
|
||||||
? []
|
|
||||||
: [
|
|
||||||
{
|
|
||||||
"label": lib_plankton.translate.get("page.member_view.form.action.summon"),
|
|
||||||
"procedure": async (get_value, get_representation) => {
|
|
||||||
const url : string = await _espe.backend.member_summon(
|
|
||||||
id,
|
|
||||||
lib_plankton.zoo_page.encode(
|
|
||||||
{
|
|
||||||
"name": "member_register",
|
|
||||||
"parameters": {
|
|
||||||
"id": id,
|
|
||||||
"verification": "{{verification}}",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
);
|
|
||||||
if (_espe.conf.get().settings.test_mode) {
|
|
||||||
alert(lib_plankton.translate.get("page.member_view.misc.test_info", {"url": url}));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
alert(lib_plankton.translate.get("page.member_view.misc.summoned"));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]
|
|
||||||
)
|
|
||||||
*/
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
await form.setup(dom_fragment.querySelector(".member_view-form") as HTMLElement);
|
await form.setup(dom_fragment.querySelector(".member_view-form") as HTMLElement);
|
||||||
await form.input_write(
|
await form.input_write(
|
||||||
{
|
{
|
||||||
"name": member_data.name,
|
"name": member_data.name,
|
||||||
|
"label": member_data.label,
|
||||||
"groups": member_data.groups,
|
"groups": member_data.groups,
|
||||||
"enabled": member_data.enabled,
|
"enabled": member_data.enabled,
|
||||||
"email_address": member_data.email_address,
|
"email_address": member_data.email_address,
|
||||||
|
|
|
@ -237,7 +237,10 @@ namespace _espe.backend
|
||||||
Array<
|
Array<
|
||||||
{
|
{
|
||||||
id : int;
|
id : int;
|
||||||
|
preview : {
|
||||||
name : string;
|
name : string;
|
||||||
|
label : string;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
|
@ -258,6 +261,7 @@ namespace _espe.backend
|
||||||
) : Promise<
|
) : Promise<
|
||||||
{
|
{
|
||||||
name : string;
|
name : string;
|
||||||
|
label : string;
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
|
@ -275,6 +279,7 @@ namespace _espe.backend
|
||||||
export async function group_add(
|
export async function group_add(
|
||||||
group_object : {
|
group_object : {
|
||||||
name : string;
|
name : string;
|
||||||
|
label : string;
|
||||||
}
|
}
|
||||||
) : Promise<
|
) : Promise<
|
||||||
int
|
int
|
||||||
|
@ -296,8 +301,8 @@ namespace _espe.backend
|
||||||
*/
|
*/
|
||||||
export async function group_modify(
|
export async function group_modify(
|
||||||
group_id : int,
|
group_id : int,
|
||||||
group_object : {
|
group_object_data : {
|
||||||
name : string;
|
label : string;
|
||||||
}
|
}
|
||||||
) : Promise<
|
) : Promise<
|
||||||
void
|
void
|
||||||
|
@ -308,7 +313,7 @@ namespace _espe.backend
|
||||||
"PATCH",
|
"PATCH",
|
||||||
("/group/modify/" + group_id.toFixed(0)),
|
("/group/modify/" + group_id.toFixed(0)),
|
||||||
{
|
{
|
||||||
"data": group_object,
|
"data": group_object_data
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -325,6 +330,7 @@ namespace _espe.backend
|
||||||
id : int;
|
id : int;
|
||||||
preview : {
|
preview : {
|
||||||
name : string;
|
name : string;
|
||||||
|
label : string;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
@ -346,6 +352,7 @@ namespace _espe.backend
|
||||||
) : Promise<
|
) : Promise<
|
||||||
{
|
{
|
||||||
name : string;
|
name : string;
|
||||||
|
label : string;
|
||||||
email_address : (null | string);
|
email_address : (null | string);
|
||||||
groups : Array<int>;
|
groups : Array<int>;
|
||||||
enabled : boolean;
|
enabled : boolean;
|
||||||
|
@ -360,84 +367,12 @@ namespace _espe.backend
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export async function member_info(
|
|
||||||
id : int,
|
|
||||||
key : string
|
|
||||||
) : Promise<
|
|
||||||
{
|
|
||||||
name_real_value : string;
|
|
||||||
name_real_index : int;
|
|
||||||
name_login : string;
|
|
||||||
email_address_veiled : string;
|
|
||||||
email_address_nominal : string;
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{
|
|
||||||
return abstract_call(
|
|
||||||
"GET",
|
|
||||||
lib_plankton.string.coin(
|
|
||||||
"/member/info/{{id}}?key={{key}}",
|
|
||||||
{
|
|
||||||
"id": id.toFixed(0),
|
|
||||||
"key": key,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export async function member_register(
|
|
||||||
id : int,
|
|
||||||
verification : string,
|
|
||||||
data : {
|
|
||||||
email_use_veiled_address : boolean;
|
|
||||||
email_use_nominal_address : boolean;
|
|
||||||
email_redirect_to_private_address : boolean;
|
|
||||||
password : (null | string);
|
|
||||||
},
|
|
||||||
notification_target_url_template : string
|
|
||||||
) : Promise<
|
|
||||||
Array<
|
|
||||||
{
|
|
||||||
incident : string;
|
|
||||||
details : Record<string, any>;
|
|
||||||
}
|
|
||||||
>
|
|
||||||
>
|
|
||||||
{
|
|
||||||
return (
|
|
||||||
abstract_call(
|
|
||||||
"POST",
|
|
||||||
lib_plankton.string.coin(
|
|
||||||
"/member/register/{{id}}?key={{key}}",
|
|
||||||
{
|
|
||||||
"id": id.toFixed(0),
|
|
||||||
"key": verification,
|
|
||||||
}
|
|
||||||
),
|
|
||||||
{
|
|
||||||
"data": Object.assign(
|
|
||||||
data,
|
|
||||||
{"notification_target_url_template": notification_target_url_template}
|
|
||||||
),
|
|
||||||
"custom_response_handlers": {
|
|
||||||
409: (output_data_raw) => output_data_raw,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export async function member_modify(
|
export async function member_modify(
|
||||||
id : int,
|
id : int,
|
||||||
data : {
|
data : {
|
||||||
|
label : string;
|
||||||
email_address : (null | string);
|
email_address : (null | string);
|
||||||
groups : Array<int>;
|
groups : Array<int>;
|
||||||
enabled : boolean;
|
enabled : boolean;
|
||||||
|
@ -454,27 +389,6 @@ namespace _espe.backend
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export async function member_summon(
|
|
||||||
id : int,
|
|
||||||
url_template : string
|
|
||||||
) : Promise<string>
|
|
||||||
{
|
|
||||||
return (
|
|
||||||
abstract_call(
|
|
||||||
"POST",
|
|
||||||
("/member/summon/" + id.toFixed(0)),
|
|
||||||
{
|
|
||||||
"data": {
|
|
||||||
"url_template": url_template,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export async function member_password_change_initialize(
|
export async function member_password_change_initialize(
|
||||||
|
@ -537,9 +451,12 @@ namespace _espe.backend
|
||||||
Array<
|
Array<
|
||||||
{
|
{
|
||||||
id : int;
|
id : int;
|
||||||
|
preview : {
|
||||||
key : string;
|
key : string;
|
||||||
expiry : (null | int);
|
expiry : (null | int);
|
||||||
name_value : string;
|
name_value : string;
|
||||||
|
label_value : string;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
|
@ -565,6 +482,8 @@ namespace _espe.backend
|
||||||
expiry : (null | int);
|
expiry : (null | int);
|
||||||
name_changeable : boolean;
|
name_changeable : boolean;
|
||||||
name_value : string;
|
name_value : string;
|
||||||
|
label_changeable : boolean;
|
||||||
|
label_value : string;
|
||||||
email_address_changeable : boolean;
|
email_address_changeable : boolean;
|
||||||
email_address_value : (null | string);
|
email_address_value : (null | string);
|
||||||
groups_changeable : boolean;
|
groups_changeable : boolean;
|
||||||
|
@ -590,6 +509,8 @@ namespace _espe.backend
|
||||||
data : {
|
data : {
|
||||||
name_changeable : boolean;
|
name_changeable : boolean;
|
||||||
name_value : string;
|
name_value : string;
|
||||||
|
label_changeable : boolean;
|
||||||
|
label_value : string;
|
||||||
email_address_changeable : boolean;
|
email_address_changeable : boolean;
|
||||||
email_address_value : (null | string);
|
email_address_value : (null | string);
|
||||||
groups_changeable : boolean;
|
groups_changeable : boolean;
|
||||||
|
@ -627,6 +548,8 @@ namespace _espe.backend
|
||||||
{
|
{
|
||||||
name_changeable : boolean;
|
name_changeable : boolean;
|
||||||
name_value : string;
|
name_value : string;
|
||||||
|
label_changeable : boolean;
|
||||||
|
label_value : string;
|
||||||
email_address_changeable : boolean;
|
email_address_changeable : boolean;
|
||||||
email_address_value : (null | string);
|
email_address_value : (null | string);
|
||||||
groups_changeable : boolean;
|
groups_changeable : boolean;
|
||||||
|
@ -652,6 +575,7 @@ namespace _espe.backend
|
||||||
key : string,
|
key : string,
|
||||||
data : {
|
data : {
|
||||||
name : string;
|
name : string;
|
||||||
|
label : string;
|
||||||
groups : Array<int>;
|
groups : Array<int>;
|
||||||
email_address : (null | string);
|
email_address : (null | string);
|
||||||
password : string;
|
password : string;
|
||||||
|
@ -673,6 +597,7 @@ namespace _espe.backend
|
||||||
"key": key,
|
"key": key,
|
||||||
"data": {
|
"data": {
|
||||||
"name": data.name,
|
"name": data.name,
|
||||||
|
"label": data.label,
|
||||||
"groups": data.groups,
|
"groups": data.groups,
|
||||||
"email_address": data.email_address,
|
"email_address": data.email_address,
|
||||||
"password": data.password,
|
"password": data.password,
|
|
@ -37,8 +37,8 @@ ${dir_temp}/logic-unlinked.js: \
|
||||||
${dir_lib}/plankton/plankton.d.ts \
|
${dir_lib}/plankton/plankton.d.ts \
|
||||||
${dir_source}/logic/helpers.ts \
|
${dir_source}/logic/helpers.ts \
|
||||||
${dir_source}/logic/input_set.ts \
|
${dir_source}/logic/input_set.ts \
|
||||||
${dir_source}/logic/backend.ts \
|
${dir_source}/resources/backend.ts \
|
||||||
${dir_source}/logic/conf.ts \
|
${dir_source}/resources/conf.ts \
|
||||||
${dir_source}/pages/index/logic.ts \
|
${dir_source}/pages/index/logic.ts \
|
||||||
${dir_source}/pages/login/logic.ts \
|
${dir_source}/pages/login/logic.ts \
|
||||||
${dir_source}/pages/logout/logic.ts \
|
${dir_source}/pages/logout/logic.ts \
|
||||||
|
|
Loading…
Add table
Reference in a new issue