Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate entity features #181

Merged
merged 62 commits into from
Jan 5, 2023
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
f23fdb2
Combine page entity icon and status icon into one component
floydnant Dec 6, 2022
390fb50
Spike: add sidebar tree demo, add entity page label
floydnant Dec 6, 2022
1aec660
Add task and tasklist models
floydnant Dec 15, 2022
0e0be25
Add task/list store
floydnant Dec 15, 2022
5113c0e
Integrate tasklists into sidebar tree
floydnant Dec 15, 2022
759ef04
Hide sidebar scroll bar when unused
floydnant Dec 15, 2022
ed68512
Add ability to create a sublists right from a tree node
floydnant Dec 15, 2022
c4d372b
Fix unit tests
floydnant Dec 15, 2022
f28493b
✅ Add httpServiceMock import
floydnant Dec 15, 2022
1d99dd1
Add a no toggle icon
floydnant Dec 16, 2022
36c8abd
Add loading spinner, placeholder to tree
floydnant Dec 16, 2022
edb4dcb
Add create root list button
floydnant Dec 16, 2022
75e9f94
Add tree node drop down menu
floydnant Dec 16, 2022
2f10ae6
Add more crud operations
floydnant Dec 16, 2022
d95a6d0
Extract out main pane from sidebar into own component, extract out en…
floydnant Dec 23, 2022
1e64da5
Add breadcrumbs component
floydnant Dec 23, 2022
94ebfec
Display children and a createNewSublist button on entity page
floydnant Dec 23, 2022
8c293a8
Add reactive rename feature to entity page
floydnant Dec 23, 2022
d3993f0
Make tree nodes clickable links
floydnant Dec 23, 2022
f8caa5a
Prefill rename prompt with current title, create new lists as untitled
floydnant Dec 23, 2022
a31cad3
Add forgotten package declaration
floydnant Dec 23, 2022
6a546c4
Random minor changes
floydnant Dec 23, 2022
992fa8c
Fix unit tests
floydnant Dec 23, 2022
1e57792
Fix component tests
floydnant Dec 23, 2022
ea79c71
Add entity-page placeholder => dashboard
floydnant Dec 24, 2022
4d15b5d
Add redirect to parent tasklist after deleting a list
floydnant Dec 24, 2022
5d30638
Abtract dialogs into store
floydnant Dec 25, 2022
123490d
Add drop down menus to entity page, minor refactoring in entity page
floydnant Dec 25, 2022
510dac9
Fix unit tests
floydnant Dec 25, 2022
6123938
Improve default listname behaviour, add placeholder, improve performance
floydnant Dec 25, 2022
d36800e
Add the double ellipsis menu as context menu to tree nodes, clean up
floydnant Dec 25, 2022
c7b5906
Add context menu to breadcrumbs
floydnant Dec 26, 2022
8198a15
Add reveal active entity in explorer feature
floydnant Dec 26, 2022
2ab2c5d
Fix unit tests
floydnant Dec 26, 2022
6dd4640
Update app title strategy
floydnant Dec 26, 2022
8a34f35
Generalize/rename list stuff to entity, for a more generic naming con…
floydnant Dec 26, 2022
b59790e
Update dashboard component folder name to match
floydnant Dec 26, 2022
312b6d8
Merge branch 'main' into integrate-tasklist
floydnant Dec 26, 2022
7068aae
Abstact out entity services into a generic API, put interfaces into m…
floydnant Dec 27, 2022
2b14500
Split user.service into auth and account service, rename state files …
floydnant Dec 27, 2022
7e06144
Scroll entity-page to top on navigation
floydnant Dec 28, 2022
d8edca3
Add "remove hardcode" comments
floydnant Dec 28, 2022
71b2eb7
Abstract out entity-page into a separate view and dynamic components …
floydnant Dec 30, 2022
ad0ca3b
Add loading state to editable-entity-name, fix buggy auto updates whi…
floydnant Dec 30, 2022
cb42dd8
Add loading toast as opt-in back into the rename effect
floydnant Dec 30, 2022
afd6047
Fix bug introduced by prev commit
floydnant Dec 30, 2022
42d55b7
Fix unit tests
floydnant Dec 30, 2022
e85d7ab
Integrate description feature
floydnant Jan 1, 2023
75dc6b2
Add error logging to actionLogger meta reducer
floydnant Jan 1, 2023
b011bb2
Address comments 1.0 (Remove dead comments)
floydnant Jan 1, 2023
d06e33a
Use OnPush strategy for task.component as well
floydnant Jan 1, 2023
f6be9cd
Address comments 2.0
floydnant Jan 1, 2023
267effa
Fix unit tests
floydnant Jan 1, 2023
21840a5
Address comments 3.0 (remove dead comments)
floydnant Jan 1, 2023
8c78de0
Write unit test for store utils
floydnant Jan 1, 2023
5c46169
Add refactoring hint comment to server
floydnant Jan 1, 2023
fb3fb4a
Write component tests for breadcrumbs
floydnant Jan 1, 2023
40aad30
Write component tests for TasklistViewComponent
floydnant Jan 1, 2023
fd768c7
Fixup prev commit
floydnant Jan 1, 2023
159d83c
Comment out component tests, comment out var process dummy
floydnant Jan 3, 2023
6c38d8b
Write home e2e tests
floydnant Jan 4, 2023
665eb38
Merge branch 'main' into integrate-tasklist
floydnant Jan 4, 2023
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
7 changes: 7 additions & 0 deletions client-v2/angular.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"schematics": {
"@schematics/angular": {
"component": {
"changeDetection": "OnPush"
}
}
},
"version": 1,
"newProjectRoot": "projects",
"projects": {
Expand Down
23 changes: 22 additions & 1 deletion client-v2/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion client-v2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "2.0.0",
"scripts": {
"dev": "ng serve",
"dev:lan": "ng serve --host 0.0.0.0",
"dev:lan": "echo \"Listening on http://$(ipconfig getifaddr en0):4200\" && NG_APP_SERVER_BASE_URL=http://$(ipconfig getifaddr en0):3000 ng serve --host 0.0.0.0",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"update-colors": "ts-node ./tools/update-colors.cts",
Expand Down Expand Up @@ -34,6 +34,7 @@
"@angular/router": "^14.2.12",
"@ngneat/hot-toast": "^4.1.0",
"@ngneat/overview": "^3.0.0",
"@ngneat/until-destroy": "^9.2.2",
"@ngrx/effects": "^14.3.2",
"@ngrx/store": "^14.3.2",
"@ngrx/store-devtools": "^14.3.2",
Expand Down
41 changes: 37 additions & 4 deletions client-v2/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
import { NgModule } from '@angular/core'
import { inject, NgModule } from '@angular/core'
import { RouterModule, Routes } from '@angular/router'
import { Store } from '@ngrx/store'
import { environment } from '../environments/environment'
import { AuthGuard } from './guards/auth.guard'
import { AuthComponent } from './pages/auth/auth.component'
import { LoginLoadingComponent } from './pages/auth/login-loading/login-loading.component'
import { LoginComponent } from './pages/auth/login/login.component'
import { SignupComponent } from './pages/auth/signup/signup.component'
import { ComponentPlaygroundComponent } from './pages/component-playground/component-playground.component'
import { DashboardComponent } from './pages/home/dashboard/dashboard.component'
import { EntityPageComponent } from './pages/home/entity-page/entity-page.component'
import { HomeComponent } from './pages/home/home.component'
import { LandingPageComponent } from './pages/landing-page/landing-page.component'
import { NotFoundPageComponent } from './pages/not-found-page/not-found-page.component'
import { SettingsAccountComponent } from './pages/settings/account/account.component'
import { SettingsAppearanceComponent } from './pages/settings/appearance/appearance.component'
import { SettingsGeneralComponent } from './pages/settings/general/general.component'
import { SettingsComponent } from './pages/settings/settings.component'
import { AppState } from './store'
import { getEntityById } from './store/entities/utils'

const ENVIRONMENT_HINT = `[${environment.REVIEW_ID ? environment.REVIEW_ID + '-' : ''}${environment.CONTEXT}]`
const APP_TITLE = `Rockket ${environment.CONTEXT == 'Production' ? '' : ENVIRONMENT_HINT}`
const APP_TITLE_SUFFIX = `- ${APP_TITLE}`

const routes: Routes = [
{
path: '',
component: LandingPageComponent,
pathMatch: 'full',
title: APP_TITLE,
},
{
path: 'auth',
Expand All @@ -27,14 +38,17 @@ const routes: Routes = [
{
path: 'login',
component: LoginComponent,
title: `Login ${APP_TITLE_SUFFIX}`,
},
{
path: 'signup',
component: SignupComponent,
title: `Signup ${APP_TITLE_SUFFIX}`,
},
{
path: 'login-loading',
component: LoginLoadingComponent,
title: `Confirming Login... ${APP_TITLE_SUFFIX}`,
},
{
path: '',
Expand All @@ -47,6 +61,19 @@ const routes: Routes = [
path: 'home',
component: HomeComponent,
canActivate: [AuthGuard],
children: [
{
path: ':id',
component: EntityPageComponent,
title: route =>
inject(Store).select((state: AppState) => {
const activeEntityId = route.paramMap.get('id') as string
const activeEntity = getEntityById(state.entities.entityTree || [], activeEntityId)
return activeEntity ? `${activeEntity.name} ${APP_TITLE_SUFFIX}` : APP_TITLE
}),
},
{ path: '', component: DashboardComponent, title: `Dashboard ${APP_TITLE_SUFFIX}` },
],
},
{
path: 'settings',
Expand All @@ -58,18 +85,24 @@ const routes: Routes = [
pathMatch: 'full',
redirectTo: 'general',
},
{ path: 'general', component: SettingsGeneralComponent },
{ path: 'account', component: SettingsAccountComponent },
{ path: 'appearance', component: SettingsAppearanceComponent },
{ path: 'general', component: SettingsGeneralComponent, title: `General Settings ${APP_TITLE_SUFFIX}` },
{ path: 'account', component: SettingsAccountComponent, title: `Account Settings ${APP_TITLE_SUFFIX}` },
{
path: 'appearance',
component: SettingsAppearanceComponent,
title: `Appearance Settings ${APP_TITLE_SUFFIX}`,
},
],
},
{
path: 'playground',
component: ComponentPlaygroundComponent,
title: `Component Playground ${APP_TITLE_SUFFIX}`,
},
{
path: '**',
component: NotFoundPageComponent,
title: `404 Not Found ${APP_TITLE_SUFFIX}`,
},
]

Expand Down
22 changes: 22 additions & 0 deletions client-v2/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ import { IconsModule } from './components/atoms/icons/icons.module'
import { OverlayModule } from '@angular/cdk/overlay'
import { TooltipDirective } from './directives/tooltip.directive'
import { TooltipComponent } from './components/atoms/tooltip/tooltip.component'
import { CdkTreeModule } from '@angular/cdk/tree'
import { EntityPageLabelComponent } from './components/atoms/entity-page-label/entity-page-label.component'
import { EntityPageComponent } from './pages/home/entity-page/entity-page.component'
import { BreadcrumbsComponent } from './components/molecules/breadcrumbs/breadcrumbs.component'
import { MainPaneComponent } from './components/templates/main-pane/main-pane.component'
import { MutationDirective } from './directives/mutation.directive'
import { MenuToggleComponent } from './components/templates/sidebar-layout/menu-toggle/menu-toggle.component'
import { DashboardComponent } from './pages/home/dashboard/dashboard.component'
import { EntityViewComponent } from './components/organisms/entity-view/entity-view.component'
import { TasklistViewComponent } from './components/organisms/entity-view/views/tasklist-view/tasklist-view.component'
import { EditableEntityNameComponent } from './components/molecules/editable-entity-heading/editable-entity-name.component'

@NgModule({
declarations: [
Expand Down Expand Up @@ -67,6 +78,16 @@ import { TooltipComponent } from './components/atoms/tooltip/tooltip.component'
DropDownComponent,
TooltipDirective,
TooltipComponent,
EntityPageLabelComponent,
EntityPageComponent,
BreadcrumbsComponent,
MainPaneComponent,
MutationDirective,
MenuToggleComponent,
DashboardComponent,
EntityViewComponent,
TasklistViewComponent,
EditableEntityNameComponent,
],
imports: [
BrowserModule,
Expand Down Expand Up @@ -104,6 +125,7 @@ import { TooltipComponent } from './components/atoms/tooltip/tooltip.component'
IconsModule,
ModalModule,
OverlayModule,
CdkTreeModule,
],
providers: [],
bootstrap: [AppComponent],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
import { PageEntityIconKey } from '../icons/page-entity-icon/page-entity-icon.component'

@Component({
selector: 'app-entity-page-label',
template: `
<span class="inline-flex justify-center">
<page-entity-icon class="icon | mr-1 inline-block w-4 text-md" [icon]="pageIcon"></page-entity-icon>
</span>
<span class="title | truncate">{{ title }}</span>
`,
styles: [
`
:host {
@apply truncate;
}
`,
],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class EntityPageLabelComponent {
@Input() title!: string
@Input() pageIcon!: PageEntityIconKey
}
3 changes: 0 additions & 3 deletions client-v2/src/app/components/atoms/icons/icons.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { IconComponent } from './icon/icon.component'
import { LoadingSpinnerComponent } from './loading-spinner/loading-spinner.component'
import { PageEntityIconComponent } from './page-entity-icon/page-entity-icon.component'
import { PriorityIconComponent } from './priority-icon/priority-icon.component'
import { StatusIconComponent } from './status-icon/status-icon.component'

@NgModule({
declarations: [
Expand All @@ -14,7 +13,6 @@ import { StatusIconComponent } from './status-icon/status-icon.component'
LoadingSpinnerComponent,
PageEntityIconComponent,
PriorityIconComponent,
StatusIconComponent,
],
imports: [CommonModule],
exports: [
Expand All @@ -23,7 +21,6 @@ import { StatusIconComponent } from './status-icon/status-icon.component'
LoadingSpinnerComponent,
PageEntityIconComponent,
PriorityIconComponent,
StatusIconComponent,
],
})
export class IconsModule {}
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
<status-icon *ngIf="icon != 'tasklist'" [status]="icon"> </status-icon>

<app-icon *ngIf="icon == 'tasklist'" iconClass="far fa-tasks text-tinted-300"></app-icon>
<app-icon [iconClass]="entityIconClassMap[icon]"></app-icon>
Original file line number Diff line number Diff line change
@@ -1,13 +1,63 @@
import { Component, Input } from '@angular/core'
import { TaskDisplayState } from '../status-icon/status-icon.component'
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
import { EntityType } from 'src/app/models/entities.model'
import { TaskStatus } from 'src/app/models/task.model'

export type PageEntityIconKey = TaskDisplayState | 'tasklist'
/** This will come from the db */
// export enum EntityType {
// TASKLIST = 'Tasklist',
// TASK = 'Task',
// DOCUMENT = 'Document',
// VIEW = 'View',
// }

floydnant marked this conversation as resolved.
Show resolved Hide resolved
export enum PageEntityState {
LOADING = 'Loading',
}

export enum TaskState {
BLOCKED = 'Blocked',
// LOADING = 'Loading',
}
export type TaskIconKey = TaskStatus | TaskState

// const entityTypeWithoutTask = {
// [EntityType.TASKLIST]: 'Tasklist',
// [EntityType.DOCUMENT]: 'Document',
// [EntityType.VIEW]: 'View',
// }
// type EntityTypeWihoutTask = keyof typeof entityTypeWithoutTask
floydnant marked this conversation as resolved.
Show resolved Hide resolved
export type PageEntityIconKey = TaskIconKey | EntityType | PageEntityState

export const taskStatusIconClassMap: Record<TaskIconKey, string> = {
[TaskStatus.OPEN]: 'far fa-circle text-tinted-300',
[TaskStatus.IN_PROGRESS]: 'far fa-clock text-secondary-400',
[TaskStatus.BACKLOG]: 'fas fa-spinner text-tinted-300 rotate-[-45deg]',
[TaskStatus.COMPLETED]: 'fas fa-check-circle text-submit-400',
[TaskStatus.NOT_PLANNED]: 'fas fa-times-circle text-danger-400',
[TaskState.BLOCKED]: 'far fa-ban text-tinted-300',
// [TaskState.LOADING]: 'far fa-spinner-third animate-spin text-tinted-200',
}

export const entityIconClassMap: Record<PageEntityIconKey, string> = {
[EntityType.TASKLIST]: 'far fa-tasks text-tinted-400',
// [EntityType.DOCUMENT]: 'far fa-file-alt text-tinted-400',
// [EntityType.VIEW]: 'far fa-binoculars text-tinted-400',
[PageEntityState.LOADING]: 'far fa-spinner-third animate-spin text-tinted-200',
...taskStatusIconClassMap,
}

export const isPageEntityIcon = (iconClass: string): iconClass is PageEntityIconKey => {
return iconClass in entityIconClassMap
}

@Component({
selector: 'page-entity-icon',
templateUrl: './page-entity-icon.component.html',
styleUrls: ['./page-entity-icon.component.css'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class PageEntityIconComponent {
@Input() icon!: PageEntityIconKey

entityIconClassMap = entityIconClassMap
}

This file was deleted.

This file was deleted.

Loading