Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
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
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.

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
2 changes: 1 addition & 1 deletion web/src/hooks/useVersionChecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,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 Down
33 changes: 24 additions & 9 deletions web/src/migrating/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,30 @@ export async function internalExportProjectsData(
store.dispatch,
projectCellId
)
await Promise.all([
projectDataFetchers.fetchProjectMeta(),
projectDataFetchers.fetchEntryPoints(),
projectDataFetchers.fetchOutcomeComments(),
projectDataFetchers.fetchOutcomeMembers(),
projectDataFetchers.fetchTags(),
projectDataFetchers.fetchOutcomes(),
projectDataFetchers.fetchConnections(),
])
try {

await Promise.all([
projectDataFetchers.fetchProjectMeta(),
projectDataFetchers.fetchEntryPoints(),
projectDataFetchers.fetchOutcomeComments(),
projectDataFetchers.fetchOutcomeMembers(),
projectDataFetchers.fetchTags(),
projectDataFetchers.fetchOutcomes(),
projectDataFetchers.fetchConnections(),
])
} catch (e) {
// fetch project meta will fail if the there IS no project meta
// and in that case we can just skip this project
// this solves for unsynced and uncanceled projects
if (e?.data?.data?.includes('no project meta exists')) {
// throw e
completedTracker++
onStep(completedTracker, projectCellIds.length)
continue
} else {
throw e
}
}
// step 2: collect the data to be exported for each project
const allDataFetchedState: RootState = store.getState()
const exportProjectData = collectExportProjectDataFunction(
Expand Down
3 changes: 2 additions & 1 deletion web/src/routes/App.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ const App: React.FC<AppProps> = ({
)
// custom hooks
const updateVersionInfo = useVersionChecker()
// set true to test
// to do development testing of migration-feature
// uncomment the following line (and comment the one above)
// const updateVersionInfo = useVersionChecker(true)
const finishMigrationChecker = useFinishMigrationChecker()
const { fileDownloaded, setFileDownloaded } = useFileDownloaded()
Expand Down
13 changes: 9 additions & 4 deletions web/src/routes/VersionUpdateLeaving/VersionUpdateLeaving.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ import React, { useEffect, useState } from 'react'

import './VersionUpdateLeaving.scss'

import exportProjectsData, {
AllProjectsDataExport,
} from '../../migrating/export'
import exportProjectsData from '../../migrating/export'
import { useStore } from 'react-redux'
import MigrationProgress from '../../components/MigrationProgress/MigrationProgress'
import { AllProjectsDataExport } from 'zod-models'

const checkIfExportNeeded = (currentVersion: string, toVersion: string) => {
// compare
Expand Down Expand Up @@ -137,7 +136,13 @@ const VersionUpdateLeaving: React.FC<VersionUpdateLeavingProps> = ({
updateVersionInfo.newReleaseVersion
)
) {
runExport().then(controlDownloadNextVersion)
runExport().then(controlDownloadNextVersion).catch((e) => {
console.error('error running export', e)
setTitle('An unexpected error occurred.')
const message = 'You may be able to recover by quitting and restarting Acorn. Please report this issue and provide the following error to support: ' + JSON.stringify(e)
// throw new Error(message)
setStatus(message)
})
} else {
controlDownloadNextVersion()
}
Expand Down
4 changes: 2 additions & 2 deletions web/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HoloHash, CellId } from '@holochain/client'
// import BufferAll from 'buffer/'
// const Buffer = BufferAll.Buffer
import BufferAll from 'buffer/'
const Buffer = BufferAll.Buffer

export function hashToString(hash: HoloHash) {
// nodejs
Expand Down