Skip to content

Commit 34fb461

Browse files
committed
minor fixes
1 parent dccd8df commit 34fb461

20 files changed

+118
-55
lines changed

src/components/template-pages/api-details-page/apiDetailsPageHandlers.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,25 @@ export class ApiDetailsPageHandlers implements IWidgetHandler {
4343
titleText: {
4444
displayName: "Title text",
4545
plugins: ["typography"],
46-
defaults:{
46+
defaults: {
4747
typography: {
4848
fontWeight: "normal",
4949
colorKey: "colors/primaryText"
5050
},
5151
}
52+
},
53+
highlightSelectedItem: {
54+
displayName: "Highlight selected item",
55+
plugins: ["border"],
56+
defaults: {
57+
border: {
58+
left: {
59+
width: 5,
60+
style: "solid",
61+
colorKey: "colors/Bqr2r"
62+
}
63+
}
64+
}
5265
}
5366
}
5467
}

src/components/template-pages/api-details-page/ko/runtime/api-details-page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ <h1 class="title-text" data-bind="text: api() ? api().displayName : 'The specifi
2929
<!-- ko if: api -->
3030

3131
<!-- ko if: selectedMenuItem()?.type === 'static' -->
32-
<!-- ko if: selectedMenuItem()?.value === 'about' -->
32+
<!-- ko if: selectedMenuItem()?.value === 'details' -->
3333
<!-- ko template: { name: 'aboutApi', data: {api: api(), lastModifiedDate: lastModifiedDate()} } -->
3434
<!-- /ko -->
3535
<!-- /ko -->

src/components/template-pages/api-details-page/ko/runtime/api-details-page.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export class ApiDetailsPage {
9696
let url = ""
9797

9898
if (menuItem.type === menuItemType.staticMenuItemType) {
99-
url = this.routeHelper.getProductDetailsPageReference(this.api().name, menuItem.value);
99+
url = this.routeHelper.getApiDetailsPageReference(this.api().name, menuItem.value);
100100
}
101101

102102
if (menuItem.type === menuItemType.operationMenuItem) {
@@ -166,8 +166,8 @@ export class ApiDetailsPage {
166166
const apiReferenceUrl = this.routeHelper.getApiReferenceUrl(this.api().name);
167167
this.breadcrumbItems([{ title: "Home", url: "/" },
168168
{ title: "APIs", url: "/apis" },
169-
{ title: this.api().name, url: this.routeHelper.getApiDetailsPageReference(this.api().name, "about") },
170-
{ title: "About this API", url: apiReferenceUrl }])
169+
{ title: this.api().name, url: this.routeHelper.getApiDetailsPageReference(this.api().name, "details") },
170+
{ title: "Details", url: apiReferenceUrl }])
171171
}
172172

