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
3 changes: 1 addition & 2 deletions src/app/features/project/wiki/wiki.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@
</div>
}

<section class="flex flex-column lg:flex-row bg-white flex-1 h-full p-5 gap-4 w-full overflow-auto wiki-page">
<section class="flex flex-column lg:flex-row lg:flex-wrap bg-white flex-1 h-full p-5 gap-4 w-full wiki-page">
<osf-wiki-list
[list]="wikiList()"
[resourceId]="projectId()"
[isLoading]="isWikiListLoading()"
[componentsList]="componentsWikiList()"
[currentWikiId]="currentWikiId()"
[viewOnly]="hasViewOnly()"
[showAddBtn]="true"
(createWiki)="onCreateWiki()"
(deleteWiki)="onDeleteWiki()"
></osf-wiki-list>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@

<section class="flex flex-column lg:flex-row bg-white flex-1 h-full p-5 gap-4 w-full overflow-auto wiki-page">
<osf-wiki-list
[viewOnly]="hasViewOnly()"
[viewOnly]="true"
[list]="wikiList()"
[resourceId]="resourceId"
[isLoading]="isWikiListLoading()"
[componentsList]="[]"
[componentsList]="componentsWikiList()"
[currentWikiId]="currentWikiId()"
></osf-wiki-list>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { hasViewOnlyParam } from '@osf/shared/helpers';
import { WikiModes } from '@osf/shared/models';
import {
GetCompareVersionContent,
GetComponentsWikiList,
GetWikiContent,
GetWikiList,
GetWikiVersionContent,
Expand Down Expand Up @@ -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));

Expand All @@ -70,6 +72,7 @@ export class RegistryWikiComponent {
getWikiVersions: GetWikiVersions,
getWikiVersionContent: GetWikiVersionContent,
getCompareVersionContent: GetCompareVersionContent,
getComponentsWikiList: GetComponentsWikiList,
});

wikiIdFromQueryParams = this.route.snapshot.queryParams['wiki'];
Expand All @@ -87,6 +90,8 @@ export class RegistryWikiComponent {
)
.subscribe();

this.actions.getComponentsWikiList(ResourceType.Registration, this.resourceId);

this.route.queryParams
.pipe(
takeUntilDestroyed(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
:host {
flex: 1 1 25%;
min-height: 300px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
:host {
flex: 1 1 25%;
min-width: 25%;
min-height: 400px;

md-editor {
display: block;
Expand Down
29 changes: 12 additions & 17 deletions src/app/shared/components/wiki/wiki-list/wiki-list.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,15 @@
} @else {
@if (expanded()) {
<p-panel showHeader="false">
<div
class="flex aign-items-center mt-3 mb-2"
[class]="showAddBtn() ? 'justify-content-between' : 'justify-content-end'"
>
@if (showAddBtn()) {
<p-button
[label]="'project.wiki.addNewWiki' | translate"
icon="fas fa-plus"
severity="success"
outlined
[disabled]="viewOnly()"
(onClick)="openAddWikiDialog()"
/>
}
<div class="flex align-items-center justify-content-between mt-3 mb-2">
<p-button
[label]="'project.wiki.addNewWiki' | translate"
icon="fas fa-plus"
severity="success"
outlined
[disabled]="viewOnly()"
(onClick)="openAddWikiDialog()"
/>

<p-button
class="btn-icon-only"
Expand All @@ -35,8 +30,8 @@
(onClick)="collapseNavigation()"
/>
</div>
@if (!viewOnly()) {
@if (!isHomeWikiSelected() || !list().length) {
@if (!viewOnly() && list().length) {
@if (!isHomeWikiSelected()) {
<p-button
icon="fas fa-trash"
[label]="'common.buttons.delete' | translate"
Expand Down Expand Up @@ -82,7 +77,7 @@ <h4 class="ml-2">{{ item.label | translate }}</h4>
</p-button>
</div>

@if (showAddBtn()) {
@if (!viewOnly()) {
<p-button
class="btn-icon-only"
icon="fas fa-plus"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export class WikiListComponent {
readonly currentWikiId = input.required<string>();
readonly componentsList = input.required<ComponentWiki[]>();

readonly showAddBtn = input<boolean>(false);
readonly isLoading = input<boolean>(false);
readonly viewOnly = input<boolean>(false);

Expand Down
Loading