New modal to permit admin select user repo for work
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
1859a715df
commit
f79c7b43cd
4 changed files with 51 additions and 11 deletions
|
|
@ -18,6 +18,7 @@
|
|||
import DateFormat from '../../../components/DateFormat.svelte';
|
||||
import SubmissionStatus from '../../../components/SubmissionStatus.svelte';
|
||||
import SurveyBadge from '../../../components/SurveyBadge.svelte';
|
||||
import WorkRepository from '../../../components/WorkRepository.svelte';
|
||||
import { getRepositories } from '../../../lib/repositories';
|
||||
import { ToastsStore } from '../../../stores/toasts';
|
||||
import { getUsers } from '../../../lib/users';
|
||||
|
|
@ -38,6 +39,7 @@
|
|||
|
||||
let show_logs = null;
|
||||
let run_pull_for = {repo: null, user: null, tag: null};
|
||||
let search_repo_for = {repo: null, user: null};
|
||||
</script>
|
||||
|
||||
{#await work then w}
|
||||
|
|
@ -96,7 +98,16 @@
|
|||
{/each}
|
||||
</div>
|
||||
{:catch err}
|
||||
-
|
||||
<div class="d-flex justify-content-between">
|
||||
-
|
||||
<button
|
||||
class="btn btn-sm btn-info mx-1"
|
||||
title="Choisir un dépôt"
|
||||
on:click={() => { search_repo_for = { repo: null, user, modal: new bootstrap.Modal(document.getElementById('repoModal'))}; search_repo_for.modal.show(); }}
|
||||
>
|
||||
<i class="bi bi-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
{/await}
|
||||
</td>
|
||||
<td>
|
||||
|
|
@ -136,6 +147,22 @@
|
|||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" tabindex="-1" id="repoModal">
|
||||
<div class="modal-dialog">
|
||||
<form class="modal-content" on:submit|preventDefault={() => {search_repo_for.modal.hide(); try { search_repo_for.repo.retrieveWork(run_pull_for.tag) } catch(err) { ToastsStore.addToast({color: "danger", title: "Connexion impossible", msg: err}) }; search_repo_for.user = null; }}>
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Repository selector {#if search_repo_for.user}{search_repo_for.user.login}{/if}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{#if search_repo_for.user}
|
||||
<WorkRepository work={w} user={search_repo_for.user} />
|
||||
{/if}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{/await}
|
||||
|
||||
<div class="modal fade" tabindex="-1" id="logsModal">
|
||||
|
|
|
|||
Reference in a new issue