Skip to content
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
60 changes: 33 additions & 27 deletions src/components/DocumentationTopic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,29 @@
:platforms="platforms" :technologies="technologies"
/>
</DocumentationHero>
<div class="container">
<Description :hasOverview="hasOverview">
<RequirementMetadata
v-if="isRequirement"
:defaultImplementationsCount="defaultImplementationsCount"
/>
<Aside v-if="deprecationSummary && deprecationSummary.length" kind="deprecated">
<ContentNode :content="deprecationSummary" />
</Aside>
<Aside
v-if="downloadNotAvailableSummary && downloadNotAvailableSummary.length"
kind="note"
>
<ContentNode :content="downloadNotAvailableSummary" />
</Aside>
</Description>
<PrimaryContent
v-if="primaryContentSections && primaryContentSections.length"
:class="{ 'with-border': !enhanceBackground }"
:conformance="conformance"
:sections="primaryContentSections"
<div class="container">
<div class="description">
<RequirementMetadata
v-if="isRequirement"
:defaultImplementationsCount="defaultImplementationsCount"
/>
<Aside v-if="deprecationSummary && deprecationSummary.length" kind="deprecated">
<ContentNode :content="deprecationSummary" />
</Aside>
<Aside
v-if="downloadNotAvailableSummary && downloadNotAvailableSummary.length"
kind="note"
>
<ContentNode :content="downloadNotAvailableSummary" />
</Aside>
</div>
<PrimaryContent
v-if="primaryContentSections && primaryContentSections.length"
:class="{ 'with-border': !enhanceBackground }"
:conformance="conformance"
:sections="primaryContentSections"
/>
</div>
<Topics
v-if="topicSections"
:sections="topicSections"
Expand Down Expand Up @@ -88,7 +88,6 @@ import Abstract from './DocumentationTopic/Description/Abstract.vue';
import ContentNode from './DocumentationTopic/ContentNode.vue';
import CallToActionButton from './CallToActionButton.vue';
import DefaultImplementations from './DocumentationTopic/DefaultImplementations.vue';
import Description from './DocumentationTopic/Description.vue';
import PrimaryContent from './DocumentationTopic/PrimaryContent.vue';
import Relationships from './DocumentationTopic/Relationships.vue';
import RequirementMetadata from './DocumentationTopic/Description/RequirementMetadata.vue';
Expand Down Expand Up @@ -122,7 +121,6 @@ export default {
BetaLegalText,
ContentNode,
DefaultImplementations,
Description,
DownloadButton: CallToActionButton,
LanguageSwitcher,
PrimaryContent,
Expand Down Expand Up @@ -270,10 +268,6 @@ export default {
0,
);
},
hasOverview:
({ primaryContentSections = [], abstract = [] }) => primaryContentSections.filter(section => (
section.kind === PrimaryContent.constants.SectionKind.content
)).length > 0 || abstract.length > 0,
onThisPageSections() {
return this.topicState.onThisPageSections;
},
Expand Down Expand Up @@ -367,6 +361,18 @@ export default {
@include dynamic-content-container;
}

.description {
&:empty { display: none; }

&:not(:empty) {
margin-bottom: $contenttable-spacing-single-side;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could have been put outside the :not(:empty), because we are applying a display:none anyway :)

}

/deep/ .content + * {
margin-top: $stacked-margin-large;
}
}

.sample-download {
margin-top: 20px;
}
Expand Down
48 changes: 0 additions & 48 deletions src/components/DocumentationTopic/Description.vue

This file was deleted.

8 changes: 0 additions & 8 deletions tests/unit/components/DocumentationTopic.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const {
ContentNode,
DefaultImplementations,
Aside,
Description,
DownloadButton,
LanguageSwitcher,
PrimaryContent,
Expand Down Expand Up @@ -275,13 +274,6 @@ describe('DocumentationTopic', () => {
expect(abstractComponent.props('content')).toEqual(emptyParagraph);
});

it('renders a `Description`/`Summary and PrimaryContent`', () => {
const description = wrapper.find(Description);
expect(description.exists()).toBe(true);

expect(wrapper.find(PrimaryContent).exists()).toBe(true);
});

it('renders a `PrimaryContent`', () => {
const primary = wrapper.find(PrimaryContent);
expect(primary.exists()).toBe(true);
Expand Down
52 changes: 0 additions & 52 deletions tests/unit/components/DocumentationTopic/Description.spec.js

This file was deleted.