Skip to content

Commit 3f9ecef

Browse files
committed
Add new Temporal export button
1 parent c67d559 commit 3f9ecef

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
'''
44
from .plugin import *
55

6-
__version__ = "1.0.0"
6+
__version__ = "1.0.1"

js/bccm-customizations.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import config from '/sitemedia/js/bccm-config.js';
22

3-
console.log(`bccm-customizations.js executing`)
3+
console.log(`bccm-customizations.js executing`)
44

55
var filterdUserGroup = config.ruleButtonPlugin.userGroups.filter(filterUserGroups);
66

@@ -11,6 +11,18 @@ fetch('/API/v2/items/' + manualRulePluginContext.item_id + '/metadata/').then(re
1111
//generates Button and adds EventListener
1212

1313
function addManualRuleButton() {
14+
15+
if (manualRulePluginContext.user_groups.includes("Admin")) {
16+
let manualRuleButton = document.createElement("button");
17+
manualRuleButton.innerHTML = "Temportal Export";
18+
manualRuleButton.type = "button";
19+
manualRuleButton.setAttribute("class", "green");
20+
document.getElementById("ManualRuleButtonDIV").appendChild(manualRuleButton);
21+
manualRuleButton.onclick = function() {
22+
window.open('https://export.lan.bcc.media/vx-export?id=' + manualRulePluginContext.item_id, '_blank');
23+
}
24+
}
25+
1426
for (var i = 0; i < filterdUserGroup.length; i++) {
1527
for (var x = 0; x < filterdUserGroup[i].buttons.length; x++) {
1628

@@ -21,7 +33,7 @@ function addManualRuleButton() {
2133
manualRuleButton.innerHTML = buttonConfig.label;
2234
manualRuleButton.type = "button";
2335
manualRuleButton.setAttribute("class", buttonConfig.button_colour);
24-
document.getElementById("ManualRuleButtonDIV").appendChild(manualRuleButton);
36+
document.getElementById("ManualRuleButtonDIV").appendChild(manualRuleButton);
2537

2638
manualRuleButton.onclick = function() {
2739
this.innerHTML = "working..."
@@ -47,7 +59,7 @@ function addManualRuleButton() {
4759
}
4860
});
4961
}
50-
}
62+
}
5163
}
5264
}
5365

@@ -58,7 +70,7 @@ function filterUserGroups(userGroup) {
5870
if (userGroup.name == manualRulePluginContext.user_groups[i] ) {
5971
return true
6072
}
61-
}
73+
}
6274
}
6375

6476

@@ -112,4 +124,4 @@ function waitForElm(selector, callback) {
112124

113125
waitForElm('#ManualRuleButtonDIV', function(){
114126
addManualRuleButton();
115-
});
127+
});

0 commit comments

Comments
 (0)