Skip to content

Commit 778cfe3

Browse files
authored
Merge pull request #759 from StackStorm/integrate-st2flow
Integrate st2flow
2 parents 375403c + d89418e commit 778cfe3

File tree

175 files changed

+34109
-1790
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+34109
-1790
lines changed

.eslintrc.yml

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
---
22
root: true
3+
globals:
4+
$Shape: false
35
plugins:
6+
- flowtype
47
- react
58
- notice
69
extends:
@@ -138,3 +141,4 @@ rules:
138141
notice/notice:
139142
- error
140143
- 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"
144+

.flowconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[ignore]
2+
.*/module-deps/test/invalid_pkg/package.json
3+
4+
[include]
5+
6+
[libs]
7+
8+
[lints]
9+
10+
[options]
11+
esproposal.decorators=ignore
12+
13+
[strict]

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,7 @@ debian/files
1818

1919
# VIM Swap
2020
.*.swp
21+
22+
23+
# local stuff
24+
config.local.js

Dockerfile

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM node:10.15.3
2+
3+
# Create app directory
4+
WORKDIR /opt/stackstorm/static/webui/st2web
5+
6+
# get files
7+
COPY . /opt/stackstorm/static/webui/st2web
8+
RUN rm /opt/stackstorm/static/webui/st2web/yarn.lock
9+
10+
# install dependencies
11+
RUN make build-and-install
12+
13+
# expose your ports
14+
EXPOSE 3000
15+
16+
# start it up
17+
CMD [ "npm", "run", "serve" ]

Dockerfile-dev

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM node:10.15.3
2+
3+
# Create app directory
4+
WORKDIR /opt/stackstorm/static/webui/st2web
5+
6+
# get files
7+
COPY . /opt/stackstorm/static/webui/st2web
8+
RUN rm /opt/stackstorm/static/webui/st2web/yarn.lock
9+
10+
# install dependencies
11+
RUN make build-dev
12+
13+
# expose your ports
14+
EXPOSE 3000
15+
16+
# start it up
17+
CMD [ "npm", "run", "serve-dev" ]

Dockerfile-nginx

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM node:10.15.3 as build
2+
3+
# Create app directory
4+
WORKDIR /opt/stackstorm/static/webui/st2web
5+
6+
# get files
7+
COPY . /opt/stackstorm/static/webui/st2web
8+
RUN rm /opt/stackstorm/static/webui/st2web/yarn.lock
9+
10+
# install dependencies
11+
RUN make build-and-install
12+
13+
# expose your ports
14+
EXPOSE 3000
15+
16+
17+
FROM nginx
18+
RUN rm -f /etc/nginx/conf.d/default.conf
19+
# COPY ./nginx.local.conf /etc/nginx/conf.d/default.conf
20+
COPY ./nginx.local.conf /etc/nginx/conf.d/st2.conf
21+
COPY --from=build /opt/stackstorm/static/webui /opt/stackstorm/static/webui
22+
# Generate self-signed certificate or place your existing certificate under /etc/ssl/st2
23+
RUN mkdir -p /etc/ssl/st2
24+
RUN openssl req -x509 -newkey rsa:2048 -keyout /etc/ssl/st2/st2.key -out /etc/ssl/st2/st2.crt \
25+
-days 365 -nodes -subj "/C=US/ST=California/L=Palo Alto/O=StackStorm/OU=Information \
26+
Technology/CN=$(hostname)"

Dockerfile-nginx-dev

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM node:10.15.3 as build
2+
3+
# Create app directory
4+
WORKDIR /opt/stackstorm/static/webui/st2web
5+
6+
# get files
7+
COPY . /opt/stackstorm/static/webui/st2web
8+
RUN rm /opt/stackstorm/static/webui/st2web/yarn.lock
9+
10+
# install dependencies
11+
RUN make build-dev
12+
13+
# expose your ports
14+
EXPOSE 3000
15+
16+
17+
FROM nginx
18+
RUN rm -f /etc/nginx/conf.d/default.conf
19+
COPY ./nginx.local-dev.conf /etc/nginx/conf.d/st2.conf
20+
COPY --from=build /opt/stackstorm/static/webui /opt/stackstorm/static/webui

