|
147 | 147 | </template> |
148 | 148 | </NcEmptyContent> |
149 | 149 | <!-- Offered even with zero results, so the user can reach external providers. --> |
150 | | - <div v-if="showConnectedServicesButton" class="unified-search-modal__connected-services"> |
151 | | - <NcButton variant="secondary" wide @click="toggleExternalResources"> |
152 | | - {{ connectedServicesLabel }} |
153 | | - </NcButton> |
154 | | - </div> |
| 150 | + <ConnectedServicesBar |
| 151 | + v-if="showConnectedServicesButton" |
| 152 | + :active="searchExternalResources" |
| 153 | + @toggle="toggleExternalResources" /> |
155 | 154 | </div> |
156 | 155 |
|
157 | 156 | <div |
|
237 | 236 | <!-- Last, so results that land are never pushed down. --> |
238 | 237 | <SearchResultSkeleton v-if="skeletonRows > 0" :rows="skeletonRows" /> |
239 | 238 | <!-- Connected-services opt-in. Toggling re-runs find() (searchExternalResources watcher). Hidden in detail view. --> |
240 | | - <div v-if="showConnectedServicesButton" class="unified-search-modal__connected-services"> |
241 | | - <NcButton variant="secondary" wide @click="toggleExternalResources"> |
242 | | - {{ connectedServicesLabel }} |
243 | | - </NcButton> |
244 | | - </div> |
| 239 | + <ConnectedServicesBar |
| 240 | + v-if="showConnectedServicesButton" |
| 241 | + :active="searchExternalResources" |
| 242 | + @toggle="toggleExternalResources" /> |
245 | 243 | </div> |
246 | 244 | </div> |
247 | 245 | <!-- `modal-mask` is how @nextcloud/vue's useHotKey guard recognises an open modal and |
@@ -279,6 +277,7 @@ import IconClose from 'vue-material-design-icons/Close.vue' |
279 | 277 | import IconDotsHorizontal from 'vue-material-design-icons/DotsHorizontal.vue' |
280 | 278 | import IconMagnify from 'vue-material-design-icons/Magnify.vue' |
281 | 279 | import IconShapeOutline from 'vue-material-design-icons/ShapeOutline.vue' |
| 280 | +import ConnectedServicesBar from './ConnectedServicesBar.vue' |
282 | 281 | import CustomDateRangeModal from './CustomDateRangeModal.vue' |
283 | 282 | import SearchableList from './SearchableList.vue' |
284 | 283 | import FilterChip from './SearchFilterChip.vue' |
@@ -324,6 +323,7 @@ export default defineComponent({ |
324 | 323 | IconMagnify, |
325 | 324 | IconShapeOutline, |
326 | 325 |
|
| 326 | + ConnectedServicesBar, |
327 | 327 | CustomDateRangeModal, |
328 | 328 | FilterChip, |
329 | 329 | NcActions, |
@@ -663,12 +663,6 @@ export default defineComponent({ |
663 | 663 | && !this.isBusy |
664 | 664 | }, |
665 | 665 |
|
666 | | - connectedServicesLabel() { |
667 | | - return this.searchExternalResources |
668 | | - ? t('core', 'Less from connected services') |
669 | | - : t('core', 'More from connected services') |
670 | | - }, |
671 | | -
|
672 | 666 | // The rendered rows flattened into a single list in visual order (filtered |
673 | 667 | // groups first, then the partial-matches groups), each with the DOM id of its |
674 | 668 | // option element. This is the index space the arrow keys walk; it must stay in |
@@ -1785,16 +1779,6 @@ export default defineComponent({ |
1785 | 1779 | justify-content: center; |
1786 | 1780 | } |
1787 | 1781 |
|
1788 | | - // End-of-list (and empty-state) connected-services opt-in. |
1789 | | - &__connected-services { |
1790 | | - display: flex; |
1791 | | - flex-wrap: wrap; |
1792 | | - // Stretch to panel width so the wide button fills it (the empty-state's centred column |
1793 | | - // would otherwise shrink it to content width). |
1794 | | - width: 100%; |
1795 | | - margin-block-start: calc(var(--default-grid-baseline) * 3); |
1796 | | - } |
1797 | | -
|
1798 | 1782 | // Directional glyphs (back arrow, more-from chevron) point the other way in RTL. |
1799 | 1783 | // :dir(rtl) tracks the computed direction, unlike an [dir=rtl] attribute selector. |
1800 | 1784 | &__rtl-icon:dir(rtl) { |
|
0 commit comments