diff --git a/src/app/features/collections/collections.component.html b/src/app/features/collections/collections.component.html index 5c99a411a..7599339c8 100644 --- a/src/app/features/collections/collections.component.html +++ b/src/app/features/collections/collections.component.html @@ -9,18 +9,12 @@

Collection Title

- better-research -
diff --git a/src/app/features/collections/collections.component.ts b/src/app/features/collections/collections.component.ts index 763278786..84fa26121 100644 --- a/src/app/features/collections/collections.component.ts +++ b/src/app/features/collections/collections.component.ts @@ -3,7 +3,6 @@ import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { Button } from 'primeng/button'; import { DialogService } from 'primeng/dynamicdialog'; -import { NgOptimizedImage } from '@angular/common'; import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { FormControl } from '@angular/forms'; @@ -12,7 +11,7 @@ import { SearchInputComponent } from '@shared/components'; @Component({ selector: 'osf-collections', - imports: [NgOptimizedImage, SearchInputComponent, TranslatePipe, Button, CollectionsMainContentComponent], + imports: [SearchInputComponent, TranslatePipe, Button, CollectionsMainContentComponent], templateUrl: './collections.component.html', styleUrl: './collections.component.scss', providers: [DialogService], diff --git a/src/app/features/my-profile/components/my-profile-filter-chips/my-profile-filter-chips.component.scss b/src/app/features/my-profile/components/my-profile-filter-chips/my-profile-filter-chips.component.scss index 97920b501..1d02e27aa 100644 --- a/src/app/features/my-profile/components/my-profile-filter-chips/my-profile-filter-chips.component.scss +++ b/src/app/features/my-profile/components/my-profile-filter-chips/my-profile-filter-chips.component.scss @@ -1,13 +1,15 @@ +@use "assets/styles/variables" as var; + :host { display: flex; flex-direction: column; gap: 0.4rem; - @media (max-width: 1200px) { + @media (max-width: var.$breakpoint-xl) { flex-direction: row; } - @media (max-width: 600px) { + @media (max-width: var.$breakpoint-sm) { flex-direction: column; } } diff --git a/src/app/features/my-profile/components/my-profile-search/my-profile-search.component.html b/src/app/features/my-profile/components/my-profile-search/my-profile-search.component.html index a2119d45b..386a3cac3 100644 --- a/src/app/features/my-profile/components/my-profile-search/my-profile-search.component.html +++ b/src/app/features/my-profile/components/my-profile-search/my-profile-search.component.html @@ -1,16 +1,10 @@
- better-research -
@@ -24,67 +18,11 @@ Files } - - - - - - - -
- @if (currentStep === 1) { -
-

Improved OSF Search

-

- Enter any term in the search box and filter by specific object types. More information is available on our - help guides. -

-
-

1 of 3

-
- - -
-
-
- } - - @if (currentStep === 2) { -
-

Refine Your Search

-

- Narrow the source, discipline, and more. For example, find content supported by a specific funder or view only - datasets. -

-
-

2 of 3

-
- - -
-
-
- } - - @if (currentStep === 3) { -
-

Add Metadata

-

- Remember to add metadata and resources to your own work on OSF to make it more discoverable! Learn more in our - help guides. -

-
-

3 of 3

-
- -
-
-
- } +
diff --git a/src/app/features/my-profile/components/my-profile-search/my-profile-search.component.ts b/src/app/features/my-profile/components/my-profile-search/my-profile-search.component.ts index 0424081b2..7c6a7b3e2 100644 --- a/src/app/features/my-profile/components/my-profile-search/my-profile-search.component.ts +++ b/src/app/features/my-profile/components/my-profile-search/my-profile-search.component.ts @@ -1,17 +1,17 @@ import { Store } from '@ngxs/store'; -import { Button } from 'primeng/button'; -import { Tab, TabList, TabPanel, TabPanels, Tabs } from 'primeng/tabs'; +import { TranslatePipe } from '@ngx-translate/core'; + +import { Tab, TabList, Tabs } from 'primeng/tabs'; import { debounceTime, skip } from 'rxjs'; -import { NgOptimizedImage } from '@angular/common'; -import { ChangeDetectionStrategy, Component, DestroyRef, effect, inject, untracked } from '@angular/core'; +import { ChangeDetectionStrategy, Component, DestroyRef, effect, inject, signal, untracked } from '@angular/core'; import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop'; import { FormControl } from '@angular/forms'; import { UserSelectors } from '@osf/core/store/user'; -import { SearchInputComponent } from '@osf/shared/components'; +import { SearchHelpTutorialComponent, SearchInputComponent } from '@osf/shared/components'; import { ResourceTab } from '@osf/shared/enums'; import { IS_XSMALL } from '@osf/shared/utils'; @@ -23,15 +23,13 @@ import { MyProfileResourcesComponent } from '../my-profile-resources/my-profile- @Component({ selector: 'osf-my-profile-search', imports: [ - Button, - NgOptimizedImage, + TranslatePipe, SearchInputComponent, Tab, TabList, - TabPanel, - TabPanels, Tabs, MyProfileResourcesComponent, + SearchHelpTutorialComponent, ], templateUrl: './my-profile-search.component.html', styleUrl: './my-profile-search.component.scss', @@ -63,7 +61,7 @@ export class MyProfileSearchComponent { protected selectedTab: ResourceTab = ResourceTab.All; protected readonly ResourceTab = ResourceTab; - protected currentStep = 0; + protected currentStep = signal(0); private skipInitializationEffects = 0; constructor() { @@ -120,4 +118,8 @@ export class MyProfileSearchComponent { this.selectedTab = index; this.#store.dispatch(GetAllOptions); } + + showTutorial() { + this.currentStep.set(1); + } } diff --git a/src/app/features/preprints/components/preprint-provider-hero/preprint-provider-hero.component.html b/src/app/features/preprints/components/preprint-provider-hero/preprint-provider-hero.component.html index 117f77e01..a5a0c4749 100644 --- a/src/app/features/preprints/components/preprint-provider-hero/preprint-provider-hero.component.html +++ b/src/app/features/preprints/components/preprint-provider-hero/preprint-provider-hero.component.html @@ -42,23 +42,13 @@

{{ preprintProvider()!.name }}

- preprints help -
diff --git a/src/app/features/preprints/components/preprint-provider-hero/preprint-provider-hero.component.ts b/src/app/features/preprints/components/preprint-provider-hero/preprint-provider-hero.component.ts index 034e63039..32494fd67 100644 --- a/src/app/features/preprints/components/preprint-provider-hero/preprint-provider-hero.component.ts +++ b/src/app/features/preprints/components/preprint-provider-hero/preprint-provider-hero.component.ts @@ -4,7 +4,6 @@ import { Button } from 'primeng/button'; import { DialogService } from 'primeng/dynamicdialog'; import { Skeleton } from 'primeng/skeleton'; -import { NgOptimizedImage } from '@angular/common'; import { ChangeDetectionStrategy, Component, inject, input, output } from '@angular/core'; import { FormControl } from '@angular/forms'; import { RouterLink } from '@angular/router'; @@ -16,7 +15,7 @@ import { DecodeHtmlPipe } from '@shared/pipes'; @Component({ selector: 'osf-preprint-provider-hero', - imports: [Button, RouterLink, SearchInputComponent, Skeleton, TranslatePipe, NgOptimizedImage, DecodeHtmlPipe], + imports: [Button, RouterLink, SearchInputComponent, Skeleton, TranslatePipe, DecodeHtmlPipe], templateUrl: './preprint-provider-hero.component.html', styleUrl: './preprint-provider-hero.component.scss', providers: [DialogService], diff --git a/src/app/features/search/components/filter-chips/filter-chips.component.scss b/src/app/features/search/components/filter-chips/filter-chips.component.scss index 97920b501..1d02e27aa 100644 --- a/src/app/features/search/components/filter-chips/filter-chips.component.scss +++ b/src/app/features/search/components/filter-chips/filter-chips.component.scss @@ -1,13 +1,15 @@ +@use "assets/styles/variables" as var; + :host { display: flex; flex-direction: column; gap: 0.4rem; - @media (max-width: 1200px) { + @media (max-width: var.$breakpoint-xl) { flex-direction: row; } - @media (max-width: 600px) { + @media (max-width: var.$breakpoint-sm) { flex-direction: column; } } diff --git a/src/app/features/search/search.component.html b/src/app/features/search/search.component.html index 3701f8e54..3702758c5 100644 --- a/src/app/features/search/search.component.html +++ b/src/app/features/search/search.component.html @@ -1,107 +1,28 @@
-
- better-research + -
- @if (!isMobile()) { + @if (isSmall()) { - All - Projects - Registrations - Preprints - Files - @if (!isMyProfilePage()) { - Users + @for (item of resourceTabOptions; track $index) { + {{ item.label | translate }} } } - - - - - - - - @if (!isMyProfilePage()) { - - } -
- @if (currentStep === 1) { -
-

Improved OSF Search

- -

- Enter any term in the search box and filter by specific object types. More information is available on our - help guides. -

- -
-

1 of 3

- -
- - -
-
-
- } - - @if (currentStep === 2) { -
-

Refine Your Search

- -

- Narrow the source, discipline, and more. For example, find content supported by a specific funder or view - only datasets. -

- -
-

2 of 3

- -
- - -
-
-
- } - - @if (currentStep === 3) { -
-

Add Metadata

- -

- Remember to add metadata and resources to your own work on OSF to make it more discoverable! Learn more in - our help guides. -

- -
-

3 of 3

- -
- -
-
-
- } +
diff --git a/src/app/features/search/search.component.scss b/src/app/features/search/search.component.scss index 4af9792a5..3429bc57f 100644 --- a/src/app/features/search/search.component.scss +++ b/src/app/features/search/search.component.scss @@ -1,53 +1,10 @@ @use "assets/styles/variables" as var; -@use "assets/styles/mixins" as mix; :host { height: 100%; } -.search-container { - position: relative; - - img { - position: absolute; - top: mix.rem(4px); - right: mix.rem(4px); - z-index: 1; - } -} - .resources { position: relative; background: var.$white; } - -.stepper { - position: absolute; - display: flex; - flex-direction: column; - background: var.$white; - border: 1px solid var.$grey-2; - border-radius: 12px; - row-gap: mix.rem(24px); - padding: mix.rem(24px); - width: 32rem; - - .stepper-title { - font-size: mix.rem(18px); - } -} - -.first-stepper { - top: 2rem; - left: mix.rem(24px); -} - -.second-stepper { - top: calc(2rem + 42px); - left: calc(1.5rem + 30%); -} - -.third-stepper { - top: calc(5rem + 42px); - left: calc(0.4rem + 30%); -} diff --git a/src/app/features/search/search.component.ts b/src/app/features/search/search.component.ts index 7aac52cc8..26a204a45 100644 --- a/src/app/features/search/search.component.ts +++ b/src/app/features/search/search.component.ts @@ -1,22 +1,32 @@ import { Store } from '@ngxs/store'; +import { TranslatePipe } from '@ngx-translate/core'; + import { AccordionModule } from 'primeng/accordion'; import { AutoCompleteModule } from 'primeng/autocomplete'; -import { Button } from 'primeng/button'; import { DataViewModule } from 'primeng/dataview'; import { TableModule } from 'primeng/table'; -import { Tab, TabList, TabPanel, TabPanels, Tabs } from 'primeng/tabs'; +import { Tab, TabList, Tabs } from 'primeng/tabs'; import { debounceTime, skip } from 'rxjs'; -import { NgOptimizedImage } from '@angular/common'; -import { ChangeDetectionStrategy, Component, DestroyRef, effect, inject, OnDestroy, untracked } from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, + DestroyRef, + effect, + inject, + OnDestroy, + signal, + untracked, +} from '@angular/core'; import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop'; import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { SearchInputComponent } from '@osf/shared/components'; +import { SearchHelpTutorialComponent, SearchInputComponent } from '@osf/shared/components'; +import { SEARCH_TAB_OPTIONS } from '@osf/shared/constants'; import { ResourceTab } from '@osf/shared/enums'; -import { IS_XSMALL } from '@osf/shared/utils'; +import { IS_SMALL } from '@osf/shared/utils'; import { GetAllOptions } from './components/filters/store'; import { ResetFiltersState, ResourceFiltersSelectors } from './components/resource-filters/store'; @@ -30,17 +40,15 @@ import { GetResources, ResetSearchState, SearchSelectors, SetResourceTab, SetSea ReactiveFormsModule, Tab, TabList, - TabPanel, - TabPanels, Tabs, - NgOptimizedImage, + TranslatePipe, AutoCompleteModule, FormsModule, AccordionModule, TableModule, DataViewModule, - Button, ResourcesWrapperComponent, + SearchHelpTutorialComponent, ], templateUrl: './search.component.html', styleUrl: './search.component.scss', @@ -50,7 +58,7 @@ export class SearchComponent implements OnDestroy { readonly #store = inject(Store); protected searchControl = new FormControl(''); - protected readonly isMobile = toSignal(inject(IS_XSMALL)); + protected readonly isSmall = toSignal(inject(IS_SMALL)); private readonly destroyRef = inject(DestroyRef); @@ -66,11 +74,11 @@ export class SearchComponent implements OnDestroy { protected searchStoreValue = this.#store.selectSignal(SearchSelectors.getSearchText); protected resourcesTabStoreValue = this.#store.selectSignal(SearchSelectors.getResourceTab); protected sortByStoreValue = this.#store.selectSignal(SearchSelectors.getSortBy); - readonly isMyProfilePage = this.#store.selectSignal(SearchSelectors.getIsMyProfile); + protected readonly resourceTabOptions = SEARCH_TAB_OPTIONS; protected selectedTab: ResourceTab = ResourceTab.All; - protected readonly ResourceTab = ResourceTab; - protected currentStep = 0; + + protected currentStep = signal(0); constructor() { effect(() => { @@ -89,13 +97,6 @@ export class SearchComponent implements OnDestroy { this.#store.dispatch(GetResources); }); - this.searchControl.valueChanges - .pipe(skip(1), debounceTime(500), takeUntilDestroyed(this.destroyRef)) - .subscribe((searchText) => { - this.#store.dispatch(new SetSearchText(searchText ?? '')); - this.#store.dispatch(GetAllOptions); - }); - effect(() => { const storeValue = this.searchStoreValue(); const currentInput = untracked(() => this.searchControl.value); @@ -110,6 +111,13 @@ export class SearchComponent implements OnDestroy { this.selectedTab = this.resourcesTabStoreValue(); } }); + + this.setSearchSubscription(); + } + + ngOnDestroy(): void { + this.#store.dispatch(ResetFiltersState); + this.#store.dispatch(ResetSearchState); } onTabChange(index: ResourceTab): void { @@ -118,8 +126,17 @@ export class SearchComponent implements OnDestroy { this.#store.dispatch(GetAllOptions); } - ngOnDestroy(): void { - this.#store.dispatch(ResetFiltersState); - this.#store.dispatch(ResetSearchState); + showTutorial() { + this.currentStep.set(1); + } + + private setSearchSubscription() { + this.searchControl.valueChanges + .pipe(skip(1), debounceTime(500), takeUntilDestroyed(this.destroyRef)) + .subscribe((searchText) => { + console.log(searchText); + this.#store.dispatch(new SetSearchText(searchText ?? '')); + this.#store.dispatch(GetAllOptions); + }); } } diff --git a/src/app/features/settings/account-settings/components/connected-emails/connected-emails.component.scss b/src/app/features/settings/account-settings/components/connected-emails/connected-emails.component.scss index b465245b2..88ecc4f57 100644 --- a/src/app/features/settings/account-settings/components/connected-emails/connected-emails.component.scss +++ b/src/app/features/settings/account-settings/components/connected-emails/connected-emails.component.scss @@ -81,7 +81,7 @@ } } - @media (max-width: 600px) { + @media (max-width: var.$breakpoint-sm) { .account-setting-email { flex-wrap: wrap; gap: 0.5rem; diff --git a/src/app/features/settings/notifications/notifications.component.scss b/src/app/features/settings/notifications/notifications.component.scss index b9e14d13c..97ce219e6 100644 --- a/src/app/features/settings/notifications/notifications.component.scss +++ b/src/app/features/settings/notifications/notifications.component.scss @@ -17,7 +17,7 @@ color: var.$dark-blue-1; } - @media (max-width: 576px) { + @media (max-width: var.$breakpoint-sm) { padding: 12px; } } @@ -33,7 +33,7 @@ width: 50%; } - @media (max-width: 576px) { + @media (max-width: var.$breakpoint-sm) { grid-template-columns: 1fr; grid-template-rows: repeat(10, 1fr); grid-row-gap: 0; diff --git a/src/app/shared/components/index.ts b/src/app/shared/components/index.ts index 9e50cb85d..b4f37c2e0 100644 --- a/src/app/shared/components/index.ts +++ b/src/app/shared/components/index.ts @@ -15,6 +15,7 @@ export { MyProjectsTableComponent } from './my-projects-table/my-projects-table. export { PasswordInputHintComponent } from './password-input-hint/password-input-hint.component'; export { PieChartComponent } from './pie-chart/pie-chart.component'; export { ResourceCardComponent } from './resource-card/resource-card.component'; +export { SearchHelpTutorialComponent } from './search-help-tutorial/search-help-tutorial.component'; export { SearchInputComponent } from './search-input/search-input.component'; export { SelectComponent } from './select/select.component'; export { SubHeaderComponent } from './sub-header/sub-header.component'; diff --git a/src/app/shared/components/search-help-tutorial/search-help-tutorial.component.html b/src/app/shared/components/search-help-tutorial/search-help-tutorial.component.html new file mode 100644 index 000000000..70c7ad960 --- /dev/null +++ b/src/app/shared/components/search-help-tutorial/search-help-tutorial.component.html @@ -0,0 +1,22 @@ +@for (step of steps(); track $index) { + @if (currentStep() === $index + 1) { +
+

{{ step.title | translate }}

+ +

{{ step.description | translate }}

+ +
+

{{ 'searchHelpTutorial.stepCount' | translate: { current: $index + 1, total: steps().length } }}

+ +
+ @if ($index + 1 !== steps().length) { + + + } @else { + + } +
+
+
+ } +} diff --git a/src/app/shared/components/search-help-tutorial/search-help-tutorial.component.scss b/src/app/shared/components/search-help-tutorial/search-help-tutorial.component.scss new file mode 100644 index 000000000..46f997428 --- /dev/null +++ b/src/app/shared/components/search-help-tutorial/search-help-tutorial.component.scss @@ -0,0 +1,18 @@ +@use "assets/styles/variables" as var; +@use "assets/styles/mixins" as mix; + +.stepper { + position: absolute; + display: flex; + flex-direction: column; + background: var.$white; + border: 1px solid var.$grey-2; + border-radius: 12px; + row-gap: mix.rem(24px); + padding: mix.rem(24px); + width: 32rem; + + .stepper-title { + font-size: mix.rem(18px); + } +} diff --git a/src/app/shared/components/search-help-tutorial/search-help-tutorial.component.spec.ts b/src/app/shared/components/search-help-tutorial/search-help-tutorial.component.spec.ts new file mode 100644 index 000000000..36669dabc --- /dev/null +++ b/src/app/shared/components/search-help-tutorial/search-help-tutorial.component.spec.ts @@ -0,0 +1,22 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SearchHelpTutorialComponent } from './search-help-tutorial.component'; + +describe('SearchHelpTutorialComponent', () => { + let component: SearchHelpTutorialComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [SearchHelpTutorialComponent], + }).compileComponents(); + + fixture = TestBed.createComponent(SearchHelpTutorialComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/shared/components/search-help-tutorial/search-help-tutorial.component.ts b/src/app/shared/components/search-help-tutorial/search-help-tutorial.component.ts new file mode 100644 index 000000000..df72df6b9 --- /dev/null +++ b/src/app/shared/components/search-help-tutorial/search-help-tutorial.component.ts @@ -0,0 +1,40 @@ +import { TranslateModule } from '@ngx-translate/core'; + +import { Button } from 'primeng/button'; + +import { CommonModule } from '@angular/common'; +import { ChangeDetectionStrategy, Component, model, signal } from '@angular/core'; + +import { SEARCH_TUTORIAL_STEPS } from '@osf/shared/constants'; +import { TutorialStep } from '@osf/shared/models'; + +@Component({ + selector: 'osf-search-help-tutorial', + imports: [Button, TranslateModule, CommonModule], + templateUrl: './search-help-tutorial.component.html', + styleUrl: './search-help-tutorial.component.scss', + changeDetection: ChangeDetectionStrategy.OnPush, +}) +export class SearchHelpTutorialComponent { + currentStep = model(0); + + steps = signal(SEARCH_TUTORIAL_STEPS); + + skip() { + this.currentStep.set(0); + } + + nextStep() { + const nextStepIndex = this.currentStep() + 1; + + if (nextStepIndex > this.steps().length) { + this.currentStep.set(0); + } else { + this.currentStep.set(nextStepIndex); + } + } + + getStepPosition(step: TutorialStep) { + return step.position || {}; + } +} diff --git a/src/app/shared/components/search-input/search-input.component.html b/src/app/shared/components/search-input/search-input.component.html index 3527ea175..9028ae4ad 100644 --- a/src/app/shared/components/search-input/search-input.component.html +++ b/src/app/shared/components/search-input/search-input.component.html @@ -1,11 +1,26 @@
- + + + + @if (showHelpIcon()) { + Info icon + }
diff --git a/src/app/shared/components/search-input/search-input.component.scss b/src/app/shared/components/search-input/search-input.component.scss index 7f952d58f..c85d70a7a 100644 --- a/src/app/shared/components/search-input/search-input.component.scss +++ b/src/app/shared/components/search-input/search-input.component.scss @@ -4,11 +4,10 @@ .search-container { position: relative; - .osf-icon-search { + .search-icon { position: absolute; left: mix.rem(12px); color: var.$grey-1; - font-size: mix.rem(16px); } .search-input { @@ -20,4 +19,9 @@ color: var.$grey-1; } } + + .help-icon { + position: absolute; + right: mix.rem(6px); + } } diff --git a/src/app/shared/components/search-input/search-input.component.ts b/src/app/shared/components/search-input/search-input.component.ts index bd2cf9697..92c5427bf 100644 --- a/src/app/shared/components/search-input/search-input.component.ts +++ b/src/app/shared/components/search-input/search-input.component.ts @@ -1,11 +1,14 @@ import { InputText } from 'primeng/inputtext'; +import { NgOptimizedImage } from '@angular/common'; import { ChangeDetectionStrategy, Component, input, output } from '@angular/core'; import { FormControl, ReactiveFormsModule } from '@angular/forms'; +import { IconComponent } from '../icon/icon.component'; + @Component({ selector: 'osf-search-input', - imports: [InputText, ReactiveFormsModule], + imports: [InputText, ReactiveFormsModule, IconComponent, NgOptimizedImage], templateUrl: './search-input.component.html', styleUrl: './search-input.component.scss', changeDetection: ChangeDetectionStrategy.OnPush, @@ -13,9 +16,12 @@ import { FormControl, ReactiveFormsModule } from '@angular/forms'; export class SearchInputComponent { control = input(new FormControl('')); placeholder = input(''); + showHelpIcon = input(false); + triggerSearch = output(); + helpClicked = output(); - onEnterClicked() { + enterClicked() { const searchValue = this.control().value; if (!searchValue || !searchValue?.trim()?.length) { diff --git a/src/app/shared/constants/index.ts b/src/app/shared/constants/index.ts index 76ba73048..d78e9d0cf 100644 --- a/src/app/shared/constants/index.ts +++ b/src/app/shared/constants/index.ts @@ -5,4 +5,6 @@ export * from './resource-filters-defaults'; export * from './scientists.const'; export * from './search-sort-options.const'; export * from './search-state-defaults.const'; +export * from './search-tab-options.const'; +export * from './search-tutorial-steps.const'; export * from './sort-options.const'; diff --git a/src/app/shared/constants/search-tab-options.const.ts b/src/app/shared/constants/search-tab-options.const.ts new file mode 100644 index 000000000..131ef093a --- /dev/null +++ b/src/app/shared/constants/search-tab-options.const.ts @@ -0,0 +1,11 @@ +import { ResourceTab } from '../enums'; +import { TabOption } from '../models'; + +export const SEARCH_TAB_OPTIONS: TabOption[] = [ + { label: 'common.search.tabs.all', value: ResourceTab.All }, + { label: 'common.search.tabs.files', value: ResourceTab.Files }, + { label: 'common.search.tabs.preprints', value: ResourceTab.Preprints }, + { label: 'common.search.tabs.projects', value: ResourceTab.Projects }, + { label: 'common.search.tabs.registrations', value: ResourceTab.Registrations }, + { label: 'common.search.tabs.users', value: ResourceTab.Users }, +]; diff --git a/src/app/shared/constants/search-tutorial-steps.const.ts b/src/app/shared/constants/search-tutorial-steps.const.ts new file mode 100644 index 000000000..59180f1c5 --- /dev/null +++ b/src/app/shared/constants/search-tutorial-steps.const.ts @@ -0,0 +1,19 @@ +import { TutorialStep } from '../models'; + +export const SEARCH_TUTORIAL_STEPS: TutorialStep[] = [ + { + title: 'searchHelpTutorial.step1.title', + description: 'searchHelpTutorial.step1.description', + position: { top: '2rem', left: '1.5rem' }, + }, + { + title: 'searchHelpTutorial.step2.title', + description: 'searchHelpTutorial.step2.description', + position: { top: 'calc(2rem + 42px)', left: 'calc(1.5rem + 30%)' }, + }, + { + title: 'searchHelpTutorial.step3.title', + description: 'searchHelpTutorial.step3.description', + position: { top: 'calc(5rem + 42px)', left: 'calc(0.4rem + 30%)' }, + }, +]; diff --git a/src/app/shared/models/index.ts b/src/app/shared/models/index.ts index 74def860f..3e8d903bf 100644 --- a/src/app/shared/models/index.ts +++ b/src/app/shared/models/index.ts @@ -15,6 +15,7 @@ export * from './social-icon.model'; export * from './store'; export * from './tab-option.model'; export * from './table-parameters.model'; +export * from './tutorial-step.model'; export * from './update-node-request.model'; export * from './user'; export * from './validation-params.model'; diff --git a/src/app/shared/models/tutorial-step.model.ts b/src/app/shared/models/tutorial-step.model.ts new file mode 100644 index 000000000..2febbe2e1 --- /dev/null +++ b/src/app/shared/models/tutorial-step.model.ts @@ -0,0 +1,12 @@ +export interface TutorialStep { + title: string; + description: string; + position?: Position; +} + +interface Position { + top?: string; + left?: string; + right?: string; + bottom?: string; +} diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index bc0a861ab..e9d9261df 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -11,11 +11,21 @@ "copy": "Copy", "move": "Move", "rename": "Rename", - "next": "Next" + "next": "Next", + "skip": "Skip", + "done": "Done" }, "search": { "title": "Search", - "noResultsFound": "No results found." + "noResultsFound": "No results found.", + "tabs": { + "all": "All", + "preprints": "Preprints", + "registrations": "Registrations", + "projects": "Projects", + "files": "Files", + "users": "Users" + } }, "labels": { "downloads": "Downloads" @@ -1288,5 +1298,20 @@ "maxLength": "The field must be at most {{length}} characters.", "minLength": "The field must be at least {{length}} characters.", "invalidInput": "Invalid input." + }, + "searchHelpTutorial": { + "step1": { + "title": "Improved OSF Search", + "description": "Enter any term in the search box and filter by specific object types. More information is available on our help guides." + }, + "step2": { + "title": "Refine Your Search", + "description": "Narrow the source, discipline, and more. For example, find content supported by a specific funder or view only datasets." + }, + "step3": { + "title": "Add Metadata", + "description": "Remember to add metadata and resources to your own work on OSF to make it more discoverable! Learn more in our help guides." + }, + "stepCount": "{{current}} of {{total}}" } } diff --git a/src/assets/styles/overrides/accordion.scss b/src/assets/styles/overrides/accordion.scss index 542247913..126282060 100644 --- a/src/assets/styles/overrides/accordion.scss +++ b/src/assets/styles/overrides/accordion.scss @@ -64,6 +64,7 @@ .p-accordion { .p-accordioncontent-content { padding-bottom: 1.5rem; + .content-body { display: flex; flex-direction: column; @@ -110,16 +111,4 @@ } } } - - @media (max-width: 1000px) { - .p-accordion { - row-gap: 0.5rem; - } - } - - @media (max-width: 600px) { - .p-accordion { - row-gap: 1.7rem; - } - } } diff --git a/src/assets/styles/overrides/table.scss b/src/assets/styles/overrides/table.scss index 13ac4bbe4..5331616a5 100644 --- a/src/assets/styles/overrides/table.scss +++ b/src/assets/styles/overrides/table.scss @@ -101,7 +101,7 @@ p-table { } } -@media (max-width: 1279.99px) { +@media (max-width: var.$breakpoint-xl) { .home-table { .p-datatable { padding: 1.71rem 0.85rem 1.71rem 0.85rem; @@ -149,7 +149,7 @@ p-table { } } -@media (max-width: 599.99px) { +@media (max-width: var.$breakpoint-sm) { .home-table { .p-datatable { padding: 0.4rem;