mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-22 07:28:14 +00:00
parent
fcd55fb175
commit
f53bd27bb2
3 changed files with 10 additions and 5 deletions
|
|
@ -100,7 +100,7 @@
|
|||
[rightClickTriggerEl]="projectExpandBtn"
|
||||
></context-menu>
|
||||
<ng-template #contextMenu>
|
||||
@for (project of allProjects$ | async; track project.id) {
|
||||
@for (project of allNonInboxProjects$ | async; track project.id) {
|
||||
<button
|
||||
mat-menu-item
|
||||
(click)="toggleProjectVisibility(project)"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import {
|
||||
ChangeDetectionStrategy,
|
||||
Component,
|
||||
effect,
|
||||
ElementRef,
|
||||
HostBinding,
|
||||
HostListener,
|
||||
|
|
@ -8,7 +9,6 @@ import {
|
|||
OnDestroy,
|
||||
viewChild,
|
||||
viewChildren,
|
||||
effect,
|
||||
} from '@angular/core';
|
||||
import { ProjectService } from '../../features/project/project.service';
|
||||
import { T } from '../../t.const';
|
||||
|
|
@ -37,14 +37,14 @@ import { LS } from '../../core/persistence/storage-keys.const';
|
|||
import { TODAY_TAG } from '../../features/tag/tag.const';
|
||||
import { TourId } from '../../features/shepherd/shepherd-steps.const';
|
||||
import { ShepherdService } from '../../features/shepherd/shepherd.service';
|
||||
import { getGithubErrorUrl } from 'src/app/core/error-handler/global-error-handler.util';
|
||||
import { getGithubErrorUrl } from '../../core/error-handler/global-error-handler.util';
|
||||
import { IS_MOUSE_PRIMARY, IS_TOUCH_PRIMARY } from '../../util/is-mouse-primary';
|
||||
import { GlobalConfigService } from '../../features/config/global-config.service';
|
||||
import { CdkDrag, CdkDragDrop, CdkDropList } from '@angular/cdk/drag-drop';
|
||||
import { moveItemBeforeItem } from '../../util/move-item-before-item';
|
||||
import { Store } from '@ngrx/store';
|
||||
import {
|
||||
selectAllProjects,
|
||||
selectAllProjectsExceptInbox,
|
||||
selectUnarchivedHiddenProjectIds,
|
||||
selectUnarchivedVisibleProjects,
|
||||
} from '../../features/project/store/project.selectors';
|
||||
|
|
@ -107,7 +107,9 @@ export class SideNavComponent implements OnDestroy {
|
|||
this.isProjectsExpanded,
|
||||
);
|
||||
|
||||
allProjects$: Observable<Project[]> = this._store.select(selectAllProjects);
|
||||
allNonInboxProjects$: Observable<Project[]> = this._store.select(
|
||||
selectAllProjectsExceptInbox,
|
||||
);
|
||||
nonHiddenProjects$: Observable<Project[]> = this.isProjectsExpanded$.pipe(
|
||||
switchMap((isExpanded) =>
|
||||
isExpanded
|
||||
|
|
|
|||
|
|
@ -8,6 +8,9 @@ export const selectProjectFeatureState =
|
|||
createFeatureSelector<ProjectState>(PROJECT_FEATURE_NAME);
|
||||
const { selectAll } = projectAdapter.getSelectors();
|
||||
export const selectAllProjects = createSelector(selectProjectFeatureState, selectAll);
|
||||
export const selectAllProjectsExceptInbox = createSelector(selectAllProjects, (ps) =>
|
||||
ps.filter((p) => p.id !== INBOX_PROJECT.id),
|
||||
);
|
||||
export const selectUnarchivedProjects = createSelector(selectAllProjects, (projects) =>
|
||||
projects.filter((p) => !p.isArchived),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue