Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applies accessible accordion to SearchKit, adds fallbacks #28441

Merged
merged 10 commits into from Dec 5, 2023
8 changes: 7 additions & 1 deletion css/civicrm.css
Expand Up @@ -2184,7 +2184,8 @@ div.crm-master-accordion-header a.helpicon {
.crm-container .crm-collapsible .collapsible-title,
.crm-container span.collapsed,
.crm-container a.collapsed,
.crm-container .crm-expand-row {
.crm-container .crm-expand-row,
.crm-container summary {
cursor: pointer;
}

Expand All @@ -2194,6 +2195,11 @@ div.crm-master-accordion-header a.helpicon {

/* Specific types of headers */

.crm-container summary:not(.crm-master-accordion-header, .crm-accordion-header) /* For older CMS themes not styling summary */ {
font-weight: bold;
padding: 0.75rem 0;
}

#crm-container .widget-content .crm-accordion-header {
background-color: #efefe5;
color: #080808;
Expand Down
9 changes: 4 additions & 5 deletions ext/search_kit/ang/crmSearchAdmin/compose.html
Expand Up @@ -74,15 +74,14 @@
</ul>
</div>
</div>
<fieldset id="crm-search-build-functions">
<legend ng-click="controls.showFunctions = !controls.showFunctions">
<i class="crm-i fa-caret-{{ !controls.showFunctions ? 'right' : 'down' }}"></i>
<details id="crm-search-build-functions">
<summary ng-click="controls.showFunctions = !controls.showFunctions">
{{:: ts('Field Transformations') }}
</legend>
</summary>
<div ng-if="!!controls.showFunctions">
<!-- Must use track by $index with an array of primitives, and manually refresh this loop when indexes change -->
<fieldset ng-repeat="col in $ctrl.savedSearch.api_params.select track by $index" ng-if="!$ctrl.isPseudoField(col)">
<crm-search-function class="form-inline" mode="select" expr="$ctrl.savedSearch.api_params.select[$index]"></crm-search-function>
</fieldset>
</div>
</fieldset>
</details>
11 changes: 5 additions & 6 deletions ext/search_kit/ang/crmSearchAdmin/resultsTable/debug.html
@@ -1,9 +1,8 @@
<fieldset id="crm-search-admin-debug">
<legend ng-click="$ctrl.showDebug = !$ctrl.showDebug">
<i class="crm-i fa-caret-{{ !$ctrl.showDebug ? 'right' : 'down' }}"></i>
<details id="crm-search-admin-debug">
<summary>
{{:: ts('Query Info') }}
</legend>
<div ng-if="$ctrl.showDebug">
</summary>
<div>
<pre ng-if="$ctrl.debug.timeIndex">{{ ts('Request took %1 seconds.', {1: $ctrl.debug.timeIndex}) }}</pre>
<div>
<strong>API:</strong>
Expand All @@ -15,4 +14,4 @@
<pre ng-repeat="query in $ctrl.debug.sql">{{ query }}</pre>
</div>
</div>
</fieldset>
</details>