Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c975a16
npm install zod
kbonnici Aug 4, 2023
c3e9486
define schemas for all data types
kbonnici Aug 4, 2023
610aba2
replace JSON.parse with zod parsing
kbonnici Aug 4, 2023
468bce2
update unit test for importProjectsData throwing errors
kbonnici Aug 4, 2023
2342268
add zod-models as a new npm package
kbonnici Aug 7, 2023
6b96762
import zod-models in import.ts
kbonnici Aug 7, 2023
171c48f
add test for valid json but invalid schema
kbonnici Aug 7, 2023
1b18a26
add zod-models to web/package.json
kbonnici Aug 7, 2023
3657fb9
add clarifying comment to cloneConnection()
kbonnici Aug 7, 2023
70677e4
make unit test function again
Connoropolous Aug 7, 2023
1e7ba0b
build zod-models first
Connoropolous Aug 7, 2023
64bfd62
rearrange backwards compat strategy
Connoropolous Aug 7, 2023
0cf6908
try this for fix of projectmeta
Connoropolous Aug 7, 2023
690f858
switch order to that more extensive schema gets caught first
Connoropolous Aug 7, 2023
f11cb0c
update import to zod-models
kbonnici Aug 7, 2023
0f1ca54
give the unmigrated project data a top priority outcome
kbonnici Aug 7, 2023
ad6b384
add tests for cloneProjectMeta() and for cloneConnection()
kbonnici Aug 7, 2023
231f4a7
Merge branch 'main' into add-zod
Connoropolous Aug 7, 2023
5eacbde
fix for #318
Connoropolous Aug 7, 2023
e737a33
add files for schemas in zod-models
kbonnici Aug 7, 2023
f0e2fe6
import and re-export all schemas and types in zodModels.ts
kbonnici Aug 7, 2023
dc9d315
add build step for zod-models in CI
kbonnici Aug 7, 2023
0472215
fix for #310
Connoropolous Aug 7, 2023
c3861ba
Merge branch 'add-zod' into bug-fixes-aug-7
Connoropolous Aug 7, 2023
1e062f7
just testing and code commenting
Connoropolous Aug 7, 2023
c998f50
pass presence into PeoplePicker as well
Connoropolous Aug 7, 2023
80e0dff
Merge pull request #319 from lightningrodlabs/bug-fixes-aug-7
Connoropolous Aug 7, 2023
ef627e1
enable backwards compatibility and separation between the export sche…
Connoropolous Aug 8, 2023
df621ec
alias types to zod-model types to avoid massive refactor
kbonnici Aug 8, 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
2 changes: 2 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
- name: Install nodejs dependencies
run: |
npm run web-install
npm run zod-models-install
npm run zod-models-build
shell: bash
- name: run unit tests
run: |
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ user2-data
user-data
electron/web

zod-models/dist

