Skip to content

Commit

Permalink
v1.1.9
Browse files Browse the repository at this point in the history
v1.1.9
  • Loading branch information
NickLaiacona authored Sep 13, 2023
2 parents a392fa1 + 1aef616 commit fa813e0
Show file tree
Hide file tree
Showing 34 changed files with 6,442 additions and 7,959 deletions.
Binary file removed .DS_Store
Binary file not shown.
14 changes: 13 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,21 @@
"windows": {
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
},
"env": { "FAIRCOPY_DEBUG_MODE": "true", "FAIRCOPY_DEV_VERSION": "1.1.6" },
"env": { "FAIRCOPY_DEBUG_MODE": "true", "FAIRCOPY_DEV_VERSION": "1.1.8" },
"program": "${workspaceRoot}/public/electron.js",
"protocol": "inspector",
},
{
"name": "Debug Jest Tests",
"type": "node",
"request": "launch",
"runtimeArgs": [
"--inspect-brk",
"${workspaceRoot}/node_modules/.bin/jest",
"--runInBand"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
]
}
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,3 @@ When deploying to staging, in addition to the steps above, the `version` key in
In `public/main-process/config/dist-config.json`, the `devMode` key MUST be set to false. This hides disables any development and staging related functionality.

In `public/main-process/release-notes/latest.md`, the release notes should be updated to document any new features, functionality, and bug fixes. This file is displayed to the end user whenever the software is updated.

