Skip to content

Commit 21d1787

Browse files
authored
Merge pull request swiftlang#11 from hqhhuang/remove-no-overview
Remove 'No Overview' text from `Description` component Fixes: rdar://89691926
2 parents 24c5399 + 81c9326 commit 21d1787

File tree

4 files changed

+33
-135
lines changed

4 files changed

+33
-135
lines changed

src/components/DocumentationTopic.vue

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -29,29 +29,29 @@
2929
:platforms="platforms" :technologies="technologies"
3030
/>
3131
</DocumentationHero>
32-
<div class="container">
33-
<Description :hasOverview="hasOverview">
34-
<RequirementMetadata
35-
v-if="isRequirement"
36-
:defaultImplementationsCount="defaultImplementationsCount"
37-
/>
38-
<Aside v-if="deprecationSummary && deprecationSummary.length" kind="deprecated">
39-
<ContentNode :content="deprecationSummary" />
40-
</Aside>
41-
<Aside
42-
v-if="downloadNotAvailableSummary && downloadNotAvailableSummary.length"
43-
kind="note"
44-
>
45-
<ContentNode :content="downloadNotAvailableSummary" />
46-
</Aside>
47-
</Description>
48-
<PrimaryContent
49-
v-if="primaryContentSections && primaryContentSections.length"
50-
:class="{ 'with-border': !enhanceBackground }"
51-
:conformance="conformance"
52-
:sections="primaryContentSections"
32+
<div class="container">
33+
<div class="description">
34+
<RequirementMetadata
35+
v-if="isRequirement"
36+
:defaultImplementationsCount="defaultImplementationsCount"
5337
/>
38+
<Aside v-if="deprecationSummary && deprecationSummary.length" kind="deprecated">
39+
<ContentNode :content="deprecationSummary" />
40+
</Aside>
41+
<Aside
42+
v-if="downloadNotAvailableSummary && downloadNotAvailableSummary.length"
43+
kind="note"
44+
>
45+
<ContentNode :content="downloadNotAvailableSummary" />
46+
</Aside>
5447
</div>
48+
<PrimaryContent
49+
v-if="primaryContentSections && primaryContentSections.length"
50+
:class="{ 'with-border': !enhanceBackground }"
51+
:conformance="conformance"
52+
:sections="primaryContentSections"
53+
/>
54+
</div>
5555
<Topics
5656
v-if="topicSections"
5757
:sections="topicSections"
@@ -88,7 +88,6 @@ import Abstract from './DocumentationTopic/Description/Abstract.vue';
8888
import ContentNode from './DocumentationTopic/ContentNode.vue';
8989
import CallToActionButton from './CallToActionButton.vue';
9090
import DefaultImplementations from './DocumentationTopic/DefaultImplementations.vue';
91-
import Description from './DocumentationTopic/Description.vue';
9291
import PrimaryContent from './DocumentationTopic/PrimaryContent.vue';
9392
import Relationships from './DocumentationTopic/Relationships.vue';
9493
import RequirementMetadata from './DocumentationTopic/Description/RequirementMetadata.vue';
@@ -122,7 +121,6 @@ export default {
122121
BetaLegalText,
123122
ContentNode,
124123
DefaultImplementations,
125-
Description,
126124
DownloadButton: CallToActionButton,
127125
LanguageSwitcher,
128126
PrimaryContent,
@@ -270,10 +268,6 @@ export default {
270268
0,
271269
);
272270
},
273-
hasOverview:
274-
({ primaryContentSections = [], abstract = [] }) => primaryContentSections.filter(section => (
275-
section.kind === PrimaryContent.constants.SectionKind.content
276-
)).length > 0 || abstract.length > 0,
277271
onThisPageSections() {
278272
return this.topicState.onThisPageSections;
279273
},
@@ -367,6 +361,18 @@ export default {
367361
@include dynamic-content-container;
368362
}
369363
364+
.description {
365+
&:empty { display: none; }
366+
367+
&:not(:empty) {
368+
margin-bottom: $contenttable-spacing-single-side;
369+
}
370+
371+
/deep/ .content + * {
372+
margin-top: $stacked-margin-large;
373+
}
374+
}
375+
370376
.sample-download {
371377
margin-top: 20px;
372378
}

src/components/DocumentationTopic/Description.vue

Lines changed: 0 additions & 48 deletions
This file was deleted.

tests/unit/components/DocumentationTopic.spec.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ const {
1919
ContentNode,
2020
DefaultImplementations,
2121
Aside,
22-
Description,
2322
DownloadButton,
2423
LanguageSwitcher,
2524
PrimaryContent,
@@ -275,13 +274,6 @@ describe('DocumentationTopic', () => {
275274
expect(abstractComponent.props('content')).toEqual(emptyParagraph);
276275
});
277276

278-
it('renders a `Description`/`Summary and PrimaryContent`', () => {
279-
const description = wrapper.find(Description);
280-
expect(description.exists()).toBe(true);
281-
282-
expect(wrapper.find(PrimaryContent).exists()).toBe(true);
283-
});
284-
285277
it('renders a `PrimaryContent`', () => {
286278
const primary = wrapper.find(PrimaryContent);
287279
expect(primary.exists()).toBe(true);

tests/unit/components/DocumentationTopic/Description.spec.js

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)