Skip to content

Commit

Permalink
fix: general cleanup and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tchapi committed Sep 3, 2023
1 parent 2c99add commit 598d8da
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
7 changes: 1 addition & 6 deletions public/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,10 @@ deleteModals.forEach(element => {
const addDelegateModal = document.getElementById('addDelegateModal')
if (addDelegateModal) {
addDelegateModal.addEventListener('show.bs.modal', event => {
// Button that triggered the modal
const button = event.relatedTarget

// Grab target url
let targetUrl = button.getAttribute('data-href');

// When adding the sharee, catch the click to add the query parameter
const addDelegateButton = document.getElementById('addDelegateModal-cta');
addDelegateButton.addEventListener("click", function(e) {
const targetUrl = addDelegateButton.getAttribute('data-href');
const writeAccess = document.getElementById('addDelegateModal-writeAccess').checked ? 'true' : 'false';
const principalId = document.getElementById('addDelegateModal-member').value;

Expand Down
2 changes: 1 addition & 1 deletion templates/_partials/add_delegate_modal.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">{{ "cancel"|trans }}</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ "cancel"|trans }}</button>
<a data-href="{{ path('user_delegate_add', {username: principal.username}) }}" href="#" class="btn btn-primary" id="addDelegateModal-cta">{{ "add"|trans }}</a>
</div>
</div>
Expand Down
7 changes: 6 additions & 1 deletion templates/_partials/delegate_row.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
{% endif %}
</h5>
<div class="me-0 text-right d-lg-block d-none">
<a href="#" data-href="{{ path('user_delegate_remove',{username: principal.username, principalProxyId: has_write ? principalProxyWrite.id : principalProxyRead.id, delegateId: delegate.id})}}" data-flavour="delegates" class="btn btn-sm btn-outline-danger ms-1 mb-1 delete-modal">⚠&nbsp;{{ "remove"|trans }}</a>
<a href="#"
data-bs-toggle="modal" data-bs-target="#deleteModal-delegates"
data-href="{{ path('user_delegate_remove',{username: principal.username, principalProxyId: has_write ? principalProxyWrite.id : principalProxyRead.id, delegateId: delegate.id})}}"
data-flavour="delegates"
class="btn btn-sm btn-outline-danger ms-1 mb-1"
>⚠&nbsp;{{ "remove"|trans }}</a>
</div>
</div>
<p class="mb-1">{{ "users.username"|trans }} : <code>{{ delegate.username }}</code></p>
Expand Down
2 changes: 1 addition & 1 deletion templates/_partials/delete_modal.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<p>{{ (flavour ~ ".modal.text")|trans }}</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">{{ "cancel"|trans }}</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ "cancel"|trans }}</button>
<a href="#" type="button" class="btn btn-primary" id="deleteModal-{{ flavour }}-cta">{{ "yes"|trans }}</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/_partials/share_modal.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">{{ "cancel"|trans }}</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ "cancel"|trans }}</button>
<a href="#" id="shareModal-addSharee" class="btn btn-primary{% if principals|length == 0 %} disabled{% endif %}">{{ "add"|trans }}</a>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions tests/Functional/DashboardTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ public function testIndexPage(): void
$this->assertResponseIsSuccessful();
$this->assertSelectorTextContains('h3', 'Davis');

$this->assertSelectorExists('div.caldav');
$this->assertSelectorExists('div.carddav');
$this->assertSelectorExists('div.webdav');
$this->assertSelectorExists('li.caldav');
$this->assertSelectorExists('li.carddav');
$this->assertSelectorExists('li.webdav');
}

public function testDashboardPageUnlogged(): void
Expand Down

0 comments on commit 598d8da

Please sign in to comment.