Skip to content

Commit

Permalink
Merge pull request #759 from StackStorm/integrate-st2flow
Browse files Browse the repository at this point in the history
Integrate st2flow
  • Loading branch information
m4dcoder committed Jan 19, 2021
2 parents 375403c + d89418e commit 778cfe3
Show file tree
Hide file tree
Showing 175 changed files with 34,109 additions and 1,790 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
root: true
globals:
$Shape: false
plugins:
- flowtype
- react
- notice
extends:
Expand Down Expand Up @@ -138,3 +141,4 @@ rules:
notice/notice:
- error
- mustMatch: "(// Copyright \\d{4} [a-zA-Z0-9,\\.\\s]+\\n)+//\\n// Licensed under the Apache License, Version 2\\.0 \\(the \"License\"\\);\\n// you may not use this file except in compliance with the License\\.\\n// You may obtain a copy of the License at\\n//\\n//\\s+http://www\\.apache\\.org/licenses/LICENSE-2\\.0\\n//\\n// Unless required by applicable law or agreed to in writing, software\\n// distributed under the License is distributed on an \"AS IS\" BASIS,\\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n// See the License for the specific language governing permissions and\\n// limitations under the License\\.\\n"

13 changes: 13 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[ignore]
.*/module-deps/test/invalid_pkg/package.json

[include]

[libs]

[lints]

[options]
esproposal.decorators=ignore

[strict]
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ debian/files

# VIM Swap
.*.swp


# local stuff
config.local.js
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM node:10.15.3

# Create app directory
WORKDIR /opt/stackstorm/static/webui/st2web

# get files
COPY . /opt/stackstorm/static/webui/st2web
RUN rm /opt/stackstorm/static/webui/st2web/yarn.lock

# install dependencies
RUN make build-and-install

# expose your ports
EXPOSE 3000

# start it up
CMD [ "npm", "run", "serve" ]
17 changes: 17 additions & 0 deletions Dockerfile-dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM node:10.15.3

# Create app directory
WORKDIR /opt/stackstorm/static/webui/st2web

# get files
COPY . /opt/stackstorm/static/webui/st2web
RUN rm /opt/stackstorm/static/webui/st2web/yarn.lock

# install dependencies
RUN make build-dev

# expose your ports
EXPOSE 3000

# start it up
CMD [ "npm", "run", "serve-dev" ]
26 changes: 26 additions & 0 deletions Dockerfile-nginx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM node:10.15.3 as build

# Create app directory
WORKDIR /opt/stackstorm/static/webui/st2web

# get files
COPY . /opt/stackstorm/static/webui/st2web
RUN rm /opt/stackstorm/static/webui/st2web/yarn.lock

# install dependencies
RUN make build-and-install

# expose your ports
EXPOSE 3000


FROM nginx
RUN rm -f /etc/nginx/conf.d/default.conf
# COPY ./nginx.local.conf /etc/nginx/conf.d/default.conf
COPY ./nginx.local.conf /etc/nginx/conf.d/st2.conf
COPY --from=build /opt/stackstorm/static/webui /opt/stackstorm/static/webui
# Generate self-signed certificate or place your existing certificate under /etc/ssl/st2
RUN mkdir -p /etc/ssl/st2
RUN openssl req -x509 -newkey rsa:2048 -keyout /etc/ssl/st2/st2.key -out /etc/ssl/st2/st2.crt \
-days 365 -nodes -subj "/C=US/ST=California/L=Palo Alto/O=StackStorm/OU=Information \
Technology/CN=$(hostname)"
20 changes: 20 additions & 0 deletions Dockerfile-nginx-dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM node:10.15.3 as build

# Create app directory
WORKDIR /opt/stackstorm/static/webui/st2web

# get files
COPY . /opt/stackstorm/static/webui/st2web
RUN rm /opt/stackstorm/static/webui/st2web/yarn.lock

# install dependencies
RUN make build-dev

# expose your ports
EXPOSE 3000


