-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from quantcdn/feature/issue-58-facet-ordering
[ISSUE-58] Add tabledrag table to search facet configuration.
- Loading branch information
Showing
7 changed files
with
139 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
.quant-search-page-edit-form #edit-facets td { | ||
width: 20%; | ||
} | ||
|
||
.quant-search-page-edit-form #edit-facets td input[type=submit] { | ||
min-width: 155px; | ||
} | ||
|
||
.quant-search-page-edit-form #edit-facets .facet-remove { | ||
margin-top: 2.25rem; | ||
} | ||
|
||
.quant-search-page-edit-form #edit-facets .facet-add { | ||
display: block; | ||
} | ||
|
||
@media (max-width: 1100px) { | ||
|
||
.quant-search-page-edit-form #edit-facets td { | ||
display: block; | ||
width: auto; | ||
height: auto; | ||
margin-left: 1rem; | ||
} | ||
|
||
.quant-search-page-edit-form #edit-facets td.tabledrag-cell { | ||
margin-left: auto; | ||
} | ||
|
||
.quant-search-page-edit-form #edit-facets td.tabledrag-cell div { | ||
width: calc(100% + .25rem); | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Contains install and update functions for Quant Search. | ||
*/ | ||
|
||
/** | ||
* Group search page facet_type configuration. | ||
*/ | ||
function quant_search_update_8101() { | ||
// Get all search pages. | ||
$storage = \Drupal::entityTypeManager()->getStorage('quant_search_page'); | ||
$ids = \Drupal::entityQuery('quant_search_page')->execute(); | ||
$pages = $storage->loadMultiple($ids); | ||
|
||
// Combine facet_type configuration fields for better tabledrag UX. | ||
foreach ($pages as $page) { | ||
$facets = $page->get('facets'); | ||
$fields = ['facet_type', 'custom_key', 'taxonomy_vocabulary']; | ||
foreach ($facets as $i => $facet) { | ||
foreach ($fields as $field) { | ||
if (isset($facet[$field])) { | ||
$facets[$i]['facet_type_config'][$field] = $facet[$field]; | ||
unset($facets[$i][$field]); | ||
} | ||
} | ||
$page->set('facets', $facets); | ||
} | ||
$page->save(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters