Skip to content

Commit

Permalink
Update legacy naming (#84) (#85)
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Ohlsen <[email protected]>
  • Loading branch information
ohltyler authored Feb 26, 2024
1 parent dea0bd4 commit a1e321e
Show file tree
Hide file tree
Showing 19 changed files with 75 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/draft-release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
update_release_draft:
if: github.repository == 'opensearch-project/opensearch-ai-flow-dashboards'
if: github.repository == 'opensearch-project/dashboards-flow-framework'
name: Update draft release notes
runs-on: ubuntu-latest
steps:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
run-lint:
name: Run lint script
runs-on: ubuntu-latest
if: github.repository == 'opensearch-project/opensearch-ai-flow-dashboards'
if: github.repository == 'opensearch-project/dashboards-flow-framework'
steps:
- name: Checkout OpenSearch Dashboards
uses: actions/checkout@v2
Expand All @@ -31,12 +31,12 @@ jobs:
- name: Checkout plugin
uses: actions/checkout@v2
with:
path: OpenSearch-Dashboards/plugins/opensearch-ai-flow-dashboards
path: OpenSearch-Dashboards/plugins/dashboards-flow-framework
- name: Bootstrap the plugin
run: |
cd OpenSearch-Dashboards/plugins/opensearch-ai-flow-dashboards
cd OpenSearch-Dashboards/plugins/dashboards-flow-framework
yarn osd bootstrap
- name: Run lint script
run: |
cd OpenSearch-Dashboards/plugins/opensearch-ai-flow-dashboards
cd OpenSearch-Dashboards/plugins/dashboards-flow-framework
yarn lint:es common/* public/* server/*
8 changes: 4 additions & 4 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ You will need to install [node.js](https://nodejs.org/en/), [nvm](https://github
### Environment Setup

1. Download OpenSearch for the version that matches the [OpenSearch Dashboards version specified in package.json](./package.json#L7).
2. Download and install [OpenSearch AI Flow Framework](https://github.com/opensearch-project/opensearch-ai-flow-framework).
2. Download and install [OpenSearch Flow Framework](https://github.com/opensearch-project/flow-framework).
3. Download the OpenSearch Dashboards source code for the [version specified in package.json](./package.json#L7) you want to set up.

See the [OpenSearch Dashboards contributing guide](https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/CONTRIBUTING.md) and [developer guide](https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/DEVELOPER_GUIDE.md) for more instructions on setting up your development environment.

4. Change your node version to the version specified in `.node-version` inside the OpenSearch Dashboards root directory (this can be done with the `nvm use` command).
5. Create a `plugins` directory inside the OpenSearch Dashboards source code directory, if `plugins` directory doesn't exist.
6. Check out this package from version control into the `plugins` directory.
7. Run `yarn osd bootstrap` inside `OpenSearch-Dashboards/plugins/opensearch-ai-flow-dashboards`.
7. Run `yarn osd bootstrap` inside `OpenSearch-Dashboards/plugins/dashboards-flow-framework`.

Ultimately, your directory structure should look like this:

Expand All @@ -42,14 +42,14 @@ Ultimately, your directory structure should look like this:
.
├── OpenSearch-Dashboards
│ └──plugins
│ └── opensearch-ai-flow-dashboards
│ └── dashboards-flow-framework
```

### Build

To build the plugin's distributable zip simply run `yarn build`.

Example output: `./build/opensearch-ai-flow-dashboards-2.10.0.0.zip`
Example output: `./build/dashboards-flow-framework-2.13.0.0.zip`

### Run

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## OpenSearch AI Flow Dashboards Plugin
## OpenSearch Flow Framework Dashboards Plugin

This plugin provides a simple UI for building AI applications with OpenSearch.
This plugin provides a simple UI for building applications with OpenSearch Flow Framework.

TODO: add details

Expand Down
4 changes: 2 additions & 2 deletions common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

export const PLUGIN_ID = 'aiFlowDashboards';
export const PLUGIN_ID = 'flow-framework';

export const BASE_NODE_API_PATH = '/api/ai_flow';
export const BASE_NODE_API_PATH = '/api/flow_framework';
export const BASE_INDICES_NODE_API_PATH = `${BASE_NODE_API_PATH}/indices`;
export const SEARCH_INDICES_PATH = `${BASE_INDICES_NODE_API_PATH}/search`;
export const FETCH_INDICES_PATH = `${BASE_INDICES_NODE_API_PATH}/fetch`;
16 changes: 10 additions & 6 deletions opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
{
"id": "aiFlowDashboards",
"version": "2.10.0.0",
"opensearchDashboardsVersion": "2.10.0",
"id": "flowFramework",
"version": "2.13.0.0",
"opensearchDashboardsVersion": "2.13.0",
"server": true,
"ui": true,
"requiredBundles": ["opensearchDashboardsUtils"],
"requiredPlugins": ["navigation"],
"requiredBundles": [
"opensearchDashboardsUtils"
],
"requiredPlugins": [
"navigation"
],
"optionalPlugins": []
}
}
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "ai-flow-dashboards",
"version": "2.10.0.0",
"description": "OpenSearch AI Flow Dashboards Plugin",
"name": "dashboards-flow-framework",
"version": "2.13.0.0",
"description": "OpenSearch Flow Framework Dashboards Plugin",
"main": "index.js",
"config": {
"plugin_version": "2.10.0.0",
"plugin_name": "aiFlowDashboards",
"plugin_zip_name": "ai-flow-dashboards"
"plugin_version": "2.13.0.0",
"plugin_name": "flowFramework",
"plugin_zip_name": "dashboards-flow-framework"
},
"scripts": {
"plugin-helpers": "../../scripts/use_node ../../scripts/plugin_helpers",
Expand All @@ -18,7 +18,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/opensearch-project/opensearch-ai-flow-dashboards.git"
"url": "https://github.com/opensearch-project/dashboards-flow-framework.git"
},
"pre-commit": [
"lint:es:precommit"
Expand All @@ -38,4 +38,4 @@
"pre-commit": "^1.2.2"
},
"resolutions": {}
}
}
4 changes: 2 additions & 2 deletions public/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ import {

interface Props extends RouteComponentProps {}

export const AiFlowDashboardsApp = (props: Props) => {
export const FlowFrameworkDashboardsApp = (props: Props) => {
const sidebar = (
<EuiPageSideBar style={{ minWidth: 190 }} hidden={false} paddingSize="l">
<EuiSideNav
style={{ width: 190 }}
items={[
{
name: Navigation.AiApplicationBuilder,
name: Navigation.FlowFramework,
id: 0,
items: [
{
Expand Down
8 changes: 4 additions & 4 deletions public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

import './index.scss';

import { AiFlowDashboardsPlugin } from './plugin';
import { FlowFrameworkDashboardsPlugin } from './plugin';

// This exports static code and TypeScript types,
// as well as, OpenSearch Dashboards Platform `plugin()` initializer.
export function plugin() {
return new AiFlowDashboardsPlugin();
return new FlowFrameworkDashboardsPlugin();
}
export {
AiFlowDashboardsPluginSetup,
AiFlowDashboardsPluginStart,
FlowFrameworkDashboardsPluginSetup,
FlowFrameworkDashboardsPluginStart,
} from './types';
2 changes: 1 addition & 1 deletion public/pages/overview/overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { getCore } from '../../services';
export function Overview() {
useEffect(() => {
getCore().chrome.setBreadcrumbs([
BREADCRUMBS.AI_APPLICATION_BUILDER,
BREADCRUMBS.FLOW_FRAMEWORK,
BREADCRUMBS.OVERVIEW,
]);
});
Expand Down
2 changes: 1 addition & 1 deletion public/pages/workflow_detail/workflow_detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function WorkflowDetail(props: WorkflowDetailProps) {

useEffect(() => {
getCore().chrome.setBreadcrumbs([
BREADCRUMBS.AI_APPLICATION_BUILDER,
BREADCRUMBS.FLOW_FRAMEWORK,
BREADCRUMBS.WORKFLOWS,
{ text: workflowName },
]);
Expand Down
2 changes: 1 addition & 1 deletion public/pages/workflows/workflows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function Workflows(props: WorkflowsProps) {

useEffect(() => {
getCore().chrome.setBreadcrumbs([
BREADCRUMBS.AI_APPLICATION_BUILDER,
BREADCRUMBS.FLOW_FRAMEWORK,
BREADCRUMBS.WORKFLOWS,
]);
});
Expand Down
18 changes: 11 additions & 7 deletions public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,24 @@ import {
Plugin,
} from '../../../src/core/public';
import {
AiFlowDashboardsPluginSetup,
AiFlowDashboardsPluginStart,
FlowFrameworkDashboardsPluginSetup,
FlowFrameworkDashboardsPluginStart,
} from './types';
import { PLUGIN_ID } from '../common';
import { setCore, setRouteService } from './services';
import { configureRoutes } from './route_service';

export class AiFlowDashboardsPlugin
implements Plugin<AiFlowDashboardsPluginSetup, AiFlowDashboardsPluginStart> {
public setup(core: CoreSetup): AiFlowDashboardsPluginSetup {
export class FlowFrameworkDashboardsPlugin
implements
Plugin<
FlowFrameworkDashboardsPluginSetup,
FlowFrameworkDashboardsPluginStart
> {
public setup(core: CoreSetup): FlowFrameworkDashboardsPluginSetup {
// Register the plugin in the side navigation
core.application.register({
id: PLUGIN_ID,
title: 'AI Application Builder',
title: 'Flow Framework',
category: {
id: 'opensearch',
label: 'OpenSearch plugins',
Expand All @@ -44,7 +48,7 @@ export class AiFlowDashboardsPlugin
return {};
}

public start(core: CoreStart): AiFlowDashboardsPluginStart {
public start(core: CoreStart): FlowFrameworkDashboardsPluginStart {
return {};
}

Expand Down
6 changes: 4 additions & 2 deletions public/render_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import ReactDOM from 'react-dom';
import { BrowserRouter as Router, Route } from 'react-router-dom';
import { Provider } from 'react-redux';
import { AppMountParameters, CoreStart } from '../../../src/core/public';
import { AiFlowDashboardsApp } from './app';
import { FlowFrameworkDashboardsApp } from './app';
import { store, ReactFlowContextProvider } from './store';

export const renderApp = (
Expand All @@ -19,7 +19,9 @@ export const renderApp = (
<Provider store={store}>
<ReactFlowContextProvider>
<Router basename={appBasePath + '#/'}>
<Route render={(props) => <AiFlowDashboardsApp {...props} />} />
<Route
render={(props) => <FlowFrameworkDashboardsApp {...props} />}
/>
</Router>
</ReactFlowContextProvider>
</Provider>,
Expand Down
4 changes: 2 additions & 2 deletions public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

import { NavigationPublicPluginStart } from '../../../src/plugins/navigation/public';

export interface AiFlowDashboardsPluginSetup {}
export interface AiFlowDashboardsPluginStart {}
export interface FlowFrameworkDashboardsPluginSetup {}
export interface FlowFrameworkDashboardsPluginStart {}

export interface AppPluginStartDependencies {
navigation: NavigationPublicPluginStart;
Expand Down
4 changes: 2 additions & 2 deletions public/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

export enum Navigation {
AiApplicationBuilder = 'AI Application Builder',
FlowFramework = 'Flow Framework',
Overview = 'Overview',
Workflows = 'Workflows',
}
Expand All @@ -17,7 +17,7 @@ export enum APP_PATH {
}

export const BREADCRUMBS = Object.freeze({
AI_APPLICATION_BUILDER: { text: 'AI application builder', href: '#/' },
FLOW_FRAMEWORK: { text: 'Flow Framework', href: '#/' },
OVERVIEW: { text: 'Overview', href: `#${APP_PATH.OVERVIEW}` },
WORKFLOWS: { text: 'Workflows', href: `#${APP_PATH.WORKFLOWS}` },
});
Expand Down
8 changes: 4 additions & 4 deletions server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
*/

import { PluginInitializerContext } from '../../../src/core/server';
import { AiFlowDashboardsPlugin } from './plugin';
import { FlowFrameworkDashboardsPlugin } from './plugin';

// This exports static code and TypeScript types,
// as well as, OpenSearch Dashboards Platform `plugin()` initializer.

export function plugin(initializerContext: PluginInitializerContext) {
return new AiFlowDashboardsPlugin(initializerContext);
return new FlowFrameworkDashboardsPlugin(initializerContext);
}

export {
AiFlowDashboardsPluginSetup,
AiFlowDashboardsPluginStart,
FlowFrameworkDashboardsPluginSetup,
FlowFrameworkDashboardsPluginStart,
} from './types';
16 changes: 10 additions & 6 deletions server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,25 @@ import {
} from '../../../src/core/server';

import {
AiFlowDashboardsPluginSetup,
AiFlowDashboardsPluginStart,
FlowFrameworkDashboardsPluginSetup,
FlowFrameworkDashboardsPluginStart,
} from './types';
import { registerOpenSearchRoutes } from './routes';

export class AiFlowDashboardsPlugin
implements Plugin<AiFlowDashboardsPluginSetup, AiFlowDashboardsPluginStart> {
export class FlowFrameworkDashboardsPlugin
implements
Plugin<
FlowFrameworkDashboardsPluginSetup,
FlowFrameworkDashboardsPluginStart
> {
private readonly logger: Logger;

constructor(initializerContext: PluginInitializerContext) {
this.logger = initializerContext.logger.get();
}

public setup(core: CoreSetup) {
this.logger.debug('ai-flow-dashboards: Setup');
this.logger.debug('flow-framework-dashboards: Setup');
const router = core.http.createRouter();

// Register server side APIs
Expand All @@ -36,7 +40,7 @@ export class AiFlowDashboardsPlugin
}

public start(core: CoreStart) {
this.logger.debug('ai-flow-dashboards: Started');
this.logger.debug('flow-framework-dashboards: Started');
return {};
}

Expand Down
4 changes: 2 additions & 2 deletions server/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
* SPDX-License-Identifier: Apache-2.0
*/

export interface AiFlowDashboardsPluginSetup {}
export interface AiFlowDashboardsPluginStart {}
export interface FlowFrameworkDashboardsPluginSetup {}
export interface FlowFrameworkDashboardsPluginStart {}

0 comments on commit a1e321e

Please sign in to comment.