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
2 changes: 1 addition & 1 deletion src/app/core/components/layout/layout.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
<osf-header></osf-header>
} @else {
<osf-topnav></osf-topnav>
<osf-banner-component></osf-banner-component>
@if (isMedium()) {
<osf-breadcrumb></osf-breadcrumb>
}
<osf-banner-component></osf-banner-component>
}

<router-outlet />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,6 @@ <h1>{{ 'home.loggedIn.latestResearch.title' | translate }}</h1>
severity="success"
/>
</div>

<div class="hosting-container flex flex-column gap-4 py-6 px-3 md:px-4 xl:flex-row xl:justify-content-between">
<div class="text-container">
<h1>{{ 'home.loggedIn.hosting.title' | translate }}</h1>
<p class="m-t-12">{{ 'home.loggedIn.hosting.subtitle' | translate }}</p>
</div>

<p-button routerLink="/meetings" [label]="'home.loggedIn.hosting.button' | translate" severity="success" />
</div>
</div>
} @else {
<osf-sub-header
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,3 @@
.latest-research-container {
background-color: var(--bg-blue-3);
}

.hosting-container {
background-color: var(--bg-blue-2);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<div class="wiki flex flex-column p-4 gap-4">
<h2>{{ 'project.overview.wiki.title' | translate }}</h2>
<div class="flex justify-content-between align-items-center">
<h2>{{ 'project.overview.wiki.title' | translate }}</h2>
<p-button
severity="secondary"
[label]="'common.buttons.edit' | translate"
(onClick)="navigateToWiki()"
data-test-edit-wiki-button
></p-button>
</div>

@if (isWikiLoading()) {
<p-skeleton width="100%" height="5rem" />
} @else {
Expand All @@ -14,7 +23,7 @@ <h2>{{ 'project.overview.wiki.title' | translate }}</h2>
<osf-markdown [markdownText]="wikiContent()"></osf-markdown>
</osf-truncated-text>
} @else {
<div [innerHtml]="'project.overview.wiki.noWikiMessage' | translate"></div>
<div class="font-italic" [innerHtml]="'project.overview.wiki.noWikiMessage' | translate"></div>
}
}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,33 @@ import { select } from '@ngxs/store';

import { TranslatePipe } from '@ngx-translate/core';

import { Button } from 'primeng/button';
import { Skeleton } from 'primeng/skeleton';

import { ChangeDetectionStrategy, Component, input } from '@angular/core';
import { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';
import { Router } from '@angular/router';

import { MarkdownComponent, TruncatedTextComponent } from '@osf/shared/components';
import { WikiSelectors } from '@osf/shared/stores';

@Component({
selector: 'osf-overview-wiki',
imports: [Skeleton, TranslatePipe, TruncatedTextComponent, MarkdownComponent],
imports: [Skeleton, TranslatePipe, TruncatedTextComponent, MarkdownComponent, Button],
templateUrl: './overview-wiki.component.html',
styleUrl: './overview-wiki.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class OverviewWikiComponent {
private readonly router = inject(Router);

isWikiLoading = select(WikiSelectors.getHomeWikiLoading);
wikiContent = select(WikiSelectors.getHomeWikiContent);

resourceId = input('');

wikiLink = () => ['/', this.resourceId(), 'wiki'];
wikiLink = computed(() => ['/', this.resourceId(), 'wiki']);

navigateToWiki() {
this.router.navigate(this.wikiLink());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
} @else {
<div class="flex flex-column bg-white flex-1 p-4 gap-4">
<p>
{{ 'resources.description' | translate }}
@if (addButtonVisible()) {
<span>{{ 'resources.linkDoi' | translate }}</span>
}

<span>{{ 'resources.description' | translate }}</span>
<a class="font-bold" href="https://help.osf.io/article/452-open-practice-badges" target="_blank">
{{ 'common.labels.learnMore' | translate }}
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ export class TokenAddEditFormComponent implements OnInit {
});

constructor() {
effect(() => {
return this.isLoading() ? this.tokenForm.disable() : this.tokenForm.enable();
});
effect(() => (this.isLoading() ? this.tokenForm.disable() : this.tokenForm.enable()));
}

ngOnInit(): void {
Expand Down Expand Up @@ -97,7 +95,7 @@ export class TokenAddEditFormComponent implements OnInit {
const tokens = this.store.selectSignal(TokensSelectors.getTokens);
const newToken = tokens()[0];
this.dialogRef.close();
this.showTokenCreatedDialog(newToken.name, newToken.id);
this.showTokenCreatedDialog(newToken.name, newToken.tokenId);
},
});
} else {
Expand Down
1 change: 1 addition & 0 deletions src/app/features/settings/tokens/mappers/token.mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export class TokenMapper {
static fromGetResponse(response: TokenGetResponseJsonApi): TokenModel {
return {
id: response.id,
tokenId: response.attributes.token_id,
name: response.attributes.name,
scopes: response.embeds.scopes.data.map((item) => item.id),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface TokenGetResponseJsonApi {

interface TokenAttributesJsonApi {
name: string;
token_id: string;
}

interface TokenEmbedsJsonApi {
Expand Down
1 change: 1 addition & 0 deletions src/app/features/settings/tokens/models/token.model.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export interface TokenModel {
id: string;
tokenId: string;
name: string;
scopes: string[];
}
10 changes: 3 additions & 7 deletions src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,6 @@
"title": "Browse the latest research",
"subtitle": "Check out the latest preprints hosted on OSF covering a variety of research areas",
"button": "View Preprints"
},
"hosting": {
"title": "Hosting a conference or meeting?",
"subtitle": "Use the OSF for Meetings service to provide a central location for conference submissions",
"button": "View Meetings"
}
},
"loggedOut": {
Expand Down Expand Up @@ -672,7 +667,7 @@
},
"wiki": {
"title": "Wiki",
"noWikiMessage": "<em>Add important information, links, or images here to describe your project.</em>"
"noWikiMessage": "Click the “Edit” to add important information, links, or images here to describe your project."
},
"files": {
"title": "Files",
Expand Down Expand Up @@ -2889,7 +2884,8 @@
},
"resources": {
"title": "Resources",
"description": "Link a DOI from a repository to your registration by clicking “Add resource” button. Contributors affirmed to adhere to the criteria for each badge.",
"linkDoi": "Link a DOI from a repository to your registration by clicking “Add resource” button.",
"description": " Contributors affirmed to adhere to the criteria for each badge.",
"add": "Add Resource",
"edit": "Edit Resource",
"delete": "Delete Resource",
Expand Down
Loading