Developer Notes (Last updated: 2/10/22)
-----
* We are presently stuck at JSZip 3.2.0 because the latest version doesn't work on Electron Renderer.
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "faircopy",
"version": "1.1.8",
"version": "1.1.9",
"description": "A word processor for the humanities scholar.",
"main": "public/electron.js",
"private": true,
Expand All @@ -16,7 +16,7 @@
"dist": "electron-builder -ml --publish always",
"build": "react-scripts build",
"start": "react-scripts start",
"test": "react-scripts test"
"test": "jest"
},
"repository": "https://github.com/performant-software/faircopy",
"keywords": [
Expand All @@ -27,12 +27,13 @@
"author": "Performant Software Solutions LLC",
"homepage": ".",
"devDependencies": {
"@electron/notarize": "^2.1.0",
"dotenv": "^8.2.0",
"electron": "^18.2.0",
"electron-builder": "^23.3.3",
"electron-notarize": "^1.2.1"
"electron": "^25.5.0",
"electron-builder": "^24.6.3"
},
"dependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@material-ui/core": "^4.9.14",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.53",
Expand All @@ -44,7 +45,7 @@
"electron-updater": "^4.6.1",
"flexsearch": "^0.7.21",
"jimp": "^0.16.1",
"jszip": "3.2.0",
"jszip": "3.10.1",
"openseadragon": "^3.0.0",
"prop-types": "^15.7.2",
"prosemirror-commands": "^1.3.0",
Expand All @@ -65,7 +66,7 @@
"react-force-graph-2d": "^1.13.6",
"react-hotkeys": "^2.0.0",
"react-markdown": "^6.0.0",
"react-scripts": "3.4.1",
"react-scripts": "5.0.0",
"react-scroll": "1.8.3",
"react-split-pane": "^0.1.92",
"react-spring": "9.5.5",
Expand All @@ -80,7 +81,7 @@
"build": {
"appId": "com.performantsoftware.faircopy",
"productName": "FairCopy",
"copyright": "Copyright © 2022 ${author}",
"copyright": "Copyright © 2023 ${author}",
"files": [
"build/**/*",
"node_modules/**/*"
Expand Down
1 change: 1 addition & 0 deletions public/css/ProjectNavigator.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#ProjectNavigator .tree-item-name {
margin-left: 10px;
padding-right: 10px;
display: inline-block;
width: 100%;
}
Expand Down
13 changes: 9 additions & 4 deletions public/css/TEIElementStyles.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@
text-align:left;
}

[__error__ = "true"] {
border-bottom: dotted red;
}

/* Phrase level markup styling is based on information layers */
[phraselvl = "true"] {
border-bottom: dotted #0187a8;
}

[__error__ = "true"] {
border-bottom: dotted red;
[phraselvl = "false"] {
margin: 0px;
display: block;
}

/* Leave blank space for structure elements that have no content */
Expand All @@ -27,8 +32,8 @@
tei-textnode0, tei-textnode1, tei-textnode2, tei-textnode3, tei-textnode4, tei-textnode5, tei-textnode6, tei-textnode7, tei-textnode8, tei-textnode9, tei-textnode10,
tei-textnode11, tei-textnode12, tei-textnode13, tei-textnode14, tei-textnode15, tei-textnode16, tei-textnode17, tei-textnode18, tei-textnode19, tei-textnode20 {
display: block;
margin-top: 5px;
margin-bottom: 5px;
padding-top: 2px;
padding-bottom: 2px;
}

.inline-node {
Expand Down
4 changes: 2 additions & 2 deletions public/main-process/FairCopyApplication.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ class FairCopyApplication {
this.fairCopySession.updateResourceView(resourceViewRequest)
})

ipcMain.on('requestCheckedOutResources', (event) => {
this.fairCopySession.requestCheckedOutResources()
ipcMain.on('requestLocalResources', (event) => {
this.fairCopySession.requestLocalResources()
})

ipcMain.on('searchProject', (event, searchQuery) => {
Expand Down
27 changes: 15 additions & 12 deletions public/main-process/FairCopySession.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,9 @@ class FairCopySession {
}
}

requestCheckedOutResources() {
if( this.remote ) {
const checkedOutResources = this.projectStore.getCheckedOutResources()
this.fairCopyApplication.sendToMainWindow('checkedOutResources', checkedOutResources )
} else {
log.info("Requested checked out view when project is not remote.")
}
requestLocalResources() {
const localResources = this.projectStore.getLocalResources()
this.fairCopyApplication.sendToAllWindows('localResources', localResources )
}

sendResourceViewUpdate(resourceView, remoteResources) {
Expand Down Expand Up @@ -249,22 +245,29 @@ class FairCopySession {
const { resources } = this.projectStore.manifestData
if( resources[resourceEntry.id] ) {
const currentLocalID = resources[resourceEntry.id].localID
const currentParentID = resources[resourceEntry.id].parentResource
resources[resourceEntry.id] = resourceEntry
// change local ID

let idMap = null
if( resourceEntry.parentResource !== currentParentID ) {
idMap = this.idMapAuthority.moveResourceMap( resourceEntry.localID, currentLocalID, resourceEntry.parentResource, currentParentID )
}
if( resourceEntry.localID !== currentLocalID ) {
let idMap = null
if( resourceEntry.parentResource ) {
const { localID: parentID } = this.idMapAuthority.getLocalIDs(resourceEntry.parentResource)
idMap = this.idMapAuthority.changeID( resourceEntry.localID, currentLocalID, parentID )
} else {
idMap = this.idMapAuthority.changeID( resourceEntry.localID, currentLocalID, null )
}
}

if( idMap ) {
this.projectStore.saveIDMap(idMap)
this.idMapAuthority.sendIDMapUpdate()
this.idMapAuthority.sendIDMapUpdate()
}
this.projectStore.saveManifest()
this.fairCopyApplication.sendToAllWindows('resourceEntryUpdated', resourceEntry )
if( resourceEntry.type === 'teidoc' ) this.requestResourceView()
this.requestResourceView()
} else {
log.info(`Error updating resource entry: ${resourceEntry.id}`)
}
Expand Down Expand Up @@ -294,7 +297,7 @@ class FairCopySession {
// at the moment, only image views use xmlID
this.openImageView( { xmlID, resourceEntry, parentEntry, resource } )
} else {
this.fairCopyApplication.sendToMainWindow('resourceOpened', { resourceEntry, parentEntry, resource } )
this.fairCopyApplication.sendToAllWindows('resourceOpened', { resourceEntry, parentEntry, resource } )
log.info(`opened resourceID: ${resourceEntry.id}`)
}
}
Expand Down
41 changes: 39 additions & 2 deletions public/main-process/IDMapLocal.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,48 @@ class IDMapLocal {
return JSON.stringify(this.idMapBase)
}

moveResourceMap( localID, oldLocalID, targetParentResource, oldParentResourceID ) {
const targetParentID = targetParentResource ? this.getLocalIDs(targetParentResource)?.localID : null
const oldParentID = oldParentResourceID ? this.getLocalIDs(oldParentResourceID)?.localID : null

// the resource map being moved
let resourceMap

// remove the resourceMap from the old parent, prefering latest state from idMapNext
if( oldParentID ) {
if( this.idMapNext[oldParentID] && this.idMapNext[oldParentID].ids[oldLocalID] ) {
resourceMap = this.idMapNext[oldParentID].ids[oldLocalID]
delete this.idMapNext[oldParentID].ids[oldLocalID]
} else {
resourceMap = this.idMapBase[oldParentID].ids[oldLocalID]
}
delete this.idMapBase[oldParentID].ids[oldLocalID]
} else {
if( this.idMapNext[oldLocalID] ) {
resourceMap = this.idMapNext[oldLocalID]
delete this.idMapNext[oldLocalID]
} else {
resourceMap = this.idMapBase[oldLocalID]
}
delete this.idMapBase[oldLocalID]
}

// add it to the new parent
if( targetParentID ) {
if( !this.idMapBase[targetParentID] ) this.idMapBase[targetParentID] = this.copyParent( localID )
this.idMapBase[targetParentID].ids[localID] = resourceMap
} else {
this.idMapBase[localID] = resourceMap
}

return JSON.stringify(this.idMapBase)
}

changeID( newID, oldID, parentID ) {
// move the resource map on both editable layers to the new address

// update the next map
const nextResourceMap = parentID ? this.idMapNext[parentID].ids[oldID] : this.idMapNext[oldID]
const nextResourceMap = parentID ? this.idMapNext[parentID]?.ids[oldID] : this.idMapNext[oldID]
if( nextResourceMap ) {
if( parentID ) {
if( !this.idMapNext[parentID] ) this.idMapNext[parentID] = this.copyParent(parentID)
Expand All @@ -75,7 +112,7 @@ class IDMapLocal {
}

// update the staged map
const baseResourceMap = parentID ? this.idMapBase[parentID].ids[oldID] : this.idMapBase[oldID]
const baseResourceMap = parentID ? this.idMapBase[parentID]?.ids[oldID] : this.idMapBase[oldID]
if( baseResourceMap ) {
if( parentID ) {
if( !this.idMapBase[parentID] ) this.idMapBase[parentID] = this.copyParent(parentID)
Expand Down
40 changes: 39 additions & 1 deletion public/main-process/IDMapRemote.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,44 @@ class IDMapRemote {
return JSON.stringify(this.idMapStaged)
}


moveResourceMap( localID, oldLocalID, targetParentResource, oldParentResourceID ) {
const targetParentID = targetParentResource ? this.getLocalIDs(targetParentResource)?.localID : null
const oldParentID = oldParentResourceID ? this.getLocalIDs(oldParentResourceID)?.localID : null

// the resource map being moved
let resourceMap

// remove the resourceMap from the old parent, prefering latest state from idMapNext
if( oldParentID ) {
if( this.idMapNext[oldParentID] && this.idMapNext[oldParentID].ids[oldLocalID] ) {
resourceMap = this.idMapNext[oldParentID].ids[oldLocalID]
delete this.idMapNext[oldParentID].ids[oldLocalID]
} else {
resourceMap = this.idMapStaged[oldParentID].ids[oldLocalID]
}
delete this.idMapStaged[oldParentID].ids[oldLocalID]
} else {
if( this.idMapNext[oldLocalID] ) {
resourceMap = this.idMapNext[oldLocalID]
delete this.idMapNext[oldLocalID]
} else {
resourceMap = this.idMapStaged[oldLocalID]
}
delete this.idMapStaged[oldLocalID]
}

// add it to the new parent
if( targetParentID ) {
if( !this.idMapStaged[targetParentID] ) this.idMapStaged[targetParentID] = this.copyParent( localID )
this.idMapStaged[targetParentID].ids[localID] = resourceMap
} else {
this.idMapStaged[localID] = resourceMap
}

return JSON.stringify(this.idMapStaged)
}

changeID( newID, oldID, parentID ) {
// move the resource map on both editable layers to the new address

Expand Down Expand Up @@ -203,7 +241,7 @@ class IDMapRemote {
// move resource map from draft form to authoritative
if( parentID ) {
if( !this.idMapStaged[parentID] ) this.idMapStaged[parentID] = this.copyParent(parentID,'idMapStaged')
if( this.idMapStaged[parentID] && this.idMapNext[parentID] ) {
if( this.idMapStaged[parentID] && this.idMapNext[parentID] && this.idMapNext[parentID].ids[localID] ) {
this.idMapStaged[parentID].ids[localID] = this.idMapNext[parentID].ids[localID]
delete this.idMapNext[parentID].ids[localID]
}
Expand Down
10 changes: 5 additions & 5 deletions public/main-process/ProjectStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ class ProjectStore {
if( state === 'success') {
this.manifestData.resources[resourceEntry.id] = resourceEntry
this.fairCopyApplication.sendToAllWindows('resourceEntryUpdated', resourceEntry )
this.fairCopyApplication.sendToAllWindows('resourceEntryUpdated', parentEntry )
if( parentEntry ) this.fairCopyApplication.sendToAllWindows('resourceEntryUpdated', parentEntry )
this.fairCopyApplication.sendToAllWindows('resourceContentUpdated', { resourceID: resourceEntry.id, messageID: 'check-out-messsage', resourceContent: content })
}
checkOutStatus.push({ state, resourceEntry })
Expand Down Expand Up @@ -404,16 +404,16 @@ class ProjectStore {
this.fairCopyApplication.sendToMainWindow('checkInResults', {resourceEntries, resourceStatus, error} )
}

getCheckedOutResources() {
getLocalResources() {
const resourceEntries = Object.values( this.manifestData.resources )

const checkedOutResources = {}
const localResources = {}
for( const resourceEntry of resourceEntries ) {
if( resourceEntry.type !== 'image') {
checkedOutResources[resourceEntry.id] = resourceEntry
localResources[resourceEntry.id] = resourceEntry
}
}
return checkedOutResources
return localResources
}
}

Expand Down
13 changes: 13 additions & 0 deletions public/main-process/release-notes/latest.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

The release notes list the improvements and bug fixes included in each new version of the software.

## Version 1.1.9

### Improvements

* Users can now move images between facsimiles
* Move Resource function is restored and now works for remote projects

### Bug Fixes

* Long filenames obscure close button
* Limit autocomplete of TEI Pointers to current document
* Fixed intermittent error when checking out resources in remote projects

## Version 1.1.8

### Bug Fixes
Expand Down
2 changes: 2 additions & 0 deletions public/main-process/worker-window-preload.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

const preloadServices = require('./preload-worker-services')
const JSZip = require('jszip');
preloadServices.services.JSZip = JSZip

window.fairCopy = {
rootComponent: "WorkerWindow",
Expand Down
4 changes: 3 additions & 1 deletion scripts/notarize.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require('dotenv').config();
const { notarize } = require('electron-notarize');
const { notarize } = require('@electron/notarize');

exports.default = async function notarizing(context) {
const { electronPlatformName, appOutDir } = context;
Expand All @@ -10,9 +10,11 @@ exports.default = async function notarizing(context) {
const appName = context.packager.appInfo.productFilename;

return await notarize({
tool: "notarytool",
appBundleId: 'com.performantsoftware.faircopy',
appPath: `${appOutDir}/${appName}.app`,
appleId: process.env.APPLEID,
appleIdPassword: process.env.APPLEIDPASS,
teamId: process.env.APPLETEAMID
});
};
Loading

0 comments on commit fa813e0

Please sign in to comment.