Skip to content

Commit

Permalink
fixing controlled and registred bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
costero-e committed Nov 7, 2023
1 parent c90be9a commit 9d4393d
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 45 deletions.
1 change: 1 addition & 0 deletions permissions/controlled_datasets.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
controlled_datasets:
- nothing
- vamos
- dataset1
19 changes: 2 additions & 17 deletions permissions/permissions-ui/media/app2.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const btnAdd2 = document.querySelector('#btnAdd2');
const btnRemove = document.querySelector('#btnRemove');
const datasets = document.querySelector('#list_datasets');
const framework = document.querySelector('#framework');
const datasets = document.querySelector('#datasets');
const listbox = document.querySelector('#list');
btnAdd2.onclick = (e) => {
e.preventDefault();

Expand All @@ -24,21 +24,6 @@ btnAdd2.onclick = (e) => {
listbox.add(option, undefined);
}
// create a new option

if (framework.value == '') {
alert('Please enter the name.');
return;
}

// create a new option
const option = new Option(framework.value, framework.value);
option.setAttribute('selected', 'selected');
// add it to the list
listbox.add(option, undefined);

// reset the value of the input
framework.value = '';
framework.focus();



Expand Down
27 changes: 14 additions & 13 deletions permissions/permissions-ui/templates/controlled.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,19 @@
<div><h2 style="color: #760509;">Controlled datasets manager</h2></div>
<form method="post">
{% csrf_token %}
<label for="framework">Dataset:</label>
<input type="text" id="framework" placeholder="Enter a controlled dataset" autocomplete="off">

<button id="btnAdd">Add</button>

<label for="list">Controlled Datasets List:</label>
<select id="list" name="list" multiple>
{% for item in bash_out %}
<option value="{{item}}" selected="selected">{{item}}</option>
{% endfor %}
</select>
<button id="btnRemove">Remove Dataset</button>
<label for="datasets">Dataset:</label>

<select id="datasets" name="datasets" multiple>
<option value="dataset1" selected="selected">dataset1</option>
</select>
<button id="btnAdd2">Add</button>
<label for="list">Public Datasets List:</label>
<select id="list" name="list" multiple>
{% for item in bash_out %}
<option value="{{item}}" selected="selected">{{item}}</option>
{% endfor %}
</select>
<button id="btnRemove">Remove Dataset</button>
<div class="col-5">
<button type="submit" class="btn btn-success mb-3">Add datasets</button>
</div>
Expand Down Expand Up @@ -130,6 +131,6 @@
}

</script>
<script src="media/app.js"></script>
<script src="media/app2.js"></script>
</body>
</html>
4 changes: 2 additions & 2 deletions permissions/permissions-ui/templates/public.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<select id="datasets" name="datasets" multiple>
<option value="dataset1" selected="selected">dataset1</option>
</select>
<button id="btnAdd">Add</button>
<button id="btnAdd2">Add</button>
<label for="list">Public Datasets List:</label>
<select id="list" name="list" multiple>
{% for item in bash_out %}
Expand Down Expand Up @@ -131,6 +131,6 @@
}

</script>
<script src="media/app.js"></script>
<script src="media/app2.js"></script>
</body>
</html>
3 changes: 2 additions & 1 deletion permissions/permissions-ui/templates/registered.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<span class="navbar-text ">
<img src="media/logo.png" alt="EGA" height="70px">
</span>
<a class="navbar-brand " href="/"><h1 class="bi bi-patch-check display-6 mx-auto p-2 fw-bold ms-5" style="color: #239B56;">Beacon Verifier</h1></a>
<a class="navbar-brand " href="/"><h1 class="bi bi-kanban display-6 mx-auto p-2 fw-bold ms-5" style="color: #760509;"> Beacon Admin Page</h1></a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
Expand Down Expand Up @@ -55,6 +55,7 @@
</button>
</div>
<div id="boxdatasets">
<div><h2 style="color: #760509;">Registered datasets manager</h2></div>
<form method="post">
{% csrf_token %}
<label for="framework">Add a new user to the list:</label>
Expand Down
1 change: 1 addition & 0 deletions permissions/public_datasets.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
public_datasets:
- CINECA_synthetic_cohort_EUROPE_UK1
- dataset1
12 changes: 0 additions & 12 deletions permissions/registered_datasets.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
app-user3:
- CINECA_synthetic_cohort_EUROPE_UK1
gemma_test:
- CINECA_synthetic_cohort_EUROPE_UK1
hola:
- CINECA_synthetic_cohort_EUROPE_UK1
jane:
- CINECA_synthetic_cohort_EUROPE_UK1
jofrdo:
- CINECA_synthetic_cohort_EUROPE_UK1
john:
- CINECA_synthetic_cohort_EUROPE_UK1
new_user:
- CINECA_synthetic_cohort_EUROPE_UK1
usuari_creat:
- CINECA_synthetic_cohort_EUROPE_UK1

0 comments on commit 9d4393d

Please sign in to comment.