Skip to content

Commit

Permalink
revert: "refactor: tab-hash component"
Browse files Browse the repository at this point in the history
This reverts commit 0c6e186.
It left dynamic tabs broken.
  • Loading branch information
arildm committed Sep 11, 2024
1 parent 0c6e186 commit 088d72b
Show file tree
Hide file tree
Showing 6 changed files with 199 additions and 224 deletions.
197 changes: 96 additions & 101 deletions app/scripts/components/results.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import "@/components/korp-error"
import "@/components/kwic"
import "@/components/statistics"
import "@/components/sidebar"
import "@/components/tab-hash"
import "@/components/word-picture"
import "@/directives/tab-hash"
import "@/directives/tab-preloader"

angular.module("korpApp").component("results", {
Expand All @@ -21,110 +21,105 @@ angular.module("korpApp").component("results", {
<div id="results-wrapper" ng-show="$ctrl.hasResult()">
<div class="flex" id="columns" ng-class="{sidebar_visible : $ctrl.sidebarVisible}">
<div class="overflow-auto grow" id="left-column">
<tab-hash key="result_tab">
<uib-tabset class="tabbable result_tabs" active="activeTab">
<uib-tab kwic-ctrl index="0" select="onentry()" deselect="onexit()">
<uib-tab-heading ng-class="{not_loading: progress > 99, loading : loading}"
>KWIC<tab-preloader
ng-if="loading"
value="progress"
spinner="countCorpora() < 2"
></tab-preloader>
</uib-tab-heading>
<div
class="results-kwic"
ng-class="{reading_mode : reading_mode, loading: loading}"
>
<korp-error ng-if="error"></korp-error>
<kwic
ng-if="!error"
aborted="aborted"
loading="loading"
active="active"
hits-in-progress="hitsInProgress"
hits="hits"
kwic-input="kwic"
corpus-hits="corpusHits"
is-reading="reading_mode"
page="page"
page-event="pageChange"
context-change-event="toggleReading"
hits-per-page="hitsPerPage"
prev-params="proxy.prevParams"
prev-request="proxy.prevRequest"
corpus-order="corpusOrder"
></kwic>
</div>
</uib-tab>
<uib-tab
stats-result-ctrl
ng-if="$root._settings.statistics != false"
select="onentry()"
deselect="onexit()"
index="2"
>
<uib-tab-heading ng-class="{not_loading: progress > 99, loading : loading}"
>{{'statistics' | loc:$root.lang}}
<tab-preloader
ng-if="loading"
value="progress"
spinner="countCorpora() < 2"
></tab-preloader>
</uib-tab-heading>
<uib-tabset class="tabbable result_tabs" tab-hash="result_tab" active="activeTab">
<uib-tab kwic-ctrl index="0" select="onentry()" deselect="onexit()">
<uib-tab-heading ng-class="{not_loading: progress > 99, loading : loading}"
>KWIC<tab-preloader
ng-if="loading"
value="progress"
spinner="countCorpora() < 2"
></tab-preloader>
</uib-tab-heading>
<div class="results-kwic" ng-class="{reading_mode : reading_mode, loading: loading}">
<korp-error ng-if="error"></korp-error>
<statistics
<kwic
ng-if="!error"
aborted="aborted"
activate="activate"
columns="columns"
data="data"
error="error"
grid-data="gridData"
has-result="hasResult"
in-order="inOrder"
loading="loading"
no-hits="no_hits"
active="active"
hits-in-progress="hitsInProgress"
hits="hits"
kwic-input="kwic"
corpus-hits="corpusHits"
is-reading="reading_mode"
page="page"
page-event="pageChange"
context-change-event="toggleReading"
hits-per-page="hitsPerPage"
prev-params="proxy.prevParams"
search-params="searchParams"
show-statistics="showStatistics"
></statistics>
</uib-tab>
<uib-tab
ng-if="$root._settings['word_picture'] != false"
wordpic-ctrl
index="3"
select="onentry()"
deselect="onexit()"
>
<uib-tab-heading ng-class="{not_loading: progress > 99, loading : loading}">
{{'word_picture' | loc:$root.lang}}
<tab-preloader
ng-if="loading"
value="progress"
spinner="countCorpora() < 2"
></tab-preloader>
</uib-tab-heading>
<div ng-if="!error">
<word-picture
data="data"
word-pic="wordPic"
activate="activate"
loading="loading"
has-data="hasData"
aborted="aborted"
hit-settings="hitSettings"
settings="settings"
no-hits="noHits"
></word-picture>
</div>
<korp-error ng-if="error"></korp-error>
</uib-tab>
<kwic-tabs tabs="$root.kwicTabs"></kwic-tabs>
<graph-tabs tabs="$root.graphTabs"></graph-tabs>
<compare-tabs tabs="$root.compareTabs"></compare-tabs>
<map-tabs tabs="$root.mapTabs"></map-tabs>
<text-tabs tabs="$root.textTabs"></text-tabs>
</uib-tabset>
</tab-hash>
prev-request="proxy.prevRequest"
corpus-order="corpusOrder"
></kwic>
</div>
</uib-tab>
<uib-tab
stats-result-ctrl
ng-if="$root._settings.statistics != false"
select="onentry()"
deselect="onexit()"
index="2"
>
<uib-tab-heading ng-class="{not_loading: progress > 99, loading : loading}"
>{{'statistics' | loc:$root.lang}}
<tab-preloader
ng-if="loading"
value="progress"
spinner="countCorpora() < 2"
></tab-preloader>
</uib-tab-heading>
<korp-error ng-if="error"></korp-error>
<statistics
aborted="aborted"
activate="activate"
columns="columns"
data="data"
error="error"
grid-data="gridData"
has-result="hasResult"
in-order="inOrder"
loading="loading"
no-hits="no_hits"
prev-params="proxy.prevParams"
search-params="searchParams"
show-statistics="showStatistics"
></statistics>
</uib-tab>
<uib-tab
ng-if="$root._settings['word_picture'] != false"
wordpic-ctrl
index="3"
select="onentry()"
deselect="onexit()"
>
<uib-tab-heading ng-class="{not_loading: progress > 99, loading : loading}">
{{'word_picture' | loc:$root.lang}}
<tab-preloader
ng-if="loading"
value="progress"
spinner="countCorpora() < 2"
></tab-preloader>
</uib-tab-heading>
<div ng-if="!error">
<word-picture
data="data"
word-pic="wordPic"
activate="activate"
loading="loading"
has-data="hasData"
aborted="aborted"
hit-settings="hitSettings"
settings="settings"
no-hits="noHits"
></word-picture>
</div>
<korp-error ng-if="error"></korp-error>
</uib-tab>
<kwic-tabs tabs="$root.kwicTabs"></kwic-tabs>
<graph-tabs tabs="$root.graphTabs"></graph-tabs>
<compare-tabs tabs="$root.compareTabs"></compare-tabs>
<map-tabs tabs="$root.mapTabs"></map-tabs>
<text-tabs tabs="$root.textTabs"></text-tabs>
</uib-tabset>
<a id="json-link" ng-href="{{$root.jsonUrl}}" ng-show="$root.jsonUrl" target="_blank">
<img src="img/json.png" />
</a>
Expand Down
50 changes: 24 additions & 26 deletions app/scripts/components/searchtabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,37 @@ import "@/components/extended/extended-standard"
import "@/components/extended/extended-parallel"
import "@/components/advanced-search"
import "@/components/compare-search"
import "@/components/tab-hash"
import "@/directives/click-cover"
import "@/directives/reduce-select"
import "@/directives/tab-hash"

angular.module("korpApp").component("searchtabs", {
template: html`
<div click-cover="$ctrl.noCorporaSelected">
<tab-hash key="search_tab">
<uib-tabset class="tabbable search_tabs" active="activeTab">
<uib-tab heading='{{"simple" | loc:$root.lang}}' ng-if="$ctrl.visibleTabs[0]">
<simple-search></simple-search>
</uib-tab>
<uib-tab class="extended" heading='{{"detailed" | loc:$root.lang}}' ng-if="$ctrl.visibleTabs[1]">
<div>
<extended-standard ng-if="!$ctrl.parallelMode"></extended-standard>
<extended-parallel ng-if="$ctrl.parallelMode"></extended-parallel>
</div>
</uib-tab>
<uib-tab heading='{{"advanced" | loc:$root.lang}}' ng-if="$ctrl.visibleTabs[2]">
<advanced-search></advanced-search>
</uib-tab>
<uib-tab ng-if="$ctrl.visibleTabs[3]">
<uib-tab-heading>
{{'compare' | loc:$root.lang}}
<span class="badge" ng-if="$ctrl.savedSearches.length">{{$ctrl.savedSearches.length}}</span>
</uib-tab-heading>
<compare-search></compare-search>
</uib-tab>
<div class="flex justify-end items-center">
<select class="hidden md_block shrink min-w-0 m-1" id="search_history"></select>
<uib-tabset class="tabbable search_tabs" tab-hash="search_tab" active="activeTab">
<uib-tab heading='{{"simple" | loc:$root.lang}}' ng-if="$ctrl.visibleTabs[0]">
<simple-search></simple-search>
</uib-tab>
<uib-tab class="extended" heading='{{"detailed" | loc:$root.lang}}' ng-if="$ctrl.visibleTabs[1]">
<div>
<extended-standard ng-if="!$ctrl.parallelMode"></extended-standard>
<extended-parallel ng-if="$ctrl.parallelMode"></extended-parallel>
</div>
</uib-tabset>
</tab-hash>
</uib-tab>
<uib-tab heading='{{"advanced" | loc:$root.lang}}' ng-if="$ctrl.visibleTabs[2]">
<advanced-search></advanced-search>
</uib-tab>
<uib-tab ng-if="$ctrl.visibleTabs[3]">
<uib-tab-heading>
{{'compare' | loc:$root.lang}}
<span class="badge" ng-if="$ctrl.savedSearches.length">{{$ctrl.savedSearches.length}}</span>
</uib-tab-heading>
<compare-search></compare-search>
</uib-tab>
<div class="flex justify-end items-center">
<select class="hidden md_block shrink min-w-0 m-1" id="search_history"></select>
</div>
</uib-tabset>
<div
class="flex items-baseline bg-blue-100 border border-blue-200 shadow-inner"
id="search_options"
Expand Down
93 changes: 0 additions & 93 deletions app/scripts/components/tab-hash.ts

This file was deleted.

Loading

0 comments on commit 088d72b

Please sign in to comment.