web/dist/fonts
web/dist/images
web/dist/*.js
Expand Down
1 change: 1 addition & 0 deletions electron/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ ipcMain.handle('getVersion', () => {
version: `v${app.getVersion()}`,
platform: process.platform,
arch: process.arch,
integrityVersion: INTEGRITY_VERSION_NUMBER,
}
})

Expand Down
1 change: 1 addition & 0 deletions electron/src/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const PREV_VER_USER_DATA_MIGRATION_FILE_PATHS = [
// Acorn 6
path.join(USER_DATA_PATH, `${MIGRATION_FILE_NAME_PREFIX}9`),
// uncomment the below line for development testing
// of migration-feature
// path.join(USER_DATA_PATH, `${MIGRATION_FILE_NAME_PREFIX}${INTEGRITY_VERSION_NUMBER}`),
]

Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
"url": "git+https://github.com/h-be/acorn.git"
},
"scripts": {
"install-deps": "npm install && npm run web-install && npm run electron-install && npm run electron-tsc",
"install-deps": "npm install && npm run web-install && npm run zod-models-install && npm run electron-install && npm run electron-tsc",
"dev": "pm2-dev pm2.config.js",
"user-data-reset": "rm -rf user-data && mkdir user-data",
"web-install": "cd web && npm install",
"zod-models-install": "cd zod-models && npm install",
"zod-models-build": "cd zod-models && npm run build",
"web": "cd web && WEB_PORT=8081 ADMIN_WS_PORT=1101 APP_WS_PORT=8101 npx webpack-dev-server --config webpack.dev.js",
"web2": "cd web && WEB_PORT=8082 ADMIN_WS_PORT=1102 APP_WS_PORT=8102 npx webpack-dev-server --config webpack.dev.js",
"web3": "cd web && WEB_PORT=8083 ADMIN_WS_PORT=1103 APP_WS_PORT=8103 npx webpack-dev-server --config webpack.dev.js",
Expand Down
38 changes: 37 additions & 1 deletion web/package-lock.json

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

4 changes: 3 additions & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@
"reselect": "^4.1.5",
"resolve-url-loader": "^5.0.0",
"type-fest": "^0.17.0",
"use-onclickoutside": "^0.3.1"
"use-onclickoutside": "^0.3.1",
"zod": "^3.21.4",
"zod-models": "file:../zod-models"
},
"scripts": {
"storybook": "storybook dev -p 6006",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ const EvDetails: React.FC<EvDetailsProps> = ({
projectId={projectId}
onClose={() => setEditAssignees(false)}
activeAgentPubKey={activeAgentPubKey}
profilesPresent={presentMembers}
people={people}
outcomeActionHash={outcomeActionHash}
createOutcomeMember={createOutcomeMember}
Expand Down
1 change: 1 addition & 0 deletions web/src/components/Footer/Footer.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.footer {
max-height: 48px;
z-index: 3;
}

/* Buttom Left Panel */
Expand Down
4 changes: 2 additions & 2 deletions web/src/components/MapViewingOptions/MapViewingOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ const MapViewingOptions: React.FC<MapViewingOptionsProps> = ({
selectedOptionId={selectedLayeringAlgo}
options={[
{
id: LayeringAlgorithm.LongestPath,
id: "LongestPath",
text: 'Minimum Height',
},
{
id: LayeringAlgorithm.CoffmanGraham,
id: "CoffmanGraham",
text: 'Constrained Width',
},
]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
position: fixed;
top: 0;
background: var(--bg-color-canvas);
z-index: 10000;
z-index: 2;
}

.run-update-screen {
Expand Down
11 changes: 10 additions & 1 deletion web/src/components/PeoplePicker/PeoplePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export type PeoplePickerProps = {
isOutcomeMember: boolean
outcomeMemberActionHash: ActionHashB64
})[]
profilesPresent: AgentPubKeyB64[]
outcomeActionHash: ActionHashB64
createOutcomeMember: (
outcomeActionHash: ActionHashB64,
Expand All @@ -27,6 +28,7 @@ export type PeoplePickerProps = {
const PeoplePicker: React.FC<PeoplePickerProps> = ({
activeAgentPubKey,
people,
profilesPresent,
outcomeActionHash,
createOutcomeMember,
deleteOutcomeMember,
Expand Down Expand Up @@ -97,6 +99,12 @@ const PeoplePicker: React.FC<PeoplePickerProps> = ({
activeAgentPubKey
)
}
// check if the profile is in the
// list of present profiles
// (presence being "has the project open presently")
const isProfilePresent = !!profilesPresent.find(
(presentprofile) => person.agentPubKey === presentprofile
)
return (
<li
key={index}
Expand All @@ -109,8 +117,9 @@ const PeoplePicker: React.FC<PeoplePickerProps> = ({
avatarUrl={person.avatarUrl}
imported={person.isImported}
size="medium"
withStatus
selfAssignedStatus={person.status}
disconnected={!isProfilePresent}
withStatus={isProfilePresent}
/>
<div className="person-name-handle-wrapper">
<span className="person-name">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function EditProjectForm({
export default function ProjectSettingsModal({
showModal,
onClose,
project = {} as WithActionHash<ProjectMeta>,
project,
updateProjectMeta,
openInviteMembersModal,
cellIdString,
Expand Down
1 change: 1 addition & 0 deletions web/src/components/UpdateModal/UpdateModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const UpdateModal: React.FC<UpdateModalProps> = ({
}) => {
const history = useHistory()
const runUpdate = () => {
onClose()
history.push('/run-update')
}

Expand Down
50 changes: 0 additions & 50 deletions web/src/components/UpdatePromptModal/UpdatePromptModal.js

This file was deleted.

35 changes: 0 additions & 35 deletions web/src/components/UpdatePromptModal/UpdatePromptModal.scss

This file was deleted.

4 changes: 2 additions & 2 deletions web/src/drawing/layoutFormula.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ function layoutForGraph(
// TODO: add back in when we figure out how to not have it crash
// case LayeringAlgorithm.Simplex:
// return simplex
case LayeringAlgorithm.LongestPath:
case "LongestPath":
return longestPath
case LayeringAlgorithm.CoffmanGraham:
case "CoffmanGraham":
return coffmanGraham
default:
return coffmanGraham
Expand Down
1 change: 1 addition & 0 deletions web/src/hooks/useFinishMigrationChecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default function useFinishMigrationChecker(): {
}
setHasChecked(true)
} else {
// mock here if we want to test
setHasChecked(true)
}
}
Expand Down
7 changes: 6 additions & 1 deletion web/src/hooks/useVersionChecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,15 @@ export default function useVersionChecker(
isTest?: boolean
): {
currentVersion: string
integrityVersion: number
platform: string
arch: string
newReleaseVersion: string
releaseNotes: string
sizeForPlatform: string
} {
const [currentVersion, setCurrentVersion] = useState('')
const [integrityVersion, setIntegrityVersion] = useState<number>(null)
const [platform, setPlatform] = useState('')
const [arch, setArch] = useState('')
const [newReleaseVersion, setNewReleaseVersion] = useState('')
Expand All @@ -119,10 +121,12 @@ export default function useVersionChecker(
.then(
(currentVersionInfo: {
version: string
integrityVersion: number
platform: string
arch: string
}) => {
setCurrentVersion(currentVersionInfo.version)
setIntegrityVersion(currentVersionInfo.integrityVersion)
setPlatform(currentVersionInfo.platform)
setArch(currentVersionInfo.arch)
}
Expand All @@ -134,7 +138,7 @@ export default function useVersionChecker(
// to see if there is any new update available for the app
useEffect(() => {
if (isTest) {
setNewReleaseVersion('v1.0.0')
setNewReleaseVersion('v12.0.0')
setReleaseNotes('release notes')
setSizeForPlatform('1mb')
return
Expand All @@ -160,6 +164,7 @@ export default function useVersionChecker(
return newReleaseVersion
? {
currentVersion,
integrityVersion,
platform,
arch,
newReleaseVersion,
Expand Down
Loading