Skip to content

Commit

Permalink
YDA-5266: disable password label field after generation
Browse files Browse the repository at this point in the history
  • Loading branch information
lwesterhof committed Aug 2, 2023
1 parent c5ff3fd commit dd8a545
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion user/static/user/js/data_access.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ $(document).ready(function () {
const button = document.getElementById('generateButton')
const token = document.getElementById('tokenField')
button.setAttribute('hidden', true)
const label = document.getElementById('f-token-label')
label.setAttribute('disabled', true)

Yoda.call('token_delete_expired', {}).then(response => {
return Yoda.call('token_generate', { label }, { quiet: true }).then(
(data) => {
$('#f-token').val(data)
const p = document.getElementById('passwordOk')
p.removeAttribute('hidden')
token.removeAttribute('hidden')
token.removeAttribute('hidden')
},
(error) => {
let errorId = 'passwordGenerateError'
Expand All @@ -38,6 +40,7 @@ $(document).ready(function () {
p.removeAttribute('hidden')
button.removeAttribute('hidden')
token.setAttribute('hidden', true)
label.removeAttribute('disabled')
}
)
})
Expand Down
4 changes: 2 additions & 2 deletions user/templates/user/data_access.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ <h5 class="modal-title" id="dataAccessPassword">Generate new data access passwor
required>
</div>
</div>
<div id="tokenField" class="form-group row" hidden="">
<div id="tokenField" class="form-group row" hidden>
<label class="col-sm-3 col-form-label" for="f-token">Password</label>
<div class="col-sm-7">
<input
id="f-token"
class="form-control"
type="text"
readonly>
disabled>
</div>
<div class="col-sm-2">
<button type="button" class="btn btn-secondary btn-copy-to-clipboard">
Expand Down

0 comments on commit dd8a545

Please sign in to comment.