Skip to content
This repository was archived by the owner on May 31, 2023. It is now read-only.

Commit 2792b93

Browse files
committed
version bump
-Changed port number used -Moved sample_db.sqlite location to persist after upgrading app
1 parent 76754ed commit 2792b93

File tree

17 files changed

+49
-25
lines changed

17 files changed

+49
-25
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ app
1919
run.spec
2020

2121
yarn-error\.log
22+
23+
\.idea/

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,13 @@ A CSV file [(template here)](https://github.com/Greenhouse-Lab/sample_db/blob/ma
5656
In the case that tubes or specimens must be deleted from the database, navigate to the **Delete** tab, and upload the indicated files ([Delete by Specimen Template](https://github.com/Greenhouse-Lab/sample_db/blob/master/templates/delete_specimen_template.csv) or [Delete by Barcode Template](https://github.com/Greenhouse-Lab/sample_db/blob/master/templates/delete_barcode_template.csv)). Succesful deletion will result in a message with the number of specimens and tubes that have been deleted from the database.
5757

5858
# Backup and Restore Databases
59-
SampleDB will automatically backup the database the first time that it is run every day. Backups are stored in `/path/to/sampledb/Resources/app/db-server/db_backups` and may be restored by overwriting `/path/to/sampledb/Resources/app/db-server/sample_db.sqlite`. **Be sure to close SampleDB after use, otherwise the database will not be backed up daily**
59+
SampleDB will automatically backup the database the first time that it is run every day. Backups are stored at the following locations
60+
61+
|Platform |Path |
62+
|-|-|
63+
|Windows:|`C:\\User\yourUserName\Local\com.greenhouse.sampledb\{current_version}\db_backups`|
64+
|Mac:|`~/Library/Application Support/com.greenhouse.sampledb/{current_version}/db_backups` |
65+
66+
Backups may be restored by overwriting the sample_db.sqlite file contained in the application data folder.
67+
68+
**Be sure to close SampleDB after use, otherwise the database will not be backed up daily**

src/electron/main.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ function createWindow () {
4040
// when you should delete the corresponding element.
4141
mainWindow = null
4242
})
43-
createWindow = () => {};
43+
44+
// createWindow = () => {};
4445
}
4546

4647
// This method will be called when Electron has finished
@@ -70,15 +71,15 @@ app.on('ready', () => {
7071

7172
// Make electron sever local files called from the app.
7273
protocol.interceptFileProtocol('file', (request, callback) => {
73-
const url = request.url.substr(7);
74-
callback({ path: path.normalize(`${__dirname}/db-app/${url}`)})
74+
const item_url = request.url.substr(7);
75+
callback({ path: path.normalize(`${__dirname}/db-app/${item_url}`)})
7576
}, (err) => {
7677
if (err) console.error('Failed to register protocol');
7778
});
7879

7980

8081
let p = setInterval(() => {
81-
http.get('http://localhost:5000/status', (response) => {
82+
http.get('http://localhost:17327/status', (response) => {
8283
response.on('data', (chunk) => {
8384
clearInterval(p);
8485
createWindow();

src/electron/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sample-db",
3-
"version": "1.0.0",
3+
"version": "1.1.5",
44
"description": "Sample Database management application.",
55
"main": "main.js",
66
"repository": "https://github.com/greenhouse-lab/sample_db",

src/sample-db-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sample-db",
3-
"version": "1.0.0",
3+
"version": "1.1.5",
44
"license": "MIT",
55
"scripts": {
66
"build": "webpack",

src/sample-db-app/src/app/guards/location-exists.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class LocationExistsGuard implements CanActivate {
4747
return of(inStore);
4848
}
4949
return this.hasLocationInApi(id);
50-
})
50+
});
5151
}
5252

5353
canActivate(route: ActivatedRouteSnapshot): Observable<boolean> {

src/sample-db-app/src/app/services/bulk.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface DeleteQuery {
1010

1111
@Injectable()
1212
export class BulkService {
13-
private API_PATH = 'http://localhost:5000';
13+
private API_PATH = 'http://localhost:17327';
1414
private postFileHeaders = new Headers({'Content-Type': undefined});
1515

1616
constructor(private http: Http) {}

src/sample-db-app/src/app/services/location.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Location } from '../models/location';
55

66
@Injectable()
77
export class LocationService {
8-
private API_PATH = 'http://localhost:5000';
8+
private API_PATH = 'http://localhost:17327';
99

1010
private headers = new Headers({'Content-Type': 'application/json'});
1111

src/sample-db-app/src/app/services/logging.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ interface LogMessage {
99
}
1010
@Injectable()
1111
export class LoggingService {
12-
private API_PATH = 'http://localhost:5000';
12+
private API_PATH = 'http://localhost:17327';
1313
private headers = new Headers({'Content-Type': 'application/json'});
1414

1515
constructor(private http: Http) {}

src/sample-db-app/src/app/services/plate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as _ from 'lodash';
77

88
@Injectable()
99
export class MatrixPlateService {
10-
private API_PATH = 'http://localhost:5000';
10+
private API_PATH = 'http://localhost:17327';
1111
private headers = new Headers({'Content-Type': 'application/json'});
1212
private postFileHeaders = new Headers({'Content-Type': undefined});
1313

0 commit comments

Comments
 (0)