|
|
@@ -14,6 +14,7 @@ class ShareData {
|
|
|
dbId = 0;
|
|
|
typeId = "";
|
|
|
typeData = "";
|
|
|
+ typeLabel = "";
|
|
|
accessToId = 0;
|
|
|
accessToData = "";
|
|
|
grant = 0;
|
|
|
@@ -23,6 +24,7 @@ class ShareData {
|
|
|
this.dbId = data.id;
|
|
|
this.typeId = [ "unknown", "ldapAccount", "email", "link", "every one" ].indexOf(data.type);
|
|
|
this.typeData = data.typeData;
|
|
|
+ this.typeLabel = data.typeLabel;
|
|
|
this.accessToId = [ "unknown", "item", "tag", "meta", "everything", "admin"].indexOf(data.accessTo);
|
|
|
this.accessToData = data.accessToData;
|
|
|
this.grant = [ "none", "read", "write", "read without meta"].indexOf(data.grant);
|
|
|
@@ -34,6 +36,7 @@ class ShareData {
|
|
|
id: this.dbId,
|
|
|
type: [ "unknown", "ldapAccount", "email", "link", "every one" ][this.typeId],
|
|
|
typeData: this.typeData,
|
|
|
+ typeLabel: this.typeLabel,
|
|
|
accessTo: [ "unknown", "item", "tag", "meta", "everything", "admin"][this.accessToId],
|
|
|
accessToData: this.accessToData,
|
|
|
grant: [ "none", "read", "write", "read without meta"][this.grant]
|
|
|
@@ -141,7 +144,7 @@ async function buildShareItem(data) {
|
|
|
headerButton.type = "button";
|
|
|
headerButton.dataset.bsToggle = "collapse";
|
|
|
headerButton.dataset.bsTarget = `#${htmlId}`;
|
|
|
- headerButton.textContent = data.typeData;
|
|
|
+ headerButton.textContent = data.typeLabel || data.typeData;
|
|
|
headerButton.ariaExpanded = false;
|
|
|
headerButton.ariaControls = htmlId;
|
|
|
let accordionBodyContainer = document.createElement("div");
|
|
|
@@ -342,6 +345,7 @@ async function createShareData(typeId, typeData) {
|
|
|
let share = new ShareData();
|
|
|
share.typeId = typeId;
|
|
|
share.typeData = typeData;
|
|
|
+ share.typeLabel = "";
|
|
|
share.accessToId = 0;
|
|
|
share.grant = 0;
|
|
|
share = await createData(share);
|