Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

cate 4.0 - JupyterLab Integration #195

Draft
wants to merge 28 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c779dde
Unregister service worker
forman Mar 8, 2023
1549274
Do not use "base" in index.html
forman Mar 8, 2023
2a44b32
no longer using login, hub, and routes
forman Mar 18, 2023
6a7e31e
Started 4.0.0
forman Mar 20, 2023
a7858ca
React upgrade
forman Mar 20, 2023
dbdb5b7
Now using workspace identifiers
forman Mar 25, 2023
61c725c
Merge branch 'cate-4.0.x' into forman-xxx-ws_id_instead_of_base_dir
forman Mar 25, 2023
54b1a20
Started 4.0.0-dev.1
forman Mar 25, 2023
10ff403
Merge branch 'master' into cate-4.0.x
forman Mar 25, 2023
6a2b0f8
Merge branch 'cate-4.0.x' into forman-xxx-ws_id_instead_of_base_dir
forman Mar 25, 2023
4b746f9
Added base 16 codec
forman Mar 29, 2023
219c1fe
reformat
forman Mar 30, 2023
ae781f9
compute workspaceId from baseDir
forman Mar 30, 2023
0e1c852
4.0.0-dev.2
forman Mar 30, 2023
3ad282d
Added two new functions: "open in browser" and "shutdown server"
forman Mar 30, 2023
21ac6cf
Open in browser only available when running in iframe
forman Mar 31, 2023
1c14064
Detecting serverUrl from "/app" endpoint
forman Mar 31, 2023
bfeea3e
Merge pull request #196 from CCI-Tools/forman-xxx-ws_id_instead_of_ba…
forman Mar 31, 2023
f8fad32
Merge branch 'cate-4.0.x' into forman-xxx-open_in_browser_and_kill_se…
forman Mar 31, 2023
d1609a4
New icon
forman Mar 31, 2023
c62aa39
Merge pull request #197 from CCI-Tools/forman-xxx-open_in_browser_and…
forman Mar 31, 2023
5ae823b
4.0.0-dev.4
forman Mar 31, 2023
99e2fe4
More UI adjustments
forman Mar 31, 2023
95ee8e3
Apply suggestions from code review
forman Apr 4, 2023
7198e77
Merge pull request #198 from CCI-Tools/forman-xxx-more_adjustments
forman Apr 4, 2023
fdf9122
Slightly improved readability of dataset titles
forman Apr 12, 2023
c4e865a
Slightly improved readability of dataset titles
forman Apr 12, 2023
72196c3
Merge branch 'forman-xxx-more_adjustments' into cate-4.0.x
forman Apr 12, 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
39 changes: 35 additions & 4 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,38 @@
### Changes 3.1.5 (in development)



### Changes 4.0.0 (in development)

* Since Cate App is now designed to work inside of Jupyter Lab and standalone,
The user login action is no longer required because users already log into
JupyterLab. Therefore, all code dealing with user login and Cate service
provisioning in the cloud has been removed. Other changes include:
- Added a new user action to open Cate App in a browser tab available, if
Cate App is initially opened in a JupyterLab widget.
- Added a new user action to shut down the Cate server
in order to release memory.
- Removed the top level **Files** menu, because file management can
be effectively done through JupyterLab.
- Removed the user action to install Cate App as a Desktop PWA.
- Removed proxy configuration from user preferences dialog.
- Rephrased filesystem info from "sandboxed / full access" to
"restricted / unrestricted".

* The following changes apply to the "local" data store because the server
now serves local files from the current working directory. This has been
done to let Cate integrated with Jupyter Lab pick up all datasets found
in the Lab's workspace.
- Users can now refresh the list of files from the "local" data store.
- Users can no longer add/remove data sources to the "local" data store.
This is a temporary change. We may reassign add/remove actions to perform
a filtering on the local datasets.

* Now using workspace identifiers instead of base directories in resource
URLs of the WebAPI. This way we no longer need to URL-encode workspace
directories in WebAPI URLs, which did not work with
[jupyter-server-proxy](https://jupyter-server-proxy.readthedocs.io/).


* Slightly improved readability of dataset titles generated from identifiers
if titles are missing.

### Changes 3.1.4

* Updated to new keycloak version
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ To prepare a Cate App release, follow these steps:

- [ ] `package.json`: Make sure `version` field is higher than the last release
and compatible with [SemVer](https://semver.org/).
- [ ] `src/serviceWorker.ts`: Make sure `CATE_PWA_VERSION` constant is the same version.
- [ ] `src/config.ts`: Make sure `CATE_APP_VERSION` constant is the same version.
- [ ] `src/version.ts`: Make sure `CATE_APP_VERSION` constant is the same version.
- [ ] `appveyor.yml`: Make sure `version` label is the same version appended by `-{build}`.
- [ ] `CHANGES.md`: Make sure latest changes are up-to-date and refer to the same version.
10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cate-app",
"version": "3.1.5-dev.0",
"version": "4.0.0-dev.6",
"private": true,
"homepage": ".",
"dependencies": {
Expand All @@ -10,7 +10,6 @@
"@blueprintjs/select": "^3.13.6",
"@blueprintjs/table": "^3.8.12",
"@datapunt/matomo-tracker-react": "^0.3.1",
"@react-keycloak/web": "^1.0.6",
"@types/js-cookie": "^2.2.6",
"cesium": "1.71.0",
"classnames": "^2.2.6",
Expand All @@ -19,17 +18,15 @@
"deep-equal": "^1.0.1",
"deep-object-diff": "^1.1.0",
"js-cookie": "^2.2.1",
"keycloak-js": "^8.0.2",
"normalize.css": "^8.0.1",
"react": "^16.13.1",
"react": "^16.14.0",
"react-ace": "^5.9.0",
"react-addons-css-transition-group": "^15.6.2",
"react-color": "^2.17.3",
"react-dom": "^16.13.1",
"react-dom": "^16.14.0",
"react-dropzone": "^11.0.2",
"react-markdown": "^6.0.2",
"react-redux": "^5.1.2",
"react-router-dom": "^5.2.0",
"react-transition-group": "^1.2.1",
"redux": "^3.7.2",
"redux-logger": "^3.0.6",
Expand Down Expand Up @@ -61,7 +58,6 @@
"@types/react-dom": "^16.9.0",
"@types/react-dropzone": "^5.1.0",
"@types/react-redux": "^5.0.21",
"@types/react-router-dom": "^5.1.5",
"@types/react-test-renderer": "^16.8.1",
"@types/redux-logger": "^3.0.7",
"@types/tether": "^1.4.4",
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
-->
<head>
<title>Cate App</title>
<base href="/">
<!-- <base href="/">-->
<meta charset="utf-8"/>
<meta name="description" content="User interface for Cate, the ESA CCI Toolbox"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
Expand Down
18 changes: 18 additions & 0 deletions src/common/base16codec.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { expect } from 'chai';
import Base16 from './base16codec';

describe('codec', function () {
it('works for empty string', function () {
expect(Base16.encode("")).to.equal("");
expect(Base16.decode("")).to.equal("");
});

it('works for a path string', function () {
expect(Base16.encode("/workspaces/bibo")).to.equal(
"2F776F726B7370616365732F6269626F"
);
expect(Base16.decode("2F776F726B7370616365732F6269626F")).to.equal(
"/workspaces/bibo"
);
});
});
37 changes: 37 additions & 0 deletions src/common/base16codec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* Encodes UTF-8 strings into lowercase hexadecimal representation and
* decodes hexadecimal representation into UTF-8.
*/
class Base16 {
static encode(value: string): string {
let result = '';
for (let i = 0; i < value.length; i++) {
let part = value.codePointAt(i).toString(16);
if (part.length === 1) {
result += '0' + part;
} else if (part.length === 2) {
result += part;
} else {
throw new Error('string value must comprise utf-8 values only');
}
}
return result.toUpperCase();
}

static decode(value: string): string {
if (value.length % 2 !== 0) {
throw new Error('string value length must be a multiple of two');
}
let result = '';
for (let i = 0; i < value.length; i += 2) {
let code = parseInt(value.substr(i, 2), 16);
if (Number.isNaN(code)) {
throw new Error('string value must comprise hexadecimal values only');
}
result += String.fromCharCode(code);
}
return result;
}
}

export default Base16;
82 changes: 0 additions & 82 deletions src/config.ts

This file was deleted.

30 changes: 0 additions & 30 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { main } from './renderer/main';
import { showToast } from './renderer/toast'
import * as serviceWorker from './serviceWorker';

import 'normalize.css/normalize.css';
import '@blueprintjs/core/lib/css/blueprint.css';
Expand All @@ -21,31 +19,3 @@ declare global {
window.CESIUM_BASE_URL = './cesium';

main();

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.register(
{
onSuccess: () => {
showToast({
type: 'notification',
text: 'App is cached for offline use.'
});
},
onUpdate: () => {
showToast({
type: 'notification',
text: 'New app version available. ' +
'It will be used when all tabs for this page are closed.'
});
},
onError: (error: Error) => {
showToast({
type: 'error',
text: 'Error during service worker registration: ' +
error.message
});
},
}
);
Loading