-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
199 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
tasks.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# tapisui-extension-icicle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"name": "<YOUR_PACKAGE_NAME>", | ||
"version": "<YOUR_PACKAGE_VERIONS>", | ||
"description": "", | ||
"main": "./dist/index.js", | ||
"typings": "./dist/index.d.ts", | ||
"types": "./dist/index.d.ts", | ||
"scripts": { | ||
"clean": "rm -rf dist", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"push": "npm run build && npm publish --access public", | ||
"copy-files": "copyfiles -u 1 \"src/styles/**/*\" \"src/fonts/**/*\" \"src/**/*.scss\" \"src/index.css\" \"src/**/*.css\" \"src/**/*.module.css\" dist/", | ||
"build": "npm run clean && npx tsc --build ./tsconfig.json && npm run copy-files" | ||
}, | ||
"keywords": [ | ||
"typescript", | ||
"tapisui" | ||
], | ||
"author": "<YOUR_NAME>", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@tapis/tapis-typescript": "^0.0.51", | ||
"@tapis/tapisui-extensions-core": "file:../tapisui-extensions-core", | ||
"@tapis/tapisui-common": "file:../tapisui-common", | ||
"@tapis/tapisui-hooks": "file:../tapisui-hooks", | ||
"copyfiles": "^2.4.1", | ||
"react": "^18.3.1" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^18.19.33", | ||
"typescript": "^4.9.5", | ||
"@tapis/tapisui-extension-devtools": "file:../tapisui-extension-devtools", | ||
"sass": "^1.77.6" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
declare module '*.module.scss' { | ||
const content: { [className: string]: string }; | ||
export default content; | ||
} | ||
|
||
declare module '*.module.css' { | ||
const content: { [className: string]: string }; | ||
export default content; | ||
} | ||
|
||
declare module '*.css' { | ||
const content: { [className: string]: string }; | ||
export default content; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { | ||
createExtension, | ||
EnumTapisCoreService, | ||
} from '@tapis/tapisui-extensions-core'; | ||
import { MyNewPage } from './pages'; | ||
|
||
const extension = createExtension({ | ||
allowMultiTenant: false, | ||
authentication: { | ||
password: true, | ||
implicit: { | ||
authorizationPath: 'https://icicleai.tapis.io/v3/oauth2/authorize', | ||
clientId: 'tapisui-implicit-client', | ||
redirectURI: 'https://icicleai.tapis.io/tapis-ui/#/oauth2', | ||
responseType: 'token', | ||
}, | ||
}, | ||
removeServices: [EnumTapisCoreService.Apps], | ||
mainSidebarServices: [ | ||
'systems', | ||
'apps', | ||
'jobs', | ||
'files', | ||
'workflows', | ||
'pods', | ||
'ml-hub', | ||
'my-new-page', | ||
], | ||
authMethods: ['implicit', 'password'], | ||
logo: { | ||
filePath: './logo_icicle.png', | ||
text: 'MY EXTENSION', | ||
}, | ||
icon: { | ||
filePath: './icon_icicle.png', | ||
text: 'MY EXTENSION', | ||
}, | ||
}); | ||
|
||
// Registering a new service will add | ||
extension.registerService({ | ||
id: 'my-new-page', | ||
sidebarDisplayName: 'My New Page', | ||
iconName: 'simulation', | ||
component: MyNewPage, | ||
}); | ||
|
||
export { extension }; |
20 changes: 20 additions & 0 deletions
20
packages/example-extension/src/pages/MyNewPage/MyNewPage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Component } from '@tapis/tapisui-extensions-core'; | ||
|
||
export const MyNewPage: Component = () => { | ||
return ( | ||
<div | ||
style={{ | ||
width: '100%', | ||
height: '100%', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
overflow: 'hidden', | ||
}} | ||
> | ||
<h1>My new page</h1> | ||
<p>Hello from my new page!</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default MyNewPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as MyNewPage } from './MyNewPage'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { MyNewPage } from './MyNewPage'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { Workflows } from '@tapis/tapis-typescript'; | ||
|
||
export const tasks: Array<Workflows.Task> = [ | ||
{ | ||
id: 'django-search', | ||
type: Workflows.EnumTaskType.Function, | ||
execution_profile: { | ||
flavor: Workflows.EnumTaskFlavor.C1med, | ||
}, | ||
input: { | ||
OBJECT: { | ||
type: Workflows.EnumTaskIOType.String, | ||
description: 'Django search parameter - object', | ||
required: false, | ||
value_from: { | ||
args: 'OBJECT', | ||
}, | ||
}, | ||
PREDICATE: { | ||
type: Workflows.EnumTaskIOType.String, | ||
description: 'Django search parameter - predicate', | ||
required: false, | ||
value_from: { | ||
args: 'PREDICATE', | ||
}, | ||
}, | ||
API_HOST: { | ||
type: Workflows.EnumTaskIOType.String, | ||
description: 'Django API host url', | ||
required: false, | ||
value_from: { | ||
args: 'API_HOST', | ||
}, | ||
}, | ||
}, | ||
installer: Workflows.EnumInstaller.Pip, | ||
packages: ['pandas==2.1.4', 'requests'], | ||
runtime: Workflows.EnumRuntimeEnvironment.Python39, | ||
entrypoint: 'icicle-task-templates/task-templates/django_search.py', | ||
git_repositories: [ | ||
{ | ||
url: 'https://github.com/ICICLE-ai/tapisui-extension-icicle.git', | ||
branch: 'main', | ||
directory: 'icicle-task-templates', | ||
}, | ||
], | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"compilerOptions": { | ||
"jsx": "react-jsx", | ||
"declaration": true, | ||
"target": "esnext", | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"skipLibCheck": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"outDir": "dist", | ||
"lib": ["dom", "esnext", "dom.iterable"], | ||
"types": ["node"], | ||
"typeRoots": ["./types", "node_modules/@types"], | ||
"incremental": true, | ||
"esModuleInterop": true // required or pages won't import | ||
// "baseUrl": "src", | ||
// "allowJs": true, | ||
// // "allowSyntheticDefaultImports": true, | ||
// "strict": false, | ||
// "forceConsistentCasingInFileNames": true, | ||
// "resolveJsonModule": true, | ||
// "isolatedModules": true, | ||
// "noEmit": false, | ||
}, | ||
"include": ["src"], | ||
"exclude": ["node_modules", "dist", "bundle.ts", "tasks.ts"] | ||
} |