173173
private onVersionChange(selectedApiName: string): void {

src/components/template-pages/api-details-page/ko/runtime/menu/api-nav-menu.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<div class="menu-list" role="listbox" aria-label="About this API">
2626
<!-- ko foreach: { data: staticSelectableMenuItems, as: 'menuItem' } -->
2727
<div class="menu-list-item" role="option"
28-
data-bind="activate: $component.selectMenuItem, css: { 'selected': $component.selectedMenuItem() == menuItem }">
28+
data-bind="activate: $component.selectMenuItem, css: { 'selected highlight-selected-item': $component.selectedMenuItem() == menuItem }">
2929
<span data-bind="text: menuItem.displayName"></span>
3030
</div>
3131
<!-- /ko -->
@@ -34,28 +34,28 @@
3434

3535
<hr>
3636
<details open class="details-styled" id="details-wiki">
37-
<summary aria-label="Documentations">
37+
<summary aria-label="Documentation">
3838
<div class="menu-list-heading title">
39-
Documentations
39+
Documentation
4040
<i class="icon-emb icon-emb-chevron-down"></i>
4141
</div>
4242
</summary>
43-
<div class="menu-list" role="listbox" aria-label="Documentations">
43+
<div class="menu-list" role="listbox" aria-label="Documentation">
4444
<!-- ko if: wikiLoading -->
4545
<spinner class="menu-list-item"></spinner>
4646
<!-- /ko -->
4747

4848
<!-- ko ifnot: wikiLoading -->
4949
<!-- ko foreach: { data: filteredWikiDocumentationMenuItems(), as: 'menuItem' } -->
5050
<div class="menu-list-item" role="option"
51-
data-bind="activate: $component.selectMenuItem, css: { 'selected': $component.selectedMenuItem() == menuItem }">
51+
data-bind="activate: $component.selectMenuItem, css: { 'selected highlight-selected-item': $component.selectedMenuItem() == menuItem }">
5252
<span
5353
data-bind="text: menuItem.displayName, css: { 'text-truncate': !$component.wrapText(), 'text-wrap': $component.wrapText() }"></span>
5454
</div>
5555
<!-- /ko -->
5656

5757
<!-- ko if: filteredWikiDocumentationMenuItems().length == 0 -->
58-
<span>No documentations to display</span>
58+
<span>No documentation to display</span>
5959
<!-- /ko -->
6060
<!-- /ko -->
6161
</div>
@@ -102,7 +102,7 @@
102102
</div>
103103
<!-- ko foreach: { data: graphqlNodes(), as: 'menuItem' } -->
104104
<div class="menu-list-item" role="option"
105-
data-bind="activate: $component.selectMenuItem, css: { 'selected': $component.selectedMenuItem() == menuItem }">
105+
data-bind="activate: $component.selectMenuItem, css: { 'selected highlight-selected-item': $component.selectedMenuItem() == menuItem }">
106106
<div class="http-method" data-bind="attr: { 'data-method': menuItem.method }"></div>
107107
<span
108108
data-bind="text: menuItem.displayName, css: { 'text-truncate': !$component.wrapText(), 'text-wrap': $component.wrapText() }"></span>
@@ -121,7 +121,7 @@
121121
<!-- ko ifnot: operationsLoading -->
122122
<!-- ko foreach: { data: operationsMenuItems(), as: 'menuItem' } -->
123123
<div class="menu-list-item" role="option"
124-
data-bind="activate: $component.selectMenuItem, css: { 'selected': $component.selectedMenuItem() == menuItem }">
124+
data-bind="activate: $component.selectMenuItem, css: { 'selected highlight-selected-item': $component.selectedMenuItem() == menuItem }">
125125
<div class="http-method" data-bind="attr: { 'data-method': menuItem.method }"></div>
126126
<span
127127
data-bind="text: menuItem.displayName, css: { 'text-truncate': !$component.wrapText(), 'text-wrap': $component.wrapText() }"></span>
@@ -164,7 +164,7 @@
164164
<div role="listbox" aria-label="Operations">
165165
<!-- ko foreach: { data: tagMenuItem.operations, as: 'menuItem' } -->
166166
<div class="menu-list-item" role="option"
167-
data-bind="activate: $component.selectMenuItem, css: { 'selected': $component.selectedMenuItem() == menuItem }">
167+
data-bind="activate: $component.selectMenuItem, css: { 'selected highlight-selected-item': $component.selectedMenuItem() == menuItem }">
168168
<div class="http-method" data-bind="attr: { 'data-method': menuItem.method }">
169169
</div>
170170
<span data-bind="text: menuItem.displayName"></span>

src/components/template-pages/api-details-page/ko/runtime/menu/api-nav-menu.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ interface tagOperationMenuItem {
2828
})
2929
export class ApiNavMenu {
3030
public readonly staticSelectableMenuItems: menuItem[] = [
31-
{ displayName: "About this API", value: "about", type: menuItemType.staticMenuItemType },
32-
{ displayName: "Products that use this API", value: "products", type: menuItemType.staticMenuItemType },
31+
{ displayName: "Details", value: "details", type: menuItemType.staticMenuItemType },
32+
{ displayName: "Associated products", value: "products", type: menuItemType.staticMenuItemType },
3333
{ displayName: "Changelog", value: "changelog", type: menuItemType.staticMenuItemType }
3434
];
3535

@@ -352,7 +352,7 @@ export class ApiNavMenu {
352352
private async onRouteChange(): Promise<void> {
353353
const apiName = this.routeHelper.getApiName();
354354

355-
if (!apiName || apiName === this.api()?.name) {
355+
if (!apiName) {
356356
return;
357357
}
358358

src/components/template-pages/api-details-page/ko/runtime/staticPages/api-products-cards.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ <h3>Products that use this API</h3>
5252
</div>
5353

5454
<!-- ko if: showQuickView() && quickViewProduct() -->
55-
<div class="detachable-right">
55+
<div class="detachable-right scrollable">
5656
<div class="panel">
5757
<div style="display: flex; justify-content: space-between">
5858
<h2 data-bind="text: quickViewProduct().name"></h2>

src/components/template-pages/api-details-page/ko/runtime/staticPages/api-products-cards.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export class ApiProductsCards {
101101
this.showQuickView(false);
102102
}
103103

104-
public getFullProductUrl(product: Product): string {
105-
return window.location.host + "/" + this.routeHelper.getProductReferenceUrl(product.name, "product");
104+
public getFullProductUrl(product: ko.Observable<Product>): string {
105+
return window.location.host + "/" + this.routeHelper.getProductReferenceUrl(product().name, "product");
106106
}
107107
}

src/components/template-pages/product-details-page/ko/runtime/menu/product-nav-menu.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<div class="menu-list" role="listbox" aria-label="About this Product">
1717
<!-- ko foreach: { data: staticSelectableMenuItems, as: 'menuItem' } -->
1818
<div class="menu-list-item" role="option"
19-
data-bind="activate: $component.selectMenuItem, css: { 'selected': $component.selectedMenuItem() == menuItem }">
19+
data-bind="activate: $component.selectMenuItem, css: { 'selected highlight-selected-item': $component.selectedMenuItem() == menuItem }">
2020
<span data-bind="text: menuItem.displayName"></span>
2121
</div>
2222
<!-- /ko -->
@@ -25,28 +25,28 @@
2525

2626
<hr>
2727
<details open class="details-styled" id="details-wiki">
28-
<summary aria-label="Documentations">
28+
<summary aria-label="Documentation">
2929
<div class="menu-list-heading title">
30-
Documentations
30+
Documentation
3131
<i class="icon-emb icon-emb-chevron-down"></i>
3232
</div>
3333
</summary>
34-
<div class="menu-list" role="listbox" aria-label="Documentations">
34+
<div class="menu-list" role="listbox" aria-label="Documentation">
3535
<!-- ko if: wikiLoading -->
3636
<spinner class="menu-list-item"></spinner>
3737
<!-- /ko -->
3838

3939
<!-- ko ifnot: wikiLoading -->
4040
<!-- ko foreach: { data: filteredWikiDocumentationMenuItems(), as: 'menuItem' } -->
4141
<div class="menu-list-item" role="option"
42-
data-bind="activate: $component.selectMenuItem, css: { 'selected': $component.selectedMenuItem() == menuItem }">
42+
data-bind="activate: $component.selectMenuItem, css: { 'selected highlight-selected-item': $component.selectedMenuItem() == menuItem }">
4343
<span
4444
data-bind="text: menuItem.displayName, css: { 'text-truncate': !$component.wrapText(), 'text-wrap': $component.wrapText() }"></span>
4545
</div>
4646
<!-- /ko -->
4747

4848
<!-- ko if: filteredWikiDocumentationMenuItems().length == 0 -->
49-
<span>No documentations to display</span>
49+
<span>No documentation to display</span>
5050
<!-- /ko -->
5151
<!-- /ko -->
5252
</div>

src/components/template-pages/product-details-page/ko/runtime/menu/product-nav-menu.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import * as Constants from "../../../../../../constants";
1414
})
1515
export class ProductNavMenu {
1616
public readonly staticSelectableMenuItems: menuItem[] = [
17-
{ displayName: "About this Product", value: "about", type: menuItemType.staticMenuItemType },
17+
{ displayName: "Details", value: "details", type: menuItemType.staticMenuItemType },
1818
{ displayName: "APIs included", value: "apis", type: menuItemType.staticMenuItemType },
1919
{ displayName: "Subscriptions", value: "subscriptions", type: menuItemType.staticMenuItemType }
2020
];
@@ -47,7 +47,7 @@ export class ProductNavMenu {
4747
this.productLoading = ko.observable();
4848
this.wikiDocumentationMenuItems = ko.observable([]);
4949
this.filteredWikiDocumentationMenuItems = ko.observable([]);
50-
this.wikiLoading = ko.observable();
50+
this.wikiLoading = ko.observable(true);
5151
this.product = ko.observable();
5252
}
5353

@@ -56,8 +56,7 @@ export class ProductNavMenu {
5656
this.productLoading.subscribe(async (newValue) => {
5757
if (!newValue) {
5858
await this.loadWiki();
59-
// to do: [0]
60-
this.selectMenuItem(this.staticSelectableMenuItems[2]);
59+
this.selectMenuItem(this.staticSelectableMenuItems[0]);
6160
}
6261
});
6362

@@ -104,11 +103,10 @@ export class ProductNavMenu {
104103
this.wikiLoading(false);
105104
}
106105

107-
108106
private async onRouteChange(): Promise<void> {
109107
const productName = this.routeHelper.getProductName();
110108

111-
if (!productName || productName === this.product()?.name) {
109+
if (!productName) {
112110
return;
113111
}
114112

src/components/template-pages/product-details-page/ko/runtime/product-details-page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<!-- ko if: product -->
4141

4242
<!-- ko if: selectedMenuItem()?.type === 'static' -->
43-
<!-- ko if: selectedMenuItem()?.value === 'about' -->
43+
<!-- ko if: selectedMenuItem()?.value === 'details' -->
4444
<h3>About this Product</h3>
4545

4646
<div class="pb-12">

0 commit comments

Comments
 (0)