Makefile

+25
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,40 @@ DEB_DISTRO := $(shell (echo $(PKG_VERSION) | grep -q dev) && echo unstable || ec
99
.PHONY: all build clean install deb rpm
1010
all: build
1111

12+
npm-install:
13+
echo "npm install"
14+
npm install -g lerna yarn
15+
16+
lerna:
17+
echo "lerna"
18+
lerna bootstrap
19+
rm -rf apps/st2-workflows/node_modules
20+
21+
build-dev:
22+
echo "build-dev"
23+
make npm-install
24+
make lerna
25+
26+
build-and-install:
27+
make build
28+
make install
29+
1230
build:
31+
echo "build-and-install"
32+
make npm-install
33+
make lerna
34+
echo "run gulp production directly"
1335
npm run build
1436

1537
clean:
1638
rm -Rf build/
1739
mkdir -p build/
1840

1941
install:
42+
echo "make install"
43+
echo "mkdir -p $(DESTDIR)$(PREFIX)"
2044
mkdir -p $(DESTDIR)$(PREFIX)
45+
echo "cp -R $(CURDIR)/build/* $(DESTDIR)$(PREFIX)"
2146
cp -R $(CURDIR)/build/* $(DESTDIR)$(PREFIX)
2247

2348
deb:

README.md

+25
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,31 @@ $ gulp
4747

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

50+
Quick start (docker-compose)
51+
-----------
52+
53+
> **Note:** docker-compose uses `config.local.js` which is gitignored and should be a copy of `config.js` with your specific values
54+
55+
Production:
56+
```
57+
docker-compose up
58+
```
59+
60+
Dev:
61+
```
62+
docker-compose -f docker-compose.dev.yml up --build
63+
```
64+
65+
Production with NGINX:
66+
```
67+
docker-compose -f docker-compose.nginx.yml up --build
68+
```
69+
70+
Dev with NGINX:
71+
```
72+
docker-compose -f docker-compose.nginx-dev.yml up --build
73+
```
74+
5075
Build system
5176
------------
5277

apps/st2-actions/actions-details.component.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Copyright 2021 The StackStorm Authors.
12
// Copyright 2019 Extreme Networks, Inc.
23
//
34
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -31,7 +32,6 @@ import {
3132
FlexTableColumn,
3233
FlexTableInsert,
3334
} from '@stackstorm/module-flex-table';
34-
import FlowLink from '@stackstorm/module-flow-link';
3535
import Button from '@stackstorm/module-forms/button.component';
3636
import Highlight from '@stackstorm/module-highlight';
3737
import Label from '@stackstorm/module-label';
@@ -213,7 +213,9 @@ export default class ActionsDetails extends React.Component {
213213
},
214214
});
215215
}
216-
216+
setWindowName(e){
217+
window.name="parent"
218+
}
217219
handleRun(e, ...args) {
218220
e.preventDefault();
219221

@@ -253,7 +255,14 @@ export default class ActionsDetails extends React.Component {
253255
<Button flat value="Preview" onClick={() => this.handleToggleRunPreview()} />
254256
<DetailsToolbarSeparator />
255257
{ action.runner_type === 'mistral-v2' || action.runner_type === 'orquesta' ? (
256-
<FlowLink action={action.ref} data-test="flow_link" />
258+
<Link
259+
target="_blank"
260+
to={`/action/${action.ref}`}
261+
className="st2-forms__button st2-details__toolbar-button"
262+
onClick ={e => this.setWindowName(e)}
263+
>
264+
Edit
265+
</Link>
257266
) : null }
258267
</DetailsToolbar>
259268
{ this.state.runPreview && <Highlight key="preview" well data-test="action_code" code={this.state.runValue} /> }

apps/st2-actions/actions-panel.component.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Copyright 2021 The StackStorm Authors.
12
// Copyright 2019 Extreme Networks, Inc.
23
//
34
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -27,7 +28,7 @@ import notification from '@stackstorm/module-notification';
2728
import setTitle from '@stackstorm/module-title';
2829

2930
import FlexTable from '@stackstorm/module-flex-table';
30-
import FlowLink from '@stackstorm/module-flow-link';
31+
import Link from '@stackstorm/module-router/link.component';
3132
import PackIcon from '@stackstorm/module-pack-icon';
3233
import {
3334
Panel,
@@ -222,7 +223,14 @@ export default class ActionsPanel extends React.Component {
222223
<Panel data-test="actions_panel" detailed>
223224
<PanelView className="st2-actions">
224225
<div className="st2-panel__toolbar-actions">
225-
<FlowLink />
226+
<Link
227+
target="_blank"
228+
to="/action"
229+
replace={true}
230+
className="st2-panel__toolbar-button"
231+
>
232+
<i className="icon-plus" />
233+
</Link>
226234
</div>
227235
<Toolbar title="Actions">
228236
<ToolbarSearch

apps/st2-actions/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"dependencies": {
4848
"@stackstorm/module-action-reporter": "^2.4.3",
4949
"@stackstorm/module-api": "^2.4.3",
50-
"@stackstorm/module-auto-form": "^2.4.3",
50+
"@stackstorm/module-auto-form": "^2.4.5",
5151
"@stackstorm/module-filter-expandable": "^2.4.3",
5252
"@stackstorm/module-flex-table": "^2.4.3",
5353
"@stackstorm/module-flow-link": "^2.4.3",

apps/st2-history/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"dependencies": {
4848
"@stackstorm/module-action-reporter": "^2.4.3",
4949
"@stackstorm/module-api": "^2.4.3",
50-
"@stackstorm/module-auto-form": "^2.4.3",
50+
"@stackstorm/module-auto-form": "^2.4.5",
5151
"@stackstorm/module-filter": "^2.4.3",
5252
"@stackstorm/module-filter-expandable": "^2.4.3",
5353
"@stackstorm/module-flex-table": "^2.4.3",

apps/st2-inquiry/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
},
4949
"dependencies": {
5050
"@stackstorm/module-api": "^2.4.3",
51-
"@stackstorm/module-auto-form": "^2.4.3",
51+
"@stackstorm/module-auto-form": "^2.4.5",
5252
"@stackstorm/module-flex-table": "^2.4.3",
5353
"@stackstorm/module-forms": "^2.4.3",
5454
"@stackstorm/module-highlight": "^2.4.3",

apps/st2-packs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
},
4747
"dependencies": {
4848
"@stackstorm/module-api": "^2.4.3",
49-
"@stackstorm/module-auto-form": "^2.4.3",
49+
"@stackstorm/module-auto-form": "^2.4.5",
5050
"@stackstorm/module-flex-table": "^2.4.3",
5151
"@stackstorm/module-forms": "^2.4.3",
5252
"@stackstorm/module-highlight": "^2.4.3",

apps/st2-rules/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
},
4747
"dependencies": {
4848
"@stackstorm/module-api": "^2.4.3",
49-
"@stackstorm/module-auto-form": "^2.4.3",
49+
"@stackstorm/module-auto-form": "^2.4.5",
5050
"@stackstorm/module-criteria": "^2.4.3",
5151
"@stackstorm/module-flex-table": "^2.4.3",
5252
"@stackstorm/module-forms": "^2.4.3",

apps/st2-workflows/index.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright 2021 The StackStorm Authors.
2+
// Copyright 2019 Extreme Networks, Inc.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
16+
import Workflows from './workflows.component';
17+
18+
const route = {
19+
title: 'Workflows',
20+
url: '/action',
21+
Component: Workflows,
22+
position: 7,
23+
};
24+
25+
export default route;

0 commit comments

Comments
 (0)