diff --git a/src/app/features/project/wiki/wiki.component.html b/src/app/features/project/wiki/wiki.component.html index b3ede123b..0f3601362 100644 --- a/src/app/features/project/wiki/wiki.component.html +++ b/src/app/features/project/wiki/wiki.component.html @@ -26,7 +26,7 @@ } -
+
diff --git a/src/app/features/registry/pages/registry-wiki/registry-wiki.component.html b/src/app/features/registry/pages/registry-wiki/registry-wiki.component.html index 2f5ee68ad..05f489d7a 100644 --- a/src/app/features/registry/pages/registry-wiki/registry-wiki.component.html +++ b/src/app/features/registry/pages/registry-wiki/registry-wiki.component.html @@ -21,11 +21,11 @@
diff --git a/src/app/features/registry/pages/registry-wiki/registry-wiki.component.ts b/src/app/features/registry/pages/registry-wiki/registry-wiki.component.ts index 31c66f2c6..f7acf3f79 100644 --- a/src/app/features/registry/pages/registry-wiki/registry-wiki.component.ts +++ b/src/app/features/registry/pages/registry-wiki/registry-wiki.component.ts @@ -18,6 +18,7 @@ import { hasViewOnlyParam } from '@osf/shared/helpers'; import { WikiModes } from '@osf/shared/models'; import { GetCompareVersionContent, + GetComponentsWikiList, GetWikiContent, GetWikiList, GetWikiVersionContent, @@ -57,6 +58,7 @@ export class RegistryWikiComponent { currentWikiId = select(WikiSelectors.getCurrentWikiId); wikiVersions = select(WikiSelectors.getWikiVersions); isWikiVersionLoading = select(WikiSelectors.getWikiVersionsLoading); + componentsWikiList = select(WikiSelectors.getComponentsWikiList); hasViewOnly = computed(() => hasViewOnlyParam(this.router)); @@ -70,6 +72,7 @@ export class RegistryWikiComponent { getWikiVersions: GetWikiVersions, getWikiVersionContent: GetWikiVersionContent, getCompareVersionContent: GetCompareVersionContent, + getComponentsWikiList: GetComponentsWikiList, }); wikiIdFromQueryParams = this.route.snapshot.queryParams['wiki']; @@ -87,6 +90,8 @@ export class RegistryWikiComponent { ) .subscribe(); + this.actions.getComponentsWikiList(ResourceType.Registration, this.resourceId); + this.route.queryParams .pipe( takeUntilDestroyed(), diff --git a/src/app/shared/components/wiki/compare-section/compare-section.component.scss b/src/app/shared/components/wiki/compare-section/compare-section.component.scss index de605d06a..9c4829ccd 100644 --- a/src/app/shared/components/wiki/compare-section/compare-section.component.scss +++ b/src/app/shared/components/wiki/compare-section/compare-section.component.scss @@ -1,3 +1,4 @@ :host { flex: 1 1 25%; + min-height: 300px; } diff --git a/src/app/shared/components/wiki/compare-section/compare-section.component.ts b/src/app/shared/components/wiki/compare-section/compare-section.component.ts index f1af512db..36bd6d22a 100644 --- a/src/app/shared/components/wiki/compare-section/compare-section.component.ts +++ b/src/app/shared/components/wiki/compare-section/compare-section.component.ts @@ -53,8 +53,10 @@ export class CompareSectionComponent { constructor() { effect(() => { - this.selectedVersion = this.versions()[0].id; - this.selectVersion.emit(this.selectedVersion); + this.selectedVersion = this.versions()[0]?.id; + if (this.selectedVersion) { + this.selectVersion.emit(this.selectedVersion); + } }); } onVersionChange(versionId: string): void { diff --git a/src/app/shared/components/wiki/edit-section/edit-section.component.scss b/src/app/shared/components/wiki/edit-section/edit-section.component.scss index a0aadc379..95dc71b83 100644 --- a/src/app/shared/components/wiki/edit-section/edit-section.component.scss +++ b/src/app/shared/components/wiki/edit-section/edit-section.component.scss @@ -1,6 +1,7 @@ :host { flex: 1 1 25%; min-width: 25%; + min-height: 400px; md-editor { display: block; diff --git a/src/app/shared/components/wiki/wiki-list/wiki-list.component.html b/src/app/shared/components/wiki/wiki-list/wiki-list.component.html index 30265bcc8..8e7d82866 100644 --- a/src/app/shared/components/wiki/wiki-list/wiki-list.component.html +++ b/src/app/shared/components/wiki/wiki-list/wiki-list.component.html @@ -11,20 +11,15 @@ } @else { @if (expanded()) { -
- @if (showAddBtn()) { - - } +
+
- @if (!viewOnly()) { - @if (!isHomeWikiSelected() || !list().length) { + @if (!viewOnly() && list().length) { + @if (!isHomeWikiSelected()) { {{ item.label | translate }}
- @if (showAddBtn()) { + @if (!viewOnly()) { (); readonly componentsList = input.required(); - readonly showAddBtn = input(false); readonly isLoading = input(false); readonly viewOnly = input(false);