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

Navigator gets data from IndexStore #896

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 38 additions & 42 deletions src/components/DocumentationLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,46 +30,44 @@
>
<PortalTarget name="modal-destination" multiple />
<template #aside="{ scrollLockID, breakpoint }">
<NavigatorDataProvider
:interface-language="interfaceLanguage"
:technologyUrl="technology ? technology.url : ''"
:api-changes-version="selectedAPIChangesVersion"
ref="NavigatorDataProvider"
>
<template #default="slotProps">
<div class="documentation-layout-aside">
<QuickNavigationModal
v-if="enableQuickNavigation"
:children="indexNodes"
:showQuickNavigationModal.sync="showQuickNavigationModal"
:technology="technology ? technology.title : ''"
/>
<transition name="delay-hiding">
<Navigator
v-show="sidenavVisibleOnMobile || breakpoint === BreakpointName.large"
:flatChildren="slotProps.flatChildren"
:parent-topic-identifiers="parentTopicIdentifiers"
:technology="slotProps.technology || technology"
:is-fetching="slotProps.isFetching"
:error-fetching="slotProps.errorFetching"
:api-changes="slotProps.apiChanges"
:references="references"
:navigator-references="slotProps.references"
:scrollLockID="scrollLockID"
:render-filter-on-top="breakpoint !== BreakpointName.large"
@close="handleToggleSidenav(breakpoint)"
>
<template v-if="enableQuickNavigation" #filter>
<QuickNavigationButton @click.native="openQuickNavigationModal" />
</template>
<template #navigator-head="{ className }">
<slot name="nav-title" :className="className" />
</template>
</Navigator>
</transition>
</div>
</template>
</NavigatorDataProvider>
<div class="documentation-layout-aside">
<QuickNavigationModal
v-if="enableQuickNavigation"
:children="indexNodes"
:showQuickNavigationModal.sync="showQuickNavigationModal"
:technology="technology ? technology.title : ''"
/>
<transition name="delay-hiding">
<slot
name="navigator"
v-bind="{
scrollLockID,
breakpoint,
sidenavVisibleOnMobile,
handleToggleSidenav,
enableQuickNavigation,
openQuickNavigationModal,
}"
>
<Navigator
v-show="sidenavVisibleOnMobile || breakpoint === BreakpointName.large"
v-bind="{ ...navigatorProps, ...technologyProps }"
:parent-topic-identifiers="parentTopicIdentifiers"
:references="references"
:scrollLockID="scrollLockID"
:render-filter-on-top="breakpoint !== BreakpointName.large"
@close="handleToggleSidenav(breakpoint)"
>
<template v-if="enableQuickNavigation" #filter>
<QuickNavigationButton @click.native="openQuickNavigationModal" />
</template>
<template #navigator-head="{ className }">
<slot name="nav-title" :className="className" />
</template>
</Navigator>
</slot>
</transition>
</div>
</template>
<slot name="content" />
</AdjustableSidebarWidth>
Expand All @@ -88,7 +86,6 @@ import { storage } from 'docc-render/utils/storage';
import { getSetting } from 'docc-render/utils/theme-settings';

import indexDataGetter from 'docc-render/mixins/indexDataGetter';
import NavigatorDataProvider from 'theme/components/Navigator/NavigatorDataProvider.vue';
import DocumentationNav from 'theme/components/DocumentationTopic/DocumentationNav.vue';

const NAVIGATOR_HIDDEN_ON_LARGE_KEY = 'navigator-hidden-large';
Expand All @@ -99,7 +96,6 @@ export default {
components: {
Navigator,
AdjustableSidebarWidth,
NavigatorDataProvider,
Nav: DocumentationNav,
QuickNavigationButton,
QuickNavigationModal,
Expand Down
9 changes: 1 addition & 8 deletions src/components/Navigator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default {
type: Array,
required: true,
},
technology: {
technologyProps: {
type: Object,
required: false,
},
Expand Down Expand Up @@ -153,13 +153,6 @@ export default {
* The root item is always a module
*/
type: () => TopicTypes.module,
technologyProps: ({ technology }) => (
!technology ? null : {
technology: technology.title,
technologyPath: technology.path || technology.url,
isTechnologyBeta: technology.beta,
}
),
},
};
</script>
Expand Down
125 changes: 0 additions & 125 deletions src/components/Navigator/NavigatorDataProvider.vue

This file was deleted.

2 changes: 0 additions & 2 deletions src/mixins/indexDataGetter.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,12 @@ export default {
apiChanges,
errorFetching,
},
technologyProps,
}) => ({
flatChildren: indexNodes,
navigatorReferences: references,
apiChanges,
isFetching: !flatChildren && !errorFetching,
errorFetching,
technologyProps,
}),
},
data() {
Expand Down
2 changes: 1 addition & 1 deletion src/views/DocumentationTopic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import {
shouldFetchDataForRouteUpdate,
} from 'docc-render/utils/data';
import DocumentationTopic from 'theme/components/DocumentationTopic.vue';
import DocumentationLayout from 'docc-render/components/DocumentationLayout.vue';
import DocumentationLayout from 'theme/components/DocumentationLayout.vue';
import DocumentationTopicStore from 'docc-render/stores/DocumentationTopicStore';
import indexDataFetcher from 'theme/mixins/indexDataFetcher';
import Language from 'docc-render/constants/Language';
Expand Down
Loading