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

Release v0.0.2 #15

Merged
merged 68 commits into from
Jan 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
2ec5468
build(dep): `@babylonjs` & `@types/node`:
PhilippeMorier Dec 10, 2019
7d237f1
feat(apps/frontend): select initial tool
PhilippeMorier Dec 10, 2019
b9a2b8e
fix(apps/frontend): import hammerjs
PhilippeMorier Dec 10, 2019
05ec1fa
refactor(frontend): scene-viewer into container
PhilippeMorier Dec 10, 2019
b2bd8ad
feat(frontend): dispatch `pointerPick` action
PhilippeMorier Dec 10, 2019
ceee013
feat(frontend): dispatch `add|removeVoxel` action
PhilippeMorier Dec 11, 2019
f9c122b
build(packaging): simplify `prettier:check` command
PhilippeMorier Dec 11, 2019
72c89e0
doc(frontend): add readme with ngrx resources
PhilippeMorier Dec 11, 2019
d6eafd5
feat(frontend): support adding voxel
PhilippeMorier Dec 12, 2019
2e68605
refactor(frontend): don't inject `GridService`
PhilippeMorier Dec 12, 2019
157da40
feat(frontend): effects for when app goes on/offline
PhilippeMorier Dec 12, 2019
4ad0a04
test(frontend): on/offline effects
PhilippeMorier Dec 12, 2019
f7419eb
test(vdb): remove `normals` from test
PhilippeMorier Dec 12, 2019
99fed10
feat(vdb): add `setValueOff` & `isValueOn`
PhilippeMorier Dec 12, 2019
29161bc
test(frontend): set expected position to pass
PhilippeMorier Dec 12, 2019
c015944
fix(frontend): make public for use in template
PhilippeMorier Dec 12, 2019
31ea920
build(dep): `@types/node` & `core-js`
PhilippeMorier Dec 12, 2019
11fa2eb
feat(frontend): enable `removeVoxel`
PhilippeMorier Dec 12, 2019
5a8df98
build(dep): `@babylonjs/*`
PhilippeMorier Dec 12, 2019
38002fb
build(github): keep `develop` after PR merge
PhilippeMorier Dec 12, 2019
2e5f6b3
build(dep): `cypress` to `v3.8.0`
PhilippeMorier Dec 16, 2019
9629429
build(dep): `cypress` to `v3.7.0`
PhilippeMorier Dec 16, 2019
bb5440f
test(vdb): set value with float coordinates:
PhilippeMorier Dec 17, 2019
1362079
build(dep): `cypress` to `v3.7.0`
PhilippeMorier Dec 17, 2019
e8cd3c9
feat(frontend): support adding and removing voxels
PhilippeMorier Dec 18, 2019
97ff0c6
test(ui): remove unused imported components
PhilippeMorier Dec 19, 2019
b041d82
build(CircleCi): use `13.3.0` due failing tests:
PhilippeMorier Dec 19, 2019
a96dfed
fix(frontend): add voxel on positive normal
PhilippeMorier Dec 19, 2019
575e9db
test(frontend): set `setupFilesAfterEnv`
PhilippeMorier Dec 19, 2019
596f386
test(frontend): set `globals`>`tsConfig`
PhilippeMorier Dec 19, 2019
c1ddf83
build(CircleCi): use `13.4.0`
PhilippeMorier Dec 19, 2019
3726648
build(dep): update diverse dependencies:
PhilippeMorier Dec 19, 2019
4d690b9
doc(readme): record macro & git setup
PhilippeMorier Dec 20, 2019
2a3f37a
build(dep): `@angular-devkit/build-angular` & `@angular/cli`
PhilippeMorier Dec 20, 2019
ad7f7e1
Merge branch 'master' into develop
PhilippeMorier Dec 20, 2019
479c81b
feat(frontend): draw separate mesh per InternalNode1 (#9)
PhilippeMorier Jan 8, 2020
caa2751
feat(benchmark): test single vs. multiple `array.push()`
PhilippeMorier Jan 8, 2020
97be3c4
build(CircleCi): update node to `13.5.0` & cypress `3.8.1`
PhilippeMorier Jan 8, 2020
797aef0
build(nx): nx migrate @nrwl/workspace (v8.11.0)
PhilippeMorier Jan 9, 2020
e50fa26
fix(benchmark): add `.nxignore` to get benchmark through linter
PhilippeMorier Jan 9, 2020
22b39b6
build(dep): update dependencies
PhilippeMorier Jan 9, 2020
088dbed
feat(frontend): add undo/redo & enable `strictNullChecks` (#10)
PhilippeMorier Jan 13, 2020
700ff89
feat(frontend): set active state of voxel, return color when deleting…
PhilippeMorier Jan 14, 2020
4b35576
feat(ui/frontend): add menu-bar (#12)
PhilippeMorier Jan 15, 2020
0339543
feat(frontend): undo/redo with start/end actions (#13)
PhilippeMorier Jan 15, 2020
1b569df
build(dep): update dependencies
PhilippeMorier Jan 15, 2020
ce544f5
build(dep): update cypress to `v3.8.2`
PhilippeMorier Jan 15, 2020
917f489
build(dep): update stylelint to `v13.0.0`
PhilippeMorier Jan 15, 2020
88cc433
refactor(ui): prefix UI components with `Ui` like Angular does with `…
PhilippeMorier Jan 16, 2020
4fe0e28
refactor(ui): prefix `UiPointer[Button|PickInfo]` with `Ui`
PhilippeMorier Jan 16, 2020
6ecda72
build(dep): update handlebars to `v4.7.2` due to security issues
PhilippeMorier Jan 16, 2020
98daf1f
test(ui): should emit `value` of clicked menu items
PhilippeMorier Jan 16, 2020
d286d10
test(ui): should emit on tool select
PhilippeMorier Jan 16, 2020
ca7f5f3
test(ui): should close left & right sidenav
PhilippeMorier Jan 16, 2020
d79568c
test(frontend): should dispatch action
PhilippeMorier Jan 16, 2020
8bcc6a2
test(frontend): check `scene-viewer-container.reducer`
PhilippeMorier Jan 16, 2020
d81644e
test(frontend): check `scene-viewer-container.reducer` selector
PhilippeMorier Jan 16, 2020
c2dadc9
refactor(ui): import `hammerjs` to remove warning in test run
PhilippeMorier Jan 16, 2020
2677de4
test(frontend): check `tools-panel.reducer`
PhilippeMorier Jan 16, 2020
4ea47f5
test(frontend): check `undo-redo.reducer`
PhilippeMorier Jan 16, 2020
dffd51f
test(frontend): check `undo-redo.reducer` with `stepX`
PhilippeMorier Jan 16, 2020
43a3552
test(frontend): check `undo-redo.reducer` too many undo/redo's
PhilippeMorier Jan 16, 2020
7d44795
style(prettier): fix imports
PhilippeMorier Jan 16, 2020
bf1a295
test(vdb): add tests for `tree`
PhilippeMorier Jan 16, 2020
e7e93c8
test(vdb): improve coverage
PhilippeMorier Jan 16, 2020
e391604
test(vdb): check coord
PhilippeMorier Jan 16, 2020
a387799
test(vdb): check grid
PhilippeMorier Jan 16, 2020
64a9c08
test(vdb): check `nodeToMesh`
PhilippeMorier Jan 16, 2020
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
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ aliases:
# https://github.com/CircleCI-Public/circleci-dockerfiles/tree/master/node/images
- &use_docker_node
docker:
- image: circleci/node:13.4.0-stretch
- image: circleci/node:13.5.0-stretch

- &use_docker_node_browsers
docker:
- image: circleci/node:13.4.0-stretch-browsers
- image: circleci/node:13.5.0-stretch-browsers

# https://github.com/cypress-io/cypress-docker-images/tree/master/included
- &use_docker_cypress_included
docker:
# 3.8.0 fails with `Error: write EPIPE` when running `benchmark`!?
- image: cypress/included:3.7.0
- image: cypress/included:3.8.2

- &workspace ~/talus

Expand Down
2 changes: 2 additions & 0 deletions .nxignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Hack for getting benchmark app (generated with ng g @nrwl/node:application) through linting
/apps/benchmark
2 changes: 1 addition & 1 deletion apps/benchmark/src/app/vdb/grid.benchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ suite('[Grid] setValue()', () => {
for (let x = 0; x < i; x++) {
for (let y = 0; y < i; y++) {
for (let z = 0; z < i; z++) {
accessor.setValue([x, y, z], i);
accessor.setValueOn([x, y, z], i);
}
}
}
Expand Down
34 changes: 34 additions & 0 deletions apps/benchmark/src/app/vdb/node-to-mesh.benchmark.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { benchmark, suite } from '../../main';

suite('[NodeToMesh] array.push()', () => {
benchmark('multiple small push', () => {
const positions: number[] = [];

positions.push(1);
positions.push(2);
positions.push(3);
positions.push(4);
positions.push(5);
positions.push(6);
positions.push(7);
positions.push(8);
positions.push(9);
positions.push(10);
positions.push(11);
positions.push(12);
positions.push(13);
positions.push(14);
positions.push(15);
positions.push(16);
positions.push(17);
positions.push(18);
positions.push(19);
positions.push(20);
});

benchmark('single big push', () => {
const positions: number[] = [];

positions.push(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20);
});
});
4 changes: 3 additions & 1 deletion apps/benchmark/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ function convertToTestSuite(suiteName: string, currentSuite: Benchmark.Suite): T
}

function sumUpTotalTime(): void {
report.time = report.suites.map(s => s.time).reduce((previous, current) => previous + current, 0);
report.time = report.suites
.map(s => s.time)
.reduce((previous, current) => (previous && current ? previous + current : 0), 0);
}

function everySuiteFinished(): boolean {
Expand Down
5 changes: 4 additions & 1 deletion apps/benchmark/tslint.json
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
{ "extends": "../../tslint.json", "rules": [] }
{
"extends": "../../tslint.json",
"rules": {}
}
2 changes: 1 addition & 1 deletion apps/frontend/src/app/app.actions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createAction } from '@ngrx/store';

const actionTypePrefix = '[App]';
const actionTypePrefix = '[app]';

export const wentOnline = createAction(`${actionTypePrefix} Went online`);
export const wentOffline = createAction(`${actionTypePrefix} Went offline`);
11 changes: 11 additions & 0 deletions apps/frontend/src/app/app.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
:host {
display: flex;
flex-flow: column;
height: 100%;
}

main {
flex-grow: 1;
// https://stackoverflow.com/a/38383437
min-height: 0;
}
20 changes: 16 additions & 4 deletions apps/frontend/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
import { async, TestBed } from '@angular/core/testing';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { RouterTestingModule } from '@angular/router/testing';
import { SceneViewerTestModule, SidenavShellModule } from '@talus/ui';
import { UiSceneViewerTestModule, UiSidenavShellModule } from '@talus/ui';
import { AppComponent } from './app.component';

@Component({
selector: 'fe-menu-bar-container',
template: '',
changeDetection: ChangeDetectionStrategy.OnPush,
})
class MenuBarContainerStubComponent {}

@Component({
selector: 'fe-scene-viewer-container',
template: '',
Expand All @@ -22,12 +29,17 @@ class ToolsPanelStubComponent {}
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [AppComponent, SceneViewerContainerStubComponent, ToolsPanelStubComponent],
declarations: [
AppComponent,
MenuBarContainerStubComponent,
SceneViewerContainerStubComponent,
ToolsPanelStubComponent,
],
imports: [
BrowserAnimationsModule,
RouterTestingModule,
SidenavShellModule,
SceneViewerTestModule,
UiSceneViewerTestModule,
UiSidenavShellModule,
],
}).compileComponents();
}));
Expand Down
31 changes: 20 additions & 11 deletions apps/frontend/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,30 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
@Component({
selector: 'fe-root',
template: `
<ui-sidenav-shell>
<ui-sidenav-shell-left>
<fe-tools-panel></fe-tools-panel>
</ui-sidenav-shell-left>
<header>
<fe-menu-bar-container></fe-menu-bar-container>
</header>

<ui-sidenav-shell-right>
Right
</ui-sidenav-shell-right>
<main>
<ui-sidenav-shell>
<ui-sidenav-shell-left>
<fe-tools-panel></fe-tools-panel>
</ui-sidenav-shell-left>

<ui-sidenav-shell-content>
<fe-scene-viewer-container></fe-scene-viewer-container>
</ui-sidenav-shell-content>
</ui-sidenav-shell>
<ui-sidenav-shell-right>
Right
</ui-sidenav-shell-right>

<ui-sidenav-shell-content>
<fe-scene-viewer-container></fe-scene-viewer-container>
</ui-sidenav-shell-content>
</ui-sidenav-shell>
</main>

<!--<ui-status-bar></ui-status-bar>-->
`,
changeDetection: ChangeDetectionStrategy.OnPush,
styleUrls: ['./app.component.scss'],
})
export class AppComponent {
title = 'frontend';
Expand Down
8 changes: 6 additions & 2 deletions apps/frontend/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { RouterModule } from '@angular/router';
import { EffectsModule } from '@ngrx/effects';
import { StoreModule } from '@ngrx/store';
import { SidenavShellModule } from '@talus/ui';
import { UiSidenavShellModule } from '@talus/ui';
import { AppComponent } from './app.component';
import { AppEffects } from './app.effects';
import { metaReducers, ROOT_REDUCERS } from './app.reducer';
import { MenuBarContainerModule } from './menu-bar-container/menu-bar-container.module';
import { SceneViewerContainerModule } from './scene-viewer-container';
import { ToolsPanelModule } from './tools-panel/tools-panel.module';
import { UndoRedoModule } from './undo-redo/undo-redo.module';

@NgModule({
declarations: [AppComponent],
Expand All @@ -35,9 +37,11 @@ import { ToolsPanelModule } from './tools-panel/tools-panel.module';
},
}),

MenuBarContainerModule,
SceneViewerContainerModule,
SidenavShellModule,
UiSidenavShellModule,
ToolsPanelModule,
UndoRedoModule,
],
providers: [],
bootstrap: [AppComponent],
Expand Down
32 changes: 31 additions & 1 deletion apps/frontend/src/app/app.reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ import {
import { environment } from '../environments/environment';
import * as fromSceneViewerContainer from './scene-viewer-container/scene-viewer-container.reducer';
import * as fromToolsPanel from './tools-panel/tools-panel.reducer';
import * as fromUndoRedo from './undo-redo/undo-redo.reducer';

export interface State {
[fromUndoRedo.featureKey]: fromUndoRedo.State;
[fromToolsPanel.featureKey]: fromToolsPanel.State;
[fromSceneViewerContainer.featureKey]: fromSceneViewerContainer.State;
}
Expand All @@ -27,8 +29,9 @@ export const ROOT_REDUCERS = new InjectionToken<ActionReducerMap<State, Action>>
'Root reducers token',
{
factory: () => ({
[fromToolsPanel.featureKey]: fromToolsPanel.reducer,
[fromSceneViewerContainer.featureKey]: fromSceneViewerContainer.reducer,
[fromToolsPanel.featureKey]: fromToolsPanel.reducer,
[fromUndoRedo.featureKey]: fromUndoRedo.reducer,
}),
},
);
Expand Down Expand Up @@ -78,3 +81,30 @@ export const selectSelectedToolId = createSelector(
selectToolsPanelState,
fromToolsPanel.selectSelectedToolId,
);

/**
* UndoRedo reducers
*/
export const selectUndoRedoState = createFeatureSelector<State, fromUndoRedo.State>(
fromUndoRedo.featureKey,
);

export const selectCurrentUndoStartAction = createSelector(
selectUndoRedoState,
fromUndoRedo.selectCurrentUndoStartAction,
);

export const selectCurrentRedoStartAction = createSelector(
selectUndoRedoState,
fromUndoRedo.selectCurrentRedoStartAction,
);

export const selectCurrentUndoEndAction = createSelector(
selectUndoRedoState,
fromUndoRedo.selectCurrentUndoEndAction,
);

export const selectCurrentRedoEndAction = createSelector(
selectUndoRedoState,
fromUndoRedo.selectCurrentRedoEndAction,
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { createAction } from '@ngrx/store';

const actionTypePrefix = `[menuBarContainer]`;

export const undo = createAction(`${actionTypePrefix} Undo`);
export const redo = createAction(`${actionTypePrefix} Redo`);
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { Store, StoreModule } from '@ngrx/store';
import { MockStore } from '@ngrx/store/testing';
import { ROOT_REDUCERS, State } from '../app.reducer';
import { undo } from './menu-bar-container.actions';
import { MenuBarContainerComponent } from './menu-bar-container.component';
import { MenuBarContainerModule } from './menu-bar-container.module';

describe('MenuBarComponent', () => {
let component: MenuBarContainerComponent;
let fixture: ComponentFixture<MenuBarContainerComponent>;

let store: MockStore<State>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [],
imports: [
MenuBarContainerModule,
StoreModule.forRoot(ROOT_REDUCERS, {
runtimeChecks: {
strictStateImmutability: true,
strictActionImmutability: true,
strictStateSerializability: true,
strictActionSerializability: true,
},
}),
],
}).compileComponents();

store = TestBed.get<Store<State>>(Store);
}));

beforeEach(() => {
spyOn(store, 'dispatch');
});

beforeEach(() => {
fixture = TestBed.createComponent(MenuBarContainerComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});

it('should dispatch action', () => {
component.onMenuItemClick(undo());

expect(store.dispatch).toHaveBeenCalledWith(undo());
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { Action, Store } from '@ngrx/store';
import { UiMenuBarConfig } from '@talus/ui';
import * as fromApp from '../app.reducer';
import { redo, undo } from './menu-bar-container.actions';

@Component({
selector: 'fe-menu-bar-container',
template: `
<ui-menu-bar (menuItemClick)="onMenuItemClick($event)" [menuConfig]="menuConfig"></ui-menu-bar>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class MenuBarContainerComponent {
menuConfig: UiMenuBarConfig<Action> = {
menus: [
{
label: 'Edit',
menuItems: [
{
icon: 'undo',
label: 'Undo',
value: undo(),
},
{
icon: 'redo',
label: 'Redo',
value: redo(),
},
],
},
],
};

constructor(private store: Store<fromApp.State>) {}

onMenuItemClick(action: Action): void {
this.store.dispatch(action);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { NgModule } from '@angular/core';
import { UiMenuBarModule } from '@talus/ui';
import { MenuBarContainerComponent } from './menu-bar-container.component';

@NgModule({
declarations: [MenuBarContainerComponent],
imports: [UiMenuBarModule],
exports: [MenuBarContainerComponent],
})
export class MenuBarContainerModule {}
Loading