FROM nginx
RUN rm -f /etc/nginx/conf.d/default.conf
COPY ./nginx.local-dev.conf /etc/nginx/conf.d/st2.conf
COPY --from=build /opt/stackstorm/static/webui /opt/stackstorm/static/webui
25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,40 @@ DEB_DISTRO := $(shell (echo $(PKG_VERSION) | grep -q dev) && echo unstable || ec
.PHONY: all build clean install deb rpm
all: build

npm-install:
echo "npm install"
npm install -g lerna yarn

lerna:
echo "lerna"
lerna bootstrap
rm -rf apps/st2-workflows/node_modules

build-dev:
echo "build-dev"
make npm-install
make lerna

build-and-install:
make build
make install

build:
echo "build-and-install"
make npm-install
make lerna
echo "run gulp production directly"
npm run build

clean:
rm -Rf build/
mkdir -p build/

install:
echo "make install"
echo "mkdir -p $(DESTDIR)$(PREFIX)"
mkdir -p $(DESTDIR)$(PREFIX)
echo "cp -R $(CURDIR)/build/* $(DESTDIR)$(PREFIX)"
cp -R $(CURDIR)/build/* $(DESTDIR)$(PREFIX)

deb:
Expand Down
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,31 @@ $ gulp

At that point you should be able to point your browser to http://localhost:3000/ and see the the page.

Quick start (docker-compose)
-----------

> **Note:** docker-compose uses `config.local.js` which is gitignored and should be a copy of `config.js` with your specific values
Production:
```
docker-compose up
```

Dev:
```
docker-compose -f docker-compose.dev.yml up --build
```

Production with NGINX:
```
docker-compose -f docker-compose.nginx.yml up --build
```

Dev with NGINX:
```
docker-compose -f docker-compose.nginx-dev.yml up --build
```

Build system
------------

Expand Down
15 changes: 12 additions & 3 deletions apps/st2-actions/actions-details.component.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2021 The StackStorm Authors.
// Copyright 2019 Extreme Networks, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -31,7 +32,6 @@ import {
FlexTableColumn,
FlexTableInsert,
} from '@stackstorm/module-flex-table';
import FlowLink from '@stackstorm/module-flow-link';
import Button from '@stackstorm/module-forms/button.component';
import Highlight from '@stackstorm/module-highlight';
import Label from '@stackstorm/module-label';
Expand Down Expand Up @@ -213,7 +213,9 @@ export default class ActionsDetails extends React.Component {
},
});
}

setWindowName(e){
window.name="parent"
}
handleRun(e, ...args) {
e.preventDefault();

Expand Down Expand Up @@ -253,7 +255,14 @@ export default class ActionsDetails extends React.Component {
<Button flat value="Preview" onClick={() => this.handleToggleRunPreview()} />
<DetailsToolbarSeparator />
{ action.runner_type === 'mistral-v2' || action.runner_type === 'orquesta' ? (
<FlowLink action={action.ref} data-test="flow_link" />
<Link
target="_blank"
to={`/action/${action.ref}`}
className="st2-forms__button st2-details__toolbar-button"
onClick ={e => this.setWindowName(e)}
>
Edit
</Link>
) : null }
</DetailsToolbar>
{ this.state.runPreview && <Highlight key="preview" well data-test="action_code" code={this.state.runValue} /> }
Expand Down
12 changes: 10 additions & 2 deletions apps/st2-actions/actions-panel.component.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2021 The StackStorm Authors.
// Copyright 2019 Extreme Networks, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -27,7 +28,7 @@ import notification from '@stackstorm/module-notification';
import setTitle from '@stackstorm/module-title';

import FlexTable from '@stackstorm/module-flex-table';
import FlowLink from '@stackstorm/module-flow-link';
import Link from '@stackstorm/module-router/link.component';
import PackIcon from '@stackstorm/module-pack-icon';
import {
Panel,
Expand Down Expand Up @@ -222,7 +223,14 @@ export default class ActionsPanel extends React.Component {
<Panel data-test="actions_panel" detailed>
<PanelView className="st2-actions">
<div className="st2-panel__toolbar-actions">
<FlowLink />
<Link
target="_blank"
to="/action"
replace={true}
className="st2-panel__toolbar-button"
>
<i className="icon-plus" />
</Link>
</div>
<Toolbar title="Actions">
<ToolbarSearch
Expand Down
2 changes: 1 addition & 1 deletion apps/st2-actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"dependencies": {
"@stackstorm/module-action-reporter": "^2.4.3",
"@stackstorm/module-api": "^2.4.3",
"@stackstorm/module-auto-form": "^2.4.3",
"@stackstorm/module-auto-form": "^2.4.5",
"@stackstorm/module-filter-expandable": "^2.4.3",
"@stackstorm/module-flex-table": "^2.4.3",
"@stackstorm/module-flow-link": "^2.4.3",
Expand Down
2 changes: 1 addition & 1 deletion apps/st2-history/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"dependencies": {
"@stackstorm/module-action-reporter": "^2.4.3",
"@stackstorm/module-api": "^2.4.3",
"@stackstorm/module-auto-form": "^2.4.3",
"@stackstorm/module-auto-form": "^2.4.5",
"@stackstorm/module-filter": "^2.4.3",
"@stackstorm/module-filter-expandable": "^2.4.3",
"@stackstorm/module-flex-table": "^2.4.3",
Expand Down
2 changes: 1 addition & 1 deletion apps/st2-inquiry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
},
"dependencies": {
"@stackstorm/module-api": "^2.4.3",
"@stackstorm/module-auto-form": "^2.4.3",
"@stackstorm/module-auto-form": "^2.4.5",
"@stackstorm/module-flex-table": "^2.4.3",
"@stackstorm/module-forms": "^2.4.3",
"@stackstorm/module-highlight": "^2.4.3",
Expand Down
2 changes: 1 addition & 1 deletion apps/st2-packs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
"dependencies": {
"@stackstorm/module-api": "^2.4.3",
"@stackstorm/module-auto-form": "^2.4.3",
"@stackstorm/module-auto-form": "^2.4.5",
"@stackstorm/module-flex-table": "^2.4.3",
"@stackstorm/module-forms": "^2.4.3",
"@stackstorm/module-highlight": "^2.4.3",
Expand Down
2 changes: 1 addition & 1 deletion apps/st2-rules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
"dependencies": {
"@stackstorm/module-api": "^2.4.3",
"@stackstorm/module-auto-form": "^2.4.3",
"@stackstorm/module-auto-form": "^2.4.5",
"@stackstorm/module-criteria": "^2.4.3",
"@stackstorm/module-flex-table": "^2.4.3",
"@stackstorm/module-forms": "^2.4.3",
Expand Down
25 changes: 25 additions & 0 deletions apps/st2-workflows/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright 2021 The StackStorm Authors.
// Copyright 2019 Extreme Networks, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import Workflows from './workflows.component';

const route = {
title: 'Workflows',
url: '/action',
Component: Workflows,
position: 7,
};

export default route;

0 comments on commit 778cfe3

Please sign in to comment.