Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration to visyn_core #19

Merged
merged 4 commits into from
Mar 1, 2023
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
21 changes: 13 additions & 8 deletions src/pages/components/SourceCodeCard.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
import React from 'react';
import {AppMetaDataUtils, useAsync} from 'tdp_core';
import { useAsync } from 'visyn_core';
import { AppMetaDataUtils } from 'tdp_core';

export function SourceCodeCard() {
const loadMetaData = React.useMemo(() => () => AppMetaDataUtils.getMetaData(), []);
const {status, value} = useAsync(loadMetaData, []);
const { status, value } = useAsync(loadMetaData, []);

return (
<>
<div className="card shadow-sm p-2">
<div className="card-body">
<p className="card-text">
The source code of Coral is released at <a href="https://github.com/Caleydo/Coral" target="_blank" rel="noopener">GitHub</a>.
The source code of Coral is released at{' '}
<a href="https://github.com/Caleydo/Coral" target="_blank" rel="noopener">
GitHub
</a>
.
</p>
<p className="card-text">
This application is part of Phovea, a platform for developing
web-based visualization applications. For tutorials, API docs, and
more information about the build and deployment process, see the
documentation page.
This application is part of Phovea, a platform for developing web-based visualization applications. For tutorials, API docs, and more information
about the build and deployment process, see the documentation page.
</p>
<p className="card-text">
<b>Version: </b> {status === 'success' ? value.version : 'Fetching current version ...'}
</p>
<p className="card-text"><b>Version: </b> {(status === 'success') ? value.version : 'Fetching current version ...'}</p>
</div>
</div>
</>
Expand Down
61 changes: 35 additions & 26 deletions src/phovea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,46 @@
* Copyright (c) The Caleydo Team. All rights reserved.
* Licensed under the new BSD license, available at http://caleydo.org/license
**************************************************************************** */
import {EP_ORDINO_FOOTER_MENU, EP_ORDINO_HEADER_MENU, EP_ORDINO_LOGO, EP_ORDINO_START_MENU_TAB, EP_ORDINO_START_MENU_TAB_SHORTCUT, EStartMenuSection, IOrdinoFooterMenuDesc, IOrdinoHeaderMenuDesc, IOrdinoLogoDesc, IStartMenuTabShortcutDesc} from 'ordino';
import {IRegistry, PluginRegistry} from 'tdp_core';
import {EXTENSION_POINT_CUSTOMIZED_LOGIN_FORM} from 'tdp_core';
import {
EP_ORDINO_FOOTER_MENU,
EP_ORDINO_HEADER_MENU,
EP_ORDINO_LOGO,
EP_ORDINO_START_MENU_TAB,
EP_ORDINO_START_MENU_TAB_SHORTCUT,
EStartMenuSection,
IOrdinoFooterMenuDesc,
IOrdinoHeaderMenuDesc,
IOrdinoLogoDesc,
IStartMenuTabShortcutDesc,
} from 'ordino';
import { IRegistry, PluginRegistry } from 'visyn_core';
import { EXTENSION_POINT_CUSTOMIZED_LOGIN_FORM } from 'tdp_core';

export default function (registry: IRegistry) {
registry.push(EP_ORDINO_START_MENU_TAB, 'ordino_help_tab', () => import('./menu/HelpTab'), {
icon: 'fas fa-question-circle fa-fw',
menu: EStartMenuSection.RIGHT,
});
registry.push(EP_ORDINO_START_MENU_TAB, 'ordino_help_tab', () => import('./menu/HelpTab'), {
icon: 'fas fa-question-circle fa-fw',
menu: EStartMenuSection.RIGHT,
});

// Coral's custom login form
registry.push(EXTENSION_POINT_CUSTOMIZED_LOGIN_FORM, 'tdpBioinfoLoginForm', () => import('./LoginDialog'), {});
// Coral's custom login form
registry.push(EXTENSION_POINT_CUSTOMIZED_LOGIN_FORM, 'tdpBioinfoLoginForm', () => import('./LoginDialog'), {});

// Welcome Page:
// Welcome Page:
// -------------------------------------------------------------------------------------------------------

registry.push(EP_ORDINO_START_MENU_TAB, 'ordino_dataset_tab', () => import('ordino/dist/internal/menu/tabs/DatasetsTab'), {
text: 'Datasets',
menu: EStartMenuSection.MAIN,
priority: 10
priority: 10,
});

registry.push(EP_ORDINO_START_MENU_TAB, 'ordino_sessions_tab', () => import('ordino/dist/internal/menu/tabs/SessionsTab'), {
text: 'Analysis Sessions',
menu: EStartMenuSection.MAIN,
priority: 20
priority: 20,
});

registry.push(EP_ORDINO_START_MENU_TAB_SHORTCUT, 'ordino_sessions_shortcut', () => ({}), <IStartMenuTabShortcutDesc>{
registry.push(EP_ORDINO_START_MENU_TAB_SHORTCUT, 'ordino_sessions_shortcut', () => ({}), <Partial<IStartMenuTabShortcutDesc>>{
text: 'Current Analysis Session',
icon: 'fas fa-history',
tabId: 'ordino_sessions_tab',
Expand All @@ -43,18 +54,18 @@ export default function (registry: IRegistry) {
links: [
{
faIcon: 'fas fa-newspaper fa-fw',
text: 'What\'s new?',
page: '/news'
text: "What's new?",
page: '/news',
},
{
faIcon: 'fas fa-list fa-fw',
text: 'Features',
page: '/features'
page: '/features',
},
{
faIcon: 'fas fa-database fa-fw',
text: 'Datasets',
page: '/datasets'
page: '/datasets',
},
{
faIcon: 'fas fa-fw fa-book-open',
Expand All @@ -64,15 +75,14 @@ export default function (registry: IRegistry) {
{
faIcon: 'fas fa-question-circle fa-fw',
text: 'Help',
page: '/help'
}
]
page: '/help',
},
],
});

registry.push(EP_ORDINO_FOOTER_MENU, 'ordino_footer_menu', () => ({}), <IOrdinoFooterMenuDesc>{
lists: [
[

{
page: '/news',
faIcon: 'fas fa-fw fa-newspaper',
Expand All @@ -92,7 +102,7 @@ export default function (registry: IRegistry) {
page: '/publications',
faIcon: 'fas fa-fw fa-book-open',
text: `Publications`,
}
},
],
[
{
Expand Down Expand Up @@ -120,14 +130,13 @@ export default function (registry: IRegistry) {
faIcon: 'fas fa-fw fa-code',
text: `Source code & licenses`,
},
]
]
],
],
});

registry.push(EP_ORDINO_LOGO, 'coral_logo', () => import('coral/dist/assets/favicon.svg').then(PluginRegistry.getInstance().asResource), <IOrdinoLogoDesc>{
text: 'Coral',
width: 24,
height: 24
height: 24,
});

}
3 changes: 2 additions & 1 deletion src/phovea_registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
* Licensed under the new BSD license, available at http://caleydo.org/license
**************************************************************************** */

import {PluginRegistry} from 'tdp_core';
import { PluginRegistry } from 'visyn_core';
import reg from './phovea';

/**
* build a registry by registering all phovea modules
*/
//other modules
import 'visyn_core/phovea_registry';
import 'tdp_core/dist/phovea_registry';

//self
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "visyn_scripts/config/tsconfig.template.json",
"compilerOptions": {
"outDir": "./dist",
"moduleResolution": "node",
},
"include": [
"src/**/*.ts",
Expand Down