├── .agignore ├── .circleci └── config.yml ├── .csscomb.json ├── .eslintignore ├── .eslintrc.yml ├── .flowconfig ├── .github └── FUNDING.yml ├── .gitignore ├── .yarnrc ├── CHANGELOG.rst ├── Dockerfile ├── Dockerfile-dev ├── Dockerfile-nginx ├── Dockerfile-nginx-dev ├── LICENSE ├── Makefile ├── README.md ├── Vagrantfile ├── apps ├── st2-actions │ ├── actions-details.component.js │ ├── actions-flex-card.component.js │ ├── actions-panel.component.js │ ├── actions.component.js │ ├── index.js │ ├── package.json │ ├── store.js │ └── style.css ├── st2-code │ ├── code-panel.component.js │ ├── code.component.js │ ├── index.js │ ├── package.json │ ├── panels │ │ ├── action-code.component.js │ │ ├── action-entrypoint.component.js │ │ ├── base.component.js │ │ ├── execution-code.component.js │ │ ├── execution-live-feed.component.js │ │ ├── execution-result.component.js │ │ ├── rule-code.component.js │ │ ├── trigger-instance-code.component.js │ │ ├── trigger-type-code.component.js │ │ └── unknown.component.js │ ├── store.js │ └── style.css ├── st2-history │ ├── history-details.component.js │ ├── history-flex-card.component.js │ ├── history-panel.component.js │ ├── history-popup.component.js │ ├── history.component.js │ ├── index.js │ ├── package.json │ ├── store.js │ └── style.css ├── st2-inquiry │ ├── index.js │ ├── inquiry-details.component.js │ ├── inquiry-flex-card.component.js │ ├── inquiry-panel.component.js │ ├── inquiry.component.js │ ├── package.json │ ├── store.js │ └── style.css ├── st2-packs │ ├── api.js │ ├── index.js │ ├── package.json │ ├── packs-details.component.js │ ├── packs-flex-card.component.js │ ├── packs-panel.component.js │ ├── packs.component.js │ ├── store.js │ ├── style.css │ └── table.component.js ├── st2-rules │ ├── index.js │ ├── package.json │ ├── panels │ │ └── enforcements.js │ ├── rules-details.component.js │ ├── rules-flex-card.component.js │ ├── rules-panel.component.js │ ├── rules-popup.component.js │ ├── rules.component.js │ ├── store.js │ └── style.css ├── st2-triggers │ ├── index.js │ ├── package.json │ ├── panels │ │ └── instances.js │ ├── store.js │ ├── style.css │ ├── triggers-details.component.js │ ├── triggers-flex-card.component.js │ ├── triggers-panel.component.js │ └── triggers.component.js └── st2-workflows │ ├── index.js │ ├── package.json │ ├── store.js │ ├── style.css │ └── workflows.component.js ├── babel.config.js ├── bootstrap.sh ├── bower.json ├── config.js ├── debian ├── changelog ├── compat ├── conffiles ├── control ├── copyright ├── docs ├── rules └── source │ └── format ├── dependencyci.yml ├── docker-compose.dev.yml ├── docker-compose.nginx-dev.yml ├── docker-compose.nginx.yml ├── docker-compose.yml ├── favicon.ico ├── font ├── DroidSansMono.eot ├── DroidSansMono.svg ├── DroidSansMono.ttf ├── DroidSansMono.woff ├── Roboto-300.eot ├── Roboto-300.svg ├── Roboto-300.ttf ├── Roboto-300.woff ├── Roboto-300.woff2 ├── Roboto-500.eot ├── Roboto-500.svg ├── Roboto-500.ttf ├── Roboto-500.woff ├── Roboto-500.woff2 ├── Roboto-700.eot ├── Roboto-700.svg ├── Roboto-700.ttf ├── Roboto-700.woff ├── Roboto-700.woff2 ├── Roboto-regular.eot ├── Roboto-regular.svg ├── Roboto-regular.ttf ├── Roboto-regular.woff ├── Roboto-regular.woff2 ├── brocadeicons.eot ├── brocadeicons.svg ├── brocadeicons.ttf ├── brocadeicons.woff ├── st2-allicons-110818.png ├── st2-config.json ├── st2-iconfont-README.txt ├── st2.eot ├── st2.svg ├── st2.ttf ├── st2.woff ├── st2.woff2 ├── ststanley.eot ├── ststanley.svg ├── ststanley.ttf └── ststanley.woff ├── fontello.json ├── gulpfile.js ├── img ├── empty.svg ├── icon.png └── logo.svg ├── index.html ├── lerna.json ├── main.js ├── modules ├── st2-action-reporter │ ├── action-reporter.component.js │ ├── package.json │ ├── reporters │ │ ├── debug.js │ │ ├── http.js │ │ ├── index.js │ │ ├── run-local.js │ │ ├── run-python.js │ │ └── run-remote.js │ ├── style.css │ └── tests │ │ ├── test-action-reporter.js │ │ ├── test-reporters-debug.js │ │ ├── test-reporters-http.js │ │ ├── test-reporters-run-local.js │ │ ├── test-reporters-run-python.js │ │ └── test-reporters-run-remote.js ├── st2-api │ ├── api.js │ ├── package.json │ └── tests │ │ └── test-api.js ├── st2-auto-form │ ├── auto-form.component.js │ ├── fields │ │ ├── array.js │ │ ├── base.js │ │ ├── boolean.js │ │ ├── color-string.js │ │ ├── enum.js │ │ ├── index.js │ │ ├── integer.js │ │ ├── number.js │ │ ├── object.js │ │ ├── password.js │ │ ├── select.js │ │ └── string.js │ ├── modules │ │ ├── array.js │ │ ├── checkbox.js │ │ ├── combobox.js │ │ ├── index.js │ │ ├── input.js │ │ ├── link.js │ │ ├── object.js │ │ ├── select.js │ │ └── text-field.js │ ├── package.json │ ├── style.css │ ├── tests │ │ ├── test-array.js │ │ ├── test-base-text.js │ │ ├── test-base-textarea.js │ │ ├── test-boolean.js │ │ ├── test-component.js │ │ ├── test-enum.js │ │ ├── test-integer.js │ │ ├── test-number.js │ │ ├── test-object.js │ │ ├── test-string.js │ │ └── utils.js │ └── wrappers.js ├── st2-criteria │ ├── criteria.component.js │ ├── package.json │ ├── style.css │ └── tests │ │ └── test-criteria.js ├── st2-filter-expandable │ ├── filter-expandable.js │ ├── package.json │ └── tests │ │ └── test-filter-expandable.js ├── st2-filter │ ├── filter.component.js │ ├── package.json │ ├── style.css │ └── tests │ │ └── test-filter.js ├── st2-flex-table │ ├── flex-table.component.js │ ├── flex-table.reducer.js │ ├── package.json │ ├── style.css │ ├── style.pcss │ └── tests │ │ ├── test-flex-table-insert.js │ │ ├── test-flex-table-row.js │ │ ├── test-flex-table-title.js │ │ ├── test-flex-table.js │ │ └── test-reducer.js ├── st2-flow-link │ ├── flow-link.component.js │ ├── package.json │ ├── style.css │ └── tests │ │ └── test-flow-link.js.skip ├── st2-forms │ ├── button.component.js │ ├── package.json │ ├── style.css │ └── style.pcss ├── st2-highlight │ ├── editor.css │ ├── highlight.component.js │ ├── package.json │ ├── style.pcss │ └── tests │ │ └── test-highlight.js ├── st2-label │ ├── label.component.js │ ├── package.json │ ├── style.css │ └── tests │ │ └── test-label.js ├── st2-login │ ├── login.component.js │ ├── package.json │ ├── style.css │ └── tests │ │ └── test-login.js ├── st2-menu │ ├── menu.component.js │ ├── package.json │ ├── style.css │ └── tests │ │ └── test-menu.js ├── st2-notification │ ├── notification.js │ ├── package.json │ └── style.css ├── st2-pack-icon │ ├── pack-icon.component.js │ ├── package.json │ ├── style.css │ └── tests │ │ └── test-pack-icon.js ├── st2-panel │ ├── package.json │ ├── panel.component.js │ ├── style.css │ └── tests │ │ ├── test-content-empty.js │ │ ├── test-content.js │ │ ├── test-details-body.js │ │ ├── test-details-buttons-panel.js │ │ ├── test-details-header.js │ │ ├── test-details-panel-body-line.js │ │ ├── test-details-panel-body.js │ │ ├── test-details-panel-empty.js │ │ ├── test-details-panel-heading.js │ │ ├── test-details-panel.js │ │ ├── test-details-switch.js │ │ ├── test-details-toolbar-separator.js │ │ ├── test-details-toolbar.js │ │ ├── test-panel-details.js │ │ ├── test-panel-navigation.js │ │ ├── test-panel-view.js │ │ ├── test-panel.js │ │ ├── test-toggle-button.js │ │ ├── test-toolbar-actions.js │ │ ├── test-toolbar-button.js │ │ ├── test-toolbar-filters.js │ │ ├── test-toolbar-search.js │ │ ├── test-toolbar-title.js │ │ ├── test-toolbar-view.js │ │ └── test-toolbar.js ├── st2-popup │ ├── package.json │ ├── popup.component.js │ ├── style.css │ └── tests │ │ ├── test-popup-title.js │ │ └── test-popup.js ├── st2-portion-bar │ ├── package.json │ ├── portion-bar.component.js │ ├── style.css │ └── tests │ │ └── test-portion-bar.js ├── st2-proportional │ ├── package.json │ ├── proportional.js │ └── tests │ │ └── test-proportional.js ├── st2-remote-form │ ├── package.json │ ├── remote-form.component.js │ ├── style.css │ └── tests │ │ └── test-remote-form.js ├── st2-router │ ├── history.js │ ├── index.js │ ├── link.component.js │ ├── methods.js │ ├── package.json │ ├── redirect.component.js │ ├── reducer.js │ ├── route.component.js │ └── router.component.js ├── st2-scroll-into-view │ ├── package.json │ ├── scroll-into-view.js │ └── tests │ │ └── test-scroll-into-view.js ├── st2-select-on-click │ ├── package.json │ ├── select-on-click.js │ └── tests │ │ └── test-select-on-click.js ├── st2-store │ ├── package.json │ └── store.js ├── st2-style │ ├── branding.css │ ├── colors.css │ ├── font │ │ ├── DroidSansMono.css │ │ ├── Roboto.css │ │ ├── animation.css │ │ ├── brocadeicons.css │ │ ├── st2.css │ │ ├── ststanley-codes.css │ │ ├── ststanley-embedded.css │ │ ├── ststanley-ie7-codes.css │ │ ├── ststanley-ie7.css │ │ └── ststanley.css │ ├── fonts.css │ ├── package.json │ ├── style.css │ └── style.js ├── st2-test-utils │ ├── bootstrap │ │ ├── events.js │ │ ├── location.js │ │ ├── misc.js │ │ ├── st2constants.js │ │ ├── storage.js │ │ └── title.js │ ├── package.json │ └── test-utils.js ├── st2-time │ ├── package.json │ ├── tests │ │ └── test-time.js │ └── time.component.js ├── st2-title │ ├── package.json │ ├── tests │ │ └── test-title.js │ └── title.js ├── st2-value-format │ ├── package.json │ ├── tests │ │ └── test-value-format.js │ └── value-format.js ├── st2-view │ ├── package.json │ ├── style.css │ ├── tests │ │ └── test-view.js │ └── view.component.js ├── st2flow-canvas │ ├── astar.js │ ├── collapse-button.js │ ├── const.js │ ├── index.js │ ├── package.json │ ├── path │ │ ├── index.js │ │ └── line.js │ ├── poisson-rect.js │ ├── routing-graph.js │ ├── style.css │ ├── task.js │ ├── toolbar.js │ ├── transition.js │ └── vector.js ├── st2flow-details │ ├── index.js │ ├── layout.js │ ├── meta-panel.js │ ├── mistral-properties.js │ ├── mistral-transition.js │ ├── orquesta-properties.js │ ├── orquesta-transition.js │ ├── package.json │ ├── parameter-editor.js │ ├── parameter.js │ ├── parameters-panel.js │ ├── property.js │ ├── string-properties.js │ ├── style.css │ ├── task-details.js │ ├── task-list.js │ └── task.js ├── st2flow-editor │ ├── index.js │ ├── package.json │ └── style.css ├── st2flow-header │ ├── index.js │ ├── package.json │ └── style.css ├── st2flow-model │ ├── base-class.js │ ├── base-model.js │ ├── event-emitter.js │ ├── index.js │ ├── interfaces.js │ ├── layout.js │ ├── model-meta.js │ ├── model-mistral.js │ ├── model-orquesta.js │ ├── package.json │ ├── schemas │ │ ├── metadata.json │ │ ├── mistral.json │ │ └── orquesta.json │ └── tests │ │ ├── data │ │ ├── actionchain-basic.yaml │ │ ├── common-data.js │ │ ├── meta-basic.json │ │ ├── mistral-basic.yaml │ │ └── orquesta-basic.yaml │ │ ├── test-common.js │ │ ├── test-model-meta.js │ │ ├── test-model-mistral.js │ │ └── test-model-orquesta.js ├── st2flow-notifications │ ├── README.md │ ├── index.js │ ├── package.json │ └── style.css ├── st2flow-palette │ ├── action.js │ ├── index.js │ ├── pack.js │ ├── package.json │ └── style.css ├── st2flow-perf │ ├── index.js │ └── package.json └── st2flow-yaml │ ├── README.md │ ├── crawler.js │ ├── index.js │ ├── objectifier.js │ ├── package.json │ ├── stringifier.js │ ├── tests │ ├── data │ │ ├── basic-json.yaml │ │ ├── basic.yaml │ │ ├── complex-json.yaml │ │ ├── complex.yaml │ │ ├── long-json.yaml │ │ ├── long.yaml │ │ ├── simple-json.yaml │ │ └── simple.yaml │ ├── refinery │ │ ├── js-in-yaml.js │ │ └── obj-to-yaml.js │ ├── test-crawler.js │ ├── test-refinery.js │ └── test-token-set.js │ ├── token-factory.js │ ├── token-refinery.js │ ├── token-set.js │ ├── types.js │ └── util.js ├── nginx.local-dev.conf ├── nginx.local.conf ├── package.json ├── renovate.json ├── rpm └── st2web.spec ├── style.css ├── tasks ├── browserify.js ├── build.js ├── default.js ├── font.js ├── index.js ├── lint.js ├── package.json ├── production │ ├── environment.js │ ├── index.js │ ├── package-metadata.js │ ├── scripts.js │ ├── serve.js │ ├── static.js │ ├── styles.js │ └── test.js ├── serve.js ├── settings.json ├── test-functional.js ├── test-unit.js ├── test.js └── watch.js ├── tests ├── test-actions.js ├── test-history.js ├── test-login.js ├── test-packs.js ├── test-rules.js └── util.js └── yarn.lock /.agignore: -------------------------------------------------------------------------------- 1 | build 2 | js 3 | css 4 | font 5 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | apps/*/node_modules 2 | modules/*/node_modules 3 | tasks/*/node_modules 4 | node_modules 5 | js 6 | package.meta.js 7 | -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 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] 14 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # https://stackstorm.com/2020/06/12/sponsoring-stackstorm/ 2 | # FAQ: https://stackstorm.com/donate/ 3 | # Expenses: https://github.com/StackStorm/discussions/issues/36 4 | community_bridge: stackstorm 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | npm-debug.log 2 | lerna-debug.log 3 | yarn-error.log 4 | yarn-debug.log 5 | node_modules 6 | css 7 | js 8 | build 9 | 10 | debian/st2web 11 | debian/*.debhelper.log 12 | debian/*.substvars 13 | debian/files 14 | 15 | .vagrant 16 | 17 | .DS_Store 18 | 19 | # VIM Swap 20 | .*.swp 21 | 22 | 23 | # local stuff 24 | config.local.js 25 | -------------------------------------------------------------------------------- /.yarnrc: -------------------------------------------------------------------------------- 1 | workspaces-experimental true 2 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:20.8.1 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" ] 18 | -------------------------------------------------------------------------------- /Dockerfile-dev: -------------------------------------------------------------------------------- 1 | FROM node:20.8.1 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" ] 18 | -------------------------------------------------------------------------------- /Dockerfile-nginx: -------------------------------------------------------------------------------- 1 | FROM node:20.8.1 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)" 27 | -------------------------------------------------------------------------------- /Dockerfile-nginx-dev: -------------------------------------------------------------------------------- 1 | FROM node:20.8.1 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 21 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | COMPONENT := $(notdir $(CURDIR)) 2 | PKG_RELEASE ?= 1 3 | PKG_VERSION ?= $(shell node -e "console.log(require('./package.json').st2_version)") 4 | PREFIX ?= /opt/stackstorm/static/webui 5 | CHANGELOG_COMMENT ?= "automated build, version: $(PKG_VERSION)" 6 | #DEB_EPOCH := $(shell echo $(PKG_VERSION) | grep -q dev || echo '1') 7 | DEB_DISTRO := $(shell (echo $(PKG_VERSION) | grep -q dev) && echo unstable || echo stable) 8 | 9 | .PHONY: all build clean install deb rpm 10 | all: build 11 | 12 | # yarn now included in later node images 13 | npm-install: 14 | echo "npm install" 15 | npm install -g lerna@6.0.0 16 | 17 | lerna: 18 | echo "lerna" 19 | lerna bootstrap 20 | rm -rf apps/st2-workflows/node_modules 21 | 22 | build-dev: 23 | echo "build-dev" 24 | make npm-install 25 | make lerna 26 | 27 | build-and-install: 28 | make build 29 | make install 30 | 31 | build: 32 | echo "build-and-install" 33 | make npm-install 34 | make lerna 35 | echo "run gulp production directly" 36 | npm run build 37 | 38 | clean: 39 | rm -Rf build/ 40 | mkdir -p build/ 41 | 42 | install: 43 | echo "make install" 44 | echo "mkdir -p $(DESTDIR)$(PREFIX)" 45 | mkdir -p $(DESTDIR)$(PREFIX) 46 | echo "cp -R $(CURDIR)/build/* $(DESTDIR)$(PREFIX)" 47 | cp -R $(CURDIR)/build/* $(DESTDIR)$(PREFIX) 48 | 49 | deb: 50 | [ -z "$(DEB_EPOCH)" ] && _epoch="" || _epoch="$(DEB_EPOCH):"; \ 51 | dch -m --force-distribution -v$${_epoch}$(PKG_VERSION)-$(PKG_RELEASE) -D$(DEB_DISTRO) $(CHANGELOG_COMMENT) 52 | dpkg-buildpackage -b -uc -us 53 | 54 | rpm: 55 | rpmbuild -bb rpm/st2web.spec 56 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | VAGRANTFILE_API_VERSION = "2" 2 | 3 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 4 | config.vm.network "public_network" 5 | 6 | config.vm.box = "ubuntu/trusty64" 7 | 8 | config.vm.provider :virtualbox do |vb| 9 | vb.memory = 2048 10 | vb.cpus = 2 11 | end 12 | 13 | config.vm.provision :shell, :path => "bootstrap.sh" 14 | end 15 | -------------------------------------------------------------------------------- /apps/st2-actions/index.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import Actions from './actions.component'; 16 | 17 | const route = { 18 | title: 'Actions', 19 | url: '/actions', 20 | icon: 'icon-play', 21 | Component: Actions, 22 | position: 2, 23 | }; 24 | 25 | export default route; 26 | -------------------------------------------------------------------------------- /apps/st2-actions/style.css: -------------------------------------------------------------------------------- 1 | @import "@stackstorm/st2-style/colors.css"; 2 | 3 | .st2-actions { 4 | /* Table columns */ 5 | .st2-flex-table__column&__column { 6 | &-utility { 7 | flex: none; 8 | 9 | width: 20px; 10 | } 11 | &-name { 12 | flex: 1 50px; 13 | } 14 | &-type { 15 | flex: 1 50px; 16 | } 17 | &-desc { 18 | overflow: hidden; 19 | flex: 3 0 100px; 20 | 21 | text-overflow: ellipsis; 22 | } 23 | } 24 | 25 | .st2-flex-table__row { 26 | padding: 10px 0; 27 | } 28 | 29 | .st2-flex-table__column&__details-column { 30 | &-meta { 31 | flex: 0 50px; 32 | 33 | word-spacing: 10px; 34 | } 35 | &-status { 36 | flex: 0 100px; 37 | } 38 | &-time { 39 | flex: 1; 40 | } 41 | &-utility { 42 | flex: none; 43 | 44 | width: 30px; 45 | 46 | cursor: pointer; 47 | } 48 | &-history { 49 | font-size: 18px; 50 | 51 | position: relative; 52 | 53 | flex: 0 20px; 54 | 55 | height: 18px; 56 | 57 | text-align: right; 58 | 59 | color: #515151; 60 | } 61 | } 62 | 63 | &__executions { 64 | .st2-flex-table { 65 | margin-bottom: 10px; 66 | 67 | border: 0; 68 | } 69 | 70 | .st2-history-child { 71 | border: solid var(--grey-lighten-3); 72 | border-width: 0 1px 1px 0; 73 | } 74 | 75 | .st2-history-child .st2-history-child { 76 | border: 0; 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /apps/st2-code/code.component.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import React from 'react'; 16 | import { Provider } from 'react-redux'; 17 | 18 | import { Route } from '@stackstorm/module-router'; 19 | 20 | import store from './store'; 21 | import CodePanel from './code-panel.component'; 22 | 23 | 24 | export default class Code extends React.Component { 25 | render() { 26 | return ( 27 | { 30 | return ( 31 | 32 | 33 | 34 | ); 35 | }} 36 | /> 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /apps/st2-code/index.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import Code from './code.component'; 16 | 17 | const route = { 18 | title: 'Code', 19 | url: '/code', 20 | Component: Code, 21 | }; 22 | 23 | export default route; 24 | -------------------------------------------------------------------------------- /apps/st2-code/panels/action-code.component.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import fp from 'lodash/fp'; 16 | import { PropTypes } from 'prop-types'; 17 | 18 | import api from '@stackstorm/module-api'; 19 | 20 | import BaseCode from './base.component'; 21 | 22 | 23 | export default class ActionCode extends BaseCode { 24 | static propTypes = { 25 | id: PropTypes.string, 26 | } 27 | 28 | async fetch({ id }) { 29 | const def = { 30 | backUrl: `/actions/${id}/code`, 31 | }; 32 | 33 | try { 34 | const res = await api.request({ path: `/actions/views/overview/${id}` }); 35 | const code = JSON.stringify(res, null, 2); 36 | return { 37 | ...def, 38 | code, 39 | }; 40 | } 41 | catch (e) { 42 | return { 43 | ...def, 44 | code: fp.get('response.data.faultstring', e), 45 | }; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /apps/st2-code/panels/action-entrypoint.component.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import fp from 'lodash/fp'; 16 | import { PropTypes } from 'prop-types'; 17 | 18 | import api from '@stackstorm/module-api'; 19 | 20 | import BaseCode from './base.component'; 21 | 22 | 23 | export default class EntrypointCode extends BaseCode { 24 | static propTypes = { 25 | id: PropTypes.string, 26 | } 27 | 28 | async fetch({ id }) { 29 | const def = { 30 | backUrl: `/actions/${id}/entrypoint`, 31 | }; 32 | 33 | try { 34 | const res = await api.request({ path: `/actions/views/entry_point/${id}`, raw: true }); 35 | return { 36 | ...def, 37 | code: res.data, 38 | }; 39 | } 40 | catch (e) { 41 | return { 42 | ...def, 43 | code: fp.get('response.data.faultstring', e), 44 | }; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /apps/st2-code/panels/execution-code.component.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import fp from 'lodash/fp'; 16 | import { PropTypes } from 'prop-types'; 17 | 18 | import api from '@stackstorm/module-api'; 19 | 20 | import BaseCode from './base.component'; 21 | 22 | 23 | export default class ExecutionCode extends BaseCode { 24 | static propTypes = { 25 | id: PropTypes.string, 26 | } 27 | 28 | async fetch({ id }) { 29 | const def = { 30 | backUrl: `/history/${id}/code`, 31 | }; 32 | 33 | try { 34 | const res = await api.request({ path: `/executions/${id}` }); 35 | const code = JSON.stringify(res, null, 2); 36 | return { 37 | ...def, 38 | code, 39 | }; 40 | } 41 | catch (e) { 42 | return { 43 | ...def, 44 | code: fp.get('response.data.faultstring', e), 45 | }; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /apps/st2-code/panels/execution-result.component.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { PropTypes } from 'prop-types'; 16 | 17 | import api from '@stackstorm/module-api'; 18 | 19 | import BaseCode from './base.component'; 20 | 21 | 22 | export default class ResultCode extends BaseCode { 23 | static propTypes = { 24 | id: PropTypes.string, 25 | } 26 | 27 | async fetch({ id }) { 28 | const def = { 29 | backUrl: `/history/${id}/general`, 30 | }; 31 | 32 | const res = await api.request({ 33 | path: `/executions/${id}`, 34 | query: { 35 | include_attributes: 'result', 36 | }, 37 | }); 38 | 39 | const code = res.result ? JSON.stringify(res.result, null, 2) : '// Action produced no data'; 40 | 41 | return { 42 | ...def, 43 | code, 44 | }; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /apps/st2-code/panels/rule-code.component.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import fp from 'lodash/fp'; 16 | import { PropTypes } from 'prop-types'; 17 | 18 | import api from '@stackstorm/module-api'; 19 | 20 | import BaseCode from './base.component'; 21 | 22 | 23 | export default class RuleCode extends BaseCode { 24 | static propTypes = { 25 | id: PropTypes.string, 26 | } 27 | 28 | async fetch({ id }) { 29 | const def = { 30 | backUrl: `/rules/${id}/code`, 31 | }; 32 | 33 | try { 34 | const res = await api.request({ path: `/rules/views/${id}` }); 35 | const code = JSON.stringify(res, null, 2); 36 | return { 37 | ...def, 38 | code, 39 | }; 40 | } 41 | catch (e) { 42 | return { 43 | ...def, 44 | code: fp.get('response.data.faultstring', e), 45 | }; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /apps/st2-code/panels/trigger-instance-code.component.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import fp from 'lodash/fp'; 16 | import { PropTypes } from 'prop-types'; 17 | 18 | import api from '@stackstorm/module-api'; 19 | 20 | import BaseCode from './base.component'; 21 | 22 | 23 | export default class TriggerInstanceCode extends BaseCode { 24 | static propTypes = { 25 | id: PropTypes.string, 26 | back: PropTypes.string, 27 | } 28 | 29 | async fetch({ id }) { 30 | try { 31 | const res = await api.request({ path: `/triggerinstances/${id}` }); 32 | const code = JSON.stringify(res, null, 2); 33 | return { 34 | backUrl: `/triggers/${res.trigger}/instances`, 35 | code, 36 | }; 37 | } 38 | catch (e) { 39 | return { 40 | backUrl: '/history', 41 | code: fp.get('response.data.faultstring', e), 42 | }; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /apps/st2-code/panels/trigger-type-code.component.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import fp from 'lodash/fp'; 16 | import { PropTypes } from 'prop-types'; 17 | 18 | import api from '@stackstorm/module-api'; 19 | 20 | import BaseCode from './base.component'; 21 | 22 | 23 | export default class TriggerTypeCode extends BaseCode { 24 | static propTypes = { 25 | id: PropTypes.string, 26 | } 27 | 28 | async fetch({ id }) { 29 | const def = { 30 | backUrl: `/triggers/${id}/code`, 31 | }; 32 | 33 | try { 34 | const res = await api.request({ path: `/triggertypes/${id}` }); 35 | const code = JSON.stringify(res, null, 2); 36 | return { 37 | ...def, 38 | code, 39 | }; 40 | } 41 | catch (e) { 42 | return { 43 | ...def, 44 | code: fp.get('response.data.faultstring', e), 45 | }; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /apps/st2-code/panels/unknown.component.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import BaseCode from './base.component'; 16 | 17 | export default class UnknownCode extends BaseCode { 18 | async fetch({ type }) { 19 | return { 20 | warning: `Unknown type of code: ${type}`, 21 | code: '', 22 | }; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /apps/st2-code/style.css: -------------------------------------------------------------------------------- 1 | @import "@stackstorm/st2-style/colors.css"; 2 | 3 | .component { 4 | padding: 10px 20px; 5 | 6 | width: 100%; 7 | height: 100%; 8 | 9 | overflow: auto; 10 | } 11 | 12 | .warning { 13 | background-color: #FFEAA8; 14 | border: 1px solid #FFC237; 15 | 16 | color: #826200; 17 | 18 | padding: 5px; 19 | border-radius: 3px; 20 | 21 | display: inline-block; 22 | } 23 | 24 | .back { 25 | font-family: Roboto,sans-serif; 26 | font-size: 16px; 27 | font-weight: normal; 28 | 29 | margin-right: 10px; 30 | 31 | &:any-link { 32 | color: #000; 33 | } 34 | 35 | &:before { 36 | font-family: "brocadeicons"; 37 | font-weight: bold; 38 | font-style: normal; 39 | 40 | font-size: 14px; 41 | 42 | width: 100%; 43 | margin-right: 0.25em; 44 | 45 | content: "\e973"; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /apps/st2-history/index.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import History from './history.component'; 16 | 17 | const route = { 18 | title: 'History', 19 | url: '/history', 20 | icon: 'icon-history', 21 | Component: History, 22 | position: 1, 23 | }; 24 | 25 | export default route; 26 | -------------------------------------------------------------------------------- /apps/st2-inquiry/index.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import Inquiry from './inquiry.component'; 16 | 17 | const route = { 18 | title: 'Inquiries', 19 | url: '/inquiry', 20 | icon: 'icon-pause', 21 | Component: Inquiry, 22 | position: 6, 23 | }; 24 | 25 | export default route; 26 | -------------------------------------------------------------------------------- /apps/st2-inquiry/style.css: -------------------------------------------------------------------------------- 1 | @import "@stackstorm/st2-style/colors.css"; 2 | 3 | .component { 4 | 5 | } 6 | 7 | .action-name { 8 | font-weight: bold; 9 | line-height: normal; 10 | 11 | display: block; 12 | overflow: hidden; 13 | 14 | text-overflow: ellipsis; 15 | } 16 | -------------------------------------------------------------------------------- /apps/st2-packs/index.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import Packs from './packs.component'; 16 | 17 | const route = { 18 | title: 'Packs', 19 | url: '/packs', 20 | icon: 'icon-platforms', 21 | Component: Packs, 22 | position: 4, 23 | }; 24 | 25 | export default route; 26 | -------------------------------------------------------------------------------- /apps/st2-packs/style.css: -------------------------------------------------------------------------------- 1 | @import "@stackstorm/st2-style/colors.css"; 2 | 3 | .st2-packs { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /apps/st2-packs/table.component.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import _ from 'lodash'; 16 | import React from 'react'; 17 | import { PropTypes } from 'prop-types'; 18 | 19 | export default class Table extends React.Component { 20 | static propTypes = { 21 | content: PropTypes.objectOf(PropTypes.node), 22 | } 23 | 24 | render() { 25 | const { content, ...props } = this.props; 26 | 27 | return ( 28 |
29 | { _(content).pickBy((v) => !!v).map((value, key) => ( 30 |
31 |
{ key }
32 |
{ value }
33 |
34 | )).value() } 35 |
36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /apps/st2-rules/index.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import Rules from './rules.component'; 16 | 17 | const route = { 18 | title: 'Rules', 19 | url: '/rules', 20 | icon: 'icon-book-closed', 21 | Component: Rules, 22 | position: 3, 23 | }; 24 | 25 | export default route; 26 | -------------------------------------------------------------------------------- /apps/st2-triggers/index.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import Triggers from './triggers.component'; 16 | 17 | const route = { 18 | title: 'Triggers', 19 | url: '/triggers', 20 | icon: 'icon-book-open', 21 | Component: Triggers, 22 | position: 5, 23 | }; 24 | 25 | export default route; 26 | -------------------------------------------------------------------------------- /apps/st2-workflows/index.js: -------------------------------------------------------------------------------- 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; 26 | -------------------------------------------------------------------------------- /apps/st2-workflows/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021 The StackStorm Authors. 3 | Copyright 2020 Extreme Networks, Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | @import '@stackstorm/st2-style/style.css'; 19 | 20 | 21 | .component { 22 | display: flex; 23 | 24 | flex-direction: column; 25 | 26 | height: 100%; 27 | 28 | &-row { 29 | &-content { 30 | flex: 1; 31 | 32 | display: flex; 33 | 34 | overflow: hidden; 35 | } 36 | } 37 | } 38 | 39 | .header { 40 | width: 100%; 41 | height: 50px; 42 | } 43 | 44 | .palette { 45 | width: 250px; 46 | overflow: hidden; 47 | 48 | } 49 | 50 | .canvas { 51 | flex: 1; 52 | height: 100%; 53 | } 54 | 55 | .details { 56 | width: 360px; 57 | height: 100%; 58 | 59 | &.code { 60 | width: 500px; 61 | } 62 | } 63 | div[tabindex="-1"]:focus { 64 | outline: 0; 65 | } 66 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 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 | module.exports = function (api) { 17 | api.cache(true); 18 | 19 | const presets = [ 20 | '@babel/preset-react', 21 | '@babel/preset-env', 22 | ]; 23 | const plugins = [ 24 | '@babel/plugin-transform-flow-strip-types', 25 | [ '@babel/plugin-proposal-decorators', { 'legacy': true }], 26 | '@babel/plugin-proposal-class-properties', 27 | [ '@babel/plugin-proposal-object-rest-spread', { 'legacy': true }], 28 | '@babel/transform-runtime', 29 | ]; 30 | 31 | return { 32 | presets, 33 | plugins, 34 | }; 35 | }; 36 | -------------------------------------------------------------------------------- /bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | apt-get -y update 4 | 5 | # Install N node version manager 6 | apt-get -y install bash git curl make 7 | curl -L https://git.io/n-install | su vagrant -c "bash -s -- -q lts" 8 | . /home/vagrant/.bashrc 9 | 10 | # Configure npm 11 | cat < /home/vagrant/.npmrc 12 | loglevel=http 13 | save-prefix= 14 | EOF 15 | 16 | # mount node_modules locally and make them persist through the reboot 17 | mkdir -p /home/vagrant/node_modules 18 | chown vagrant:vagrant /home/vagrant/node_modules 19 | mount --bind /home/vagrant/node_modules/ /vagrant/node_modules 20 | cat <> /etc/fstab 21 | /home/vagrant/node_modules/ /vagrant/node_modules none bind 22 | EOF 23 | 24 | # Change default CWD to /vagrant 25 | echo "cd /vagrant" >> /home/vagrant/.bashrc 26 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "st2web", 3 | "version": "0.0.0", 4 | "private": true, 5 | "ignore": [ 6 | "**/.*", 7 | "node_modules", 8 | "bower_components", 9 | "test", 10 | "tests" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | st2web (1.3dev-1) UNRELEASED; urgency=medium 2 | 3 | * Initial release (Closes: #nnnn) 4 | 5 | -- StackStorm Engineering Tue, 12 Jan 2016 05:45:49 -0800 6 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /debian/conffiles: -------------------------------------------------------------------------------- 1 | /opt/stackstorm/static/webui/config.js 2 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: st2web 2 | Section: web 3 | Priority: optional 4 | Maintainer: StackStorm Engineering 5 | Build-Depends: debhelper (>= 9) 6 | Standards-Version: 3.9.5 7 | Homepage: https://stackstorm.com/ 8 | Vcs-Git: git://github.com/stackstorm/st2web.git 9 | Vcs-Browser: https://github.com/stackstorm/st2web 10 | 11 | Package: st2web 12 | Architecture: any 13 | Pre-Depends: dpkg (>= 1.16.16) 14 | Description: St2Web - StackStorm Web UI. 15 | React-based HTML5 real-time Web UI interface for StackStorm open-source automation platform. 16 | Allows to control the whole process of execution, from running an action to seeing the results of the execution. 17 | It also helps to explore workflow executions up to the results of individual tasks. 18 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: st2web 3 | Source: 4 | 5 | Files: * 6 | Copyright: 7 | 8 | License: Apache-2.0 9 | 10 | Files: debian/* 11 | Copyright: 2016 unknown 12 | License: Apache-2.0 13 | 14 | License: Apache-2.0 15 | Licensed under the Apache License, Version 2.0 (the "License"); 16 | you may not use this file except in compliance with the License. 17 | You may obtain a copy of the License at 18 | . 19 | http://www.apache.org/licenses/LICENSE-2.0 20 | . 21 | Unless required by applicable law or agreed to in writing, software 22 | distributed under the License is distributed on an "AS IS" BASIS, 23 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 24 | See the License for the specific language governing permissions and 25 | limitations under the License. 26 | . 27 | On Debian systems, the complete text of the Apache version 2.0 license 28 | can be found in "/usr/share/common-licenses/Apache-2.0". 29 | 30 | # Please also look if there are files or directories which have a 31 | # different copyright/license attached and list them here. 32 | # Please avoid to pick license terms that are more restrictive than the 33 | # packaged work, as it may make Debian's contributions unacceptable upstream. 34 | -------------------------------------------------------------------------------- /debian/docs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/debian/docs -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | %: 3 | dh $@ 4 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /dependencyci.yml: -------------------------------------------------------------------------------- 1 | platform: 2 | npm: 3 | isarray: 4 | tests: 5 | deprecated: skip 6 | base: 7 | tests: 8 | unlicensed: skip 9 | jade: 10 | tests: 11 | deprecated: skip 12 | -------------------------------------------------------------------------------- /docker-compose.dev.yml: -------------------------------------------------------------------------------- 1 | version: '3.2' 2 | services: 3 | app: 4 | build: 5 | context: . 6 | dockerfile: Dockerfile-dev 7 | ports: 8 | - "3000:3000" 9 | expose: 10 | - 3000 11 | volumes: 12 | - .:/opt/stackstorm/static/webui/st2web 13 | - ./config.local.js:/opt/stackstorm/static/webui/st2web/config.js 14 | - /opt/stackstorm/static/webui/st2web/node_modules 15 | -------------------------------------------------------------------------------- /docker-compose.nginx-dev.yml: -------------------------------------------------------------------------------- 1 | version: '3.2' 2 | services: 3 | app: 4 | build: 5 | context: . 6 | dockerfile: Dockerfile-nginx-dev 7 | ports: 8 | - "3000:80" 9 | expose: 10 | - 3000 11 | volumes: 12 | - .:/opt/stackstorm/static/webui/st2web 13 | - ./config.local.js:/opt/stackstorm/static/webui/st2web/config.js 14 | - ./nginx.local-dev.conf:/etc/nginx/conf.d/st2.conf 15 | - /opt/stackstorm/static/webui/st2web/node_modules 16 | -------------------------------------------------------------------------------- /docker-compose.nginx.yml: -------------------------------------------------------------------------------- 1 | version: '3.2' 2 | services: 3 | app: 4 | build: 5 | context: . 6 | dockerfile: Dockerfile-nginx 7 | ports: 8 | - "3000:80" 9 | expose: 10 | - 3000 11 | volumes: 12 | # - .:/opt/stackstorm/static/webui/st2web 13 | - ./build:/opt/stackstorm/static/webui 14 | - ./config.local.js:/opt/stackstorm/static/webui/config.js 15 | - ./nginx.local.conf:/etc/nginx/conf.d/st2.conf 16 | - /opt/stackstorm/static/webui/st2web/node_modules 17 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.2' 2 | services: 3 | app: 4 | build: . 5 | ports: 6 | - "3000:3000" 7 | expose: 8 | - 3000 9 | volumes: 10 | # - .:/opt/stackstorm/static/webui/st2web 11 | - type: bind 12 | source: . 13 | target: /opt/stackstorm/static/webui/st2web 14 | consistency: consistent 15 | - ./config.local.js:/opt/stackstorm/static/webui/st2web/config.js 16 | - /opt/stackstorm/static/webui/st2web/node_modules 17 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/favicon.ico -------------------------------------------------------------------------------- /font/DroidSansMono.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/DroidSansMono.eot -------------------------------------------------------------------------------- /font/DroidSansMono.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/DroidSansMono.ttf -------------------------------------------------------------------------------- /font/DroidSansMono.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/DroidSansMono.woff -------------------------------------------------------------------------------- /font/Roboto-300.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/Roboto-300.eot -------------------------------------------------------------------------------- /font/Roboto-300.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/Roboto-300.ttf -------------------------------------------------------------------------------- /font/Roboto-300.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/Roboto-300.woff -------------------------------------------------------------------------------- /font/Roboto-300.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/Roboto-300.woff2 -------------------------------------------------------------------------------- /font/Roboto-500.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/Roboto-500.eot -------------------------------------------------------------------------------- /font/Roboto-500.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/Roboto-500.ttf -------------------------------------------------------------------------------- /font/Roboto-500.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/Roboto-500.woff -------------------------------------------------------------------------------- /font/Roboto-500.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/Roboto-500.woff2 -------------------------------------------------------------------------------- /font/Roboto-700.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/Roboto-700.eot -------------------------------------------------------------------------------- /font/Roboto-700.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/Roboto-700.ttf -------------------------------------------------------------------------------- /font/Roboto-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/Roboto-700.woff -------------------------------------------------------------------------------- /font/Roboto-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/Roboto-700.woff2 -------------------------------------------------------------------------------- /font/Roboto-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/Roboto-regular.eot -------------------------------------------------------------------------------- /font/Roboto-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/Roboto-regular.ttf -------------------------------------------------------------------------------- /font/Roboto-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/Roboto-regular.woff -------------------------------------------------------------------------------- /font/Roboto-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/Roboto-regular.woff2 -------------------------------------------------------------------------------- /font/brocadeicons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/brocadeicons.eot -------------------------------------------------------------------------------- /font/brocadeicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/brocadeicons.ttf -------------------------------------------------------------------------------- /font/brocadeicons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/brocadeicons.woff -------------------------------------------------------------------------------- /font/st2-allicons-110818.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/st2-allicons-110818.png -------------------------------------------------------------------------------- /font/st2-iconfont-README.txt: -------------------------------------------------------------------------------- 1 | st2 i160 – Create icons and compile icon set 2 | 3 | - Creates icon set `st2` in Fontello including all icons (fron Adri) 4 | - Selects only the icons asked for and mentioned in issue 160 5 | - Includes `st2-config.json` file in the main `fonts` folder 6 | 1. Includes screenshot of the entire icon set `st2-allicons-110818.png` 7 | 2. To add or update icons, got to Fontello.com and drag the `st2-config.json` file into the browser window 8 | 3. Choose the icons you want to add to the set (click the icon to highlight) 9 | 4. You may need to check and update the unicode under the "Customize Codes" – if the icon exists in the application already, check for CSS references to `content: "\e(that code)"` and update the "Customize Codes" in Fontello to be the same reference 10 | 5. In Fontello, click the "Download webfont" button 11 | 6. Open the downloaded ZIP file 12 | 7. Rename `config.json` to `st2-config.json` 13 | 8. Copy the renamed `st2-config.json` file and the fonts in the `font` folder into the top level `font` folder in the application 14 | 9. In the "css" folder, open the file `st2.css` 15 | 10. Copy all of the icon declaration lines (e.g. ".icon-plus:before { content: '\e915'; }..." to the bottom) 16 | 11. In in `st2flow/modules/st2-style/font/` in the `st2.css' file, replace the declarations with the ones you just copied -------------------------------------------------------------------------------- /font/st2.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/st2.eot -------------------------------------------------------------------------------- /font/st2.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/st2.ttf -------------------------------------------------------------------------------- /font/st2.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/st2.woff -------------------------------------------------------------------------------- /font/st2.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/st2.woff2 -------------------------------------------------------------------------------- /font/ststanley.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/ststanley.eot -------------------------------------------------------------------------------- /font/ststanley.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/ststanley.ttf -------------------------------------------------------------------------------- /font/ststanley.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/font/ststanley.woff -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 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 | /* jshint node: true */ 17 | 'use strict'; 18 | require('@stackstorm/st2-build'); 19 | -------------------------------------------------------------------------------- /img/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/img/icon.png -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "lerna": "2.5.1", 3 | "version": "2.4.3", 4 | "npmClient": "yarn", 5 | "useWorkspaces": true, 6 | "packages": [ 7 | "apps/*", 8 | "modules/*", 9 | "tasks", 10 | "." 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /modules/st2-action-reporter/reporters/debug.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import React from 'react'; 16 | 17 | import Highlight from '@stackstorm/module-highlight'; 18 | 19 | export default function debug(execution) { 20 | return ( 21 | 22 | ); 23 | } 24 | -------------------------------------------------------------------------------- /modules/st2-action-reporter/reporters/index.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import debug from './debug'; 16 | import runLocal from './run-local'; 17 | import runRemote from './run-remote'; 18 | import runPython from './run-python'; 19 | import http from './http'; 20 | 21 | export default { 22 | 'debug': debug, 23 | 'run-local': runLocal, 24 | 'local-shell-cmd': runLocal, 25 | 'run-remote': runRemote, 26 | 'remote-shell-cmd': runRemote, 27 | 'run-local-script': runLocal, 28 | 'local-shell-script': runLocal, 29 | 'run-remote-script': runRemote, 30 | 'remote-shell-script': runRemote, 31 | 'run-python': runPython, 32 | 'python-shell': runPython, 33 | 'python-script': runPython, 34 | 'http-runner': http, 35 | 'http-request': http, 36 | 'noop': debug, 37 | 'cloudslang': runLocal, 38 | }; 39 | -------------------------------------------------------------------------------- /modules/st2-action-reporter/style.css: -------------------------------------------------------------------------------- 1 | @import "@stackstorm/st2-style/colors.css"; 2 | 3 | .component { 4 | position: relative; 5 | } 6 | 7 | .hostname { 8 | font-size: 15px; 9 | 10 | margin: 5px 0; 11 | } 12 | 13 | .source { 14 | font-size: 13px; 15 | 16 | position: absolute; 17 | right: 0; 18 | 19 | display: inline-block; 20 | 21 | padding: 3px 5px; 22 | 23 | text-transform: lowercase; 24 | 25 | color: var(--grey-base); 26 | } 27 | 28 | .source + .highlight { 29 | margin-bottom: 5px; 30 | } 31 | -------------------------------------------------------------------------------- /modules/st2-action-reporter/tests/test-reporters-debug.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import { ReactTester } from '@stackstorm/module-test-utils'; 18 | 19 | import '@stackstorm/module-test-utils/bootstrap/storage'; 20 | import reporter from '../reporters/debug'; 21 | 22 | describe(`ActionReporter: ${reporter.name}`, () => { 23 | it('works with empty object', () => { 24 | const instance = ReactTester.create( 25 | reporter({}) 26 | ); 27 | 28 | expect(instance.node).to.equal(undefined); 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /modules/st2-action-reporter/tests/test-reporters-http.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import { ReactTester } from '@stackstorm/module-test-utils'; 18 | 19 | import '@stackstorm/module-test-utils/bootstrap/storage'; 20 | import reporter from '../reporters/http'; 21 | 22 | describe(`ActionReporter: ${reporter.name}`, () => { 23 | it('works with empty object', () => { 24 | const instance = ReactTester.create( 25 | reporter({}) 26 | ); 27 | 28 | expect(instance.node).to.equal(undefined); 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /modules/st2-action-reporter/tests/test-reporters-run-local.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import { ReactTester } from '@stackstorm/module-test-utils'; 18 | 19 | import '@stackstorm/module-test-utils/bootstrap/storage'; 20 | import reporter from '../reporters/run-local'; 21 | 22 | describe(`ActionReporter: ${reporter.name}`, () => { 23 | it('works with empty object', () => { 24 | const instance = ReactTester.create( 25 | reporter({}) 26 | ); 27 | 28 | expect(instance.node.children.length).to.equal(1); 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /modules/st2-action-reporter/tests/test-reporters-run-python.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import { ReactTester } from '@stackstorm/module-test-utils'; 18 | 19 | import '@stackstorm/module-test-utils/bootstrap/storage'; 20 | import reporter from '../reporters/run-python'; 21 | 22 | describe(`ActionReporter: ${reporter.name}`, () => { 23 | it('works with empty object', () => { 24 | const instance = ReactTester.create( 25 | reporter({}) 26 | ); 27 | 28 | expect(instance.node.children.length).to.equal(1); 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /modules/st2-action-reporter/tests/test-reporters-run-remote.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import { ReactTester } from '@stackstorm/module-test-utils'; 18 | 19 | import '@stackstorm/module-test-utils/bootstrap/storage'; 20 | import reporter from '../reporters/run-remote'; 21 | 22 | describe(`ActionReporter: ${reporter.name}`, () => { 23 | it('works with empty object', () => { 24 | const instance = ReactTester.create( 25 | reporter({}) 26 | ); 27 | 28 | expect(instance.node.children.length).to.equal(1); 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /modules/st2-api/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@stackstorm/module-api", 3 | "version": "2.4.3", 4 | "description": "", 5 | "main": "api.js", 6 | "directories": { 7 | "test": "tests" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/stackstorm/st2web.git" 15 | }, 16 | "license": "Apache-2.0", 17 | "bugs": { 18 | "url": "https://github.com/stackstorm/st2web/issues" 19 | }, 20 | "homepage": "https://github.com/stackstorm/st2web#readme", 21 | "browserify": { 22 | "transform": [ 23 | "babelify" 24 | ] 25 | }, 26 | "publishConfig": { 27 | "access": "public" 28 | }, 29 | "dependencies": { 30 | "axios": "^0.21.1", 31 | "lodash": "4.17.21", 32 | "moxios": "^0.4.0", 33 | "react": "16.8.6", 34 | "react-dom": "16.8.6" 35 | }, 36 | "devDependencies": { 37 | "@stackstorm/module-test-utils": "2.4.3", 38 | "chai": "^4.2.0" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /modules/st2-auto-form/fields/index.js: -------------------------------------------------------------------------------- 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 ArrayField from './array'; 17 | import BooleanField from './boolean'; 18 | import EnumField from './enum'; 19 | import IntegerField from './integer'; 20 | import NumberField from './number'; 21 | import ObjectField from './object'; 22 | import PasswordField from './password'; 23 | import StringField from './string'; 24 | import SelectField from './select'; 25 | import ColorStringField from './color-string'; 26 | 27 | export { 28 | ArrayField, 29 | BooleanField, 30 | EnumField, 31 | IntegerField, 32 | NumberField, 33 | ObjectField, 34 | PasswordField, 35 | StringField, 36 | SelectField, 37 | ColorStringField, 38 | }; 39 | -------------------------------------------------------------------------------- /modules/st2-auto-form/fields/number.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import validator from 'validator'; 16 | 17 | import { BaseTextField, isJinja, isYaql } from './base'; 18 | 19 | export default class NumberField extends BaseTextField { 20 | static icon = '.5' 21 | 22 | fromStateValue(v) { 23 | if (isJinja(v)) { 24 | return v; 25 | } 26 | 27 | if (isYaql(v)) { 28 | return v; 29 | } 30 | 31 | return v !== '' ? validator.toFloat(v) : void 0; 32 | } 33 | 34 | toStateValue(v) { 35 | if (isJinja(v)) { 36 | return v; 37 | } 38 | 39 | if (isYaql(v)) { 40 | return v; 41 | } 42 | 43 | return v ? v.toString(10) : ''; 44 | } 45 | 46 | validate(v, spec={}) { 47 | const invalid = super.validate(v, spec); 48 | if (invalid !== void 0) { 49 | return invalid; 50 | } 51 | 52 | return v && !validator.isFloat(v) && `'${v}' is not a number`; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /modules/st2-auto-form/fields/password.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { BaseTextField } from './base'; 16 | 17 | export default class PasswordField extends BaseTextField { 18 | static icon = '**' 19 | 20 | fromStateValue(v) { 21 | return v !== '' ? v : void 0; 22 | } 23 | 24 | toStateValue(v) { 25 | return v || ''; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /modules/st2-auto-form/fields/string.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { BaseTextareaField } from './base'; 16 | 17 | export default class StringField extends BaseTextareaField { 18 | static icon = 'T' 19 | 20 | fromStateValue(v) { 21 | return v !== '' ? v : void 0; 22 | } 23 | 24 | toStateValue(v) { 25 | return v || ''; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /modules/st2-auto-form/modules/index.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import ArrayModule from './array'; 16 | import CheckboxModule from './checkbox'; 17 | import ComboboxModule from './combobox'; 18 | import InputModule from './input'; 19 | import ObjectModule from './object'; 20 | import SelectModule from './select'; 21 | import TextFieldModule from './text-field'; 22 | import TextModule from './link'; 23 | 24 | export { 25 | ArrayModule, 26 | CheckboxModule, 27 | ComboboxModule, 28 | InputModule, 29 | ObjectModule, 30 | SelectModule, 31 | TextFieldModule, 32 | TextModule, 33 | }; 34 | -------------------------------------------------------------------------------- /modules/st2-auto-form/modules/link.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import React from 'react'; 16 | import { PropTypes } from 'prop-types'; 17 | import cx from 'classnames'; 18 | 19 | import { 20 | Title, 21 | } from '../wrappers'; 22 | 23 | export default class TextModule extends React.Component { 24 | static propTypes = { 25 | className: PropTypes.string, 26 | name: PropTypes.string, 27 | spec: PropTypes.object, 28 | data: PropTypes.string, 29 | href: PropTypes.string, 30 | } 31 | 32 | render() { 33 | const { className = '', name, spec, data, href } = this.props; 34 | 35 | return ( 36 |
37 | 38 | 39 | <div className="st2-auto-form__value"> 40 | <a className="st2-auto-form__link" href={href}> 41 | { data } 42 | </a> 43 | </div> 44 | </div> 45 | ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /modules/st2-criteria/style.css: -------------------------------------------------------------------------------- 1 | @import "@stackstorm/st2-style/colors.css"; 2 | 3 | .component { 4 | } 5 | 6 | .line { 7 | /* Combobox suggestion box takes all the space of the next prlatively positioned element. */ 8 | /* In this case we want it to be as wide as the whole criteria. */ 9 | position: relative; 10 | 11 | display: flex; 12 | 13 | word-spacing: 3px; 14 | 15 | flex-wrap: wrap; 16 | 17 | &:after { 18 | display: block; 19 | 20 | width: 100%; 21 | margin-top: -10px; /* TODO: find a better way */ 22 | 23 | content: "and"; 24 | text-align: center; 25 | } 26 | 27 | &:last-child { 28 | margin-bottom: -12px; 29 | 30 | &:after { 31 | content: ""; 32 | } 33 | } 34 | } 35 | 36 | .entity { 37 | display: block; 38 | flex: 1; 39 | 40 | margin-right: 4px; 41 | 42 | vertical-align: top; 43 | } 44 | 45 | .remove { 46 | margin-bottom: 10px; 47 | 48 | cursor: pointer; 49 | 50 | align-self: center; 51 | 52 | &:hover { 53 | color: var(--aqua-base); 54 | } 55 | } 56 | 57 | .buttons { 58 | margin-top: 20px; 59 | } 60 | 61 | .flat .entity { 62 | display: inline-block; 63 | 64 | flex: initial; 65 | } 66 | 67 | .break { 68 | flex-basis: 100%; 69 | height: 0; 70 | } 71 | 72 | .criteriaLabel { 73 | position: relative; 74 | 75 | i { 76 | position: absolute; 77 | top: 2px; 78 | left: -25px; 79 | } 80 | } 81 | 82 | .subPatternRemove { 83 | margin-top: 20px; 84 | margin-left: 5px; 85 | } -------------------------------------------------------------------------------- /modules/st2-criteria/tests/test-criteria.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import Criteria from '..'; 21 | 22 | describe(`${Criteria.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <Criteria 27 | className="foobar" 28 | onChange={() => {}} 29 | /> 30 | ); 31 | 32 | expect(instance.node.classList).to.contain('foobar'); 33 | }); 34 | 35 | it('proxies extra props', () => { 36 | const instance = ReactTester.create( 37 | <Criteria 38 | foo="bar" 39 | onChange={() => {}} 40 | /> 41 | ); 42 | 43 | expect(instance.node.props.foo).to.equal('bar'); 44 | }); 45 | }); 46 | }); 47 | -------------------------------------------------------------------------------- /modules/st2-filter-expandable/filter-expandable.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import _ from 'lodash'; 16 | 17 | export default function (record) { 18 | const runnerWithChilds = [ 'workflow', 'action-chain', 'mistral-v1', 'mistral-v2', 'orquesta' ]; 19 | return _.includes(runnerWithChilds, record.action.runner_type); 20 | } 21 | -------------------------------------------------------------------------------- /modules/st2-filter-expandable/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@stackstorm/module-filter-expandable", 3 | "version": "2.4.3", 4 | "description": "", 5 | "main": "filter-expandable.js", 6 | "directories": { 7 | "test": "tests" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/stackstorm/st2web.git" 15 | }, 16 | "license": "Apache-2.0", 17 | "bugs": { 18 | "url": "https://github.com/stackstorm/st2web/issues" 19 | }, 20 | "homepage": "https://github.com/stackstorm/st2web#readme", 21 | "browserify": { 22 | "transform": [ 23 | "babelify" 24 | ] 25 | }, 26 | "publishConfig": { 27 | "access": "public" 28 | }, 29 | "dependencies": { 30 | "lodash": "4.17.21" 31 | }, 32 | "devDependencies": { 33 | "@stackstorm/st2-style": "2.4.3", 34 | "chai": "^4.2.0" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /modules/st2-flex-table/tests/test-flex-table-insert.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { FlexTableInsert } from '..'; 21 | 22 | describe(`${FlexTableInsert.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <FlexTableInsert 27 | className="foobar" 28 | code="code" 29 | /> 30 | ); 31 | 32 | expect(instance.node.classList).to.contain('foobar'); 33 | }); 34 | 35 | it('proxies extra props', () => { 36 | const instance = ReactTester.create( 37 | <FlexTableInsert 38 | foo="bar" 39 | code="code" 40 | /> 41 | ); 42 | 43 | expect(instance.node.props.foo).to.equal('bar'); 44 | }); 45 | }); 46 | }); 47 | -------------------------------------------------------------------------------- /modules/st2-flex-table/tests/test-flex-table-row.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { FlexTableRow } from '..'; 21 | 22 | describe(`${FlexTableRow.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <FlexTableRow 27 | className="foobar" 28 | columns={[]} 29 | /> 30 | ); 31 | 32 | expect(instance.node.classList).to.contain('foobar'); 33 | }); 34 | 35 | it('proxies extra props', () => { 36 | const instance = ReactTester.create( 37 | <FlexTableRow 38 | foo="bar" 39 | columns={[]} 40 | /> 41 | ); 42 | 43 | expect(instance.node.props.foo).to.equal('bar'); 44 | }); 45 | }); 46 | }); 47 | -------------------------------------------------------------------------------- /modules/st2-flow-link/style.css: -------------------------------------------------------------------------------- 1 | @import "@stackstorm/st2-style/colors.css"; 2 | 3 | .component { 4 | } 5 | -------------------------------------------------------------------------------- /modules/st2-highlight/editor.css: -------------------------------------------------------------------------------- 1 | @import "prismjs/themes/prism.css"; 2 | 3 | .token.operator, 4 | .token.entity, 5 | .token.url, 6 | .language-css .token.string, 7 | .style .token.string { 8 | background: none; 9 | } 10 | -------------------------------------------------------------------------------- /modules/st2-highlight/style.pcss: -------------------------------------------------------------------------------- 1 | @import "@stackstorm/st2-style/colors.css"; 2 | 3 | .component { 4 | .st2-panel__scroller { 5 | padding: 30px; 6 | } 7 | } 8 | 9 | .welled .well { 10 | min-height: 20px; 11 | padding: 4px; 12 | 13 | color: black; 14 | border-radius: 4px; 15 | background-color: var(--grey-lighten-4); 16 | 17 | pre { 18 | font-family: "Droid Sans Mono", monospace; 19 | font-size: 12px; 20 | 21 | display: block; 22 | overflow: scroll; 23 | 24 | margin: 0; 25 | padding: 15px; 26 | 27 | &::-webkit-scrollbar { 28 | width: 5px; 29 | height: 5px; 30 | 31 | background-color: transparent; 32 | } 33 | 34 | &::-webkit-scrollbar-thumb { 35 | border-radius: 3px; 36 | background-color: rgba(150, 150, 150, .3); 37 | 38 | &:hover { 39 | background-color: rgba(150, 150, 150, .7); 40 | } 41 | } 42 | 43 | &::-webkit-scrollbar-corner { 44 | background-color: transparent; 45 | } 46 | } 47 | 48 | code { 49 | font-family: inherit; 50 | font-size: inherit; 51 | } 52 | } 53 | 54 | .buttons { 55 | position: absolute; 56 | right: 15px; 57 | bottom: 15px; 58 | } 59 | 60 | a.more:any-link { 61 | display: block; 62 | 63 | cursor: pointer; 64 | text-decoration: underline; 65 | 66 | color: #888; 67 | 68 | &:hover { 69 | color: inherit; 70 | } 71 | } 72 | 73 | .buttons.input-active { 74 | background-color: #ff9e1b; 75 | } 76 | -------------------------------------------------------------------------------- /modules/st2-highlight/tests/test-highlight.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import '@stackstorm/module-test-utils/bootstrap/storage'; 21 | import Highlight from '..'; 22 | 23 | describe(`${Highlight.name} Component`, () => { 24 | describe('common functionality', () => { 25 | it('proxies className', () => { 26 | const instance = ReactTester.create( 27 | <Highlight 28 | className="foobar" 29 | code="code" 30 | /> 31 | ); 32 | 33 | expect(instance.node.classList).to.contain('foobar'); 34 | }); 35 | 36 | it('proxies extra props', () => { 37 | const instance = ReactTester.create( 38 | <Highlight 39 | foo="bar" 40 | code="code" 41 | /> 42 | ); 43 | 44 | expect(instance.node.props.foo).to.equal('bar'); 45 | }); 46 | }); 47 | }); 48 | -------------------------------------------------------------------------------- /modules/st2-label/tests/test-label.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import Label from '..'; 21 | 22 | describe(`${Label.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <Label 27 | className="foobar" 28 | status="enabled" 29 | /> 30 | ); 31 | 32 | expect(instance.node.children[0].classList).to.contain('foobar'); 33 | }); 34 | 35 | it('proxies extra props', () => { 36 | const instance = ReactTester.create( 37 | <Label 38 | foo="bar" 39 | status="enabled" 40 | /> 41 | ); 42 | 43 | expect(instance.node.children[0].props.foo).to.equal('bar'); 44 | }); 45 | }); 46 | }); 47 | -------------------------------------------------------------------------------- /modules/st2-notification/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@stackstorm/module-notification", 3 | "version": "2.4.3", 4 | "description": "", 5 | "main": "notification.js", 6 | "directories": { 7 | "test": "tests" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/stackstorm/st2web.git" 15 | }, 16 | "license": "Apache-2.0", 17 | "bugs": { 18 | "url": "https://github.com/stackstorm/st2web/issues" 19 | }, 20 | "homepage": "https://github.com/stackstorm/st2web#readme", 21 | "browserify": { 22 | "transform": [ 23 | "babelify", 24 | [ 25 | "@stackstorm/browserify-postcss", 26 | { 27 | "extensions": [ 28 | ".css" 29 | ], 30 | "inject": "insert-css", 31 | "modularize": false, 32 | "plugin": [ 33 | "postcss-import" 34 | ] 35 | } 36 | ] 37 | ] 38 | }, 39 | "publishConfig": { 40 | "access": "public" 41 | }, 42 | "dependencies": { 43 | "@stackstorm/st2-style": "2.4.3", 44 | "@stackstorm/module-router": "^2.4.3", 45 | "react": "16.8.6", 46 | "react-dom": "16.8.6", 47 | "noty": "^3.1.4" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /modules/st2-notification/style.css: -------------------------------------------------------------------------------- 1 | @import 'noty/lib/noty.css'; 2 | -------------------------------------------------------------------------------- /modules/st2-pack-icon/style.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --size: 32px; 3 | --sizesm: 24px; 4 | } 5 | 6 | .component { 7 | position: relative; 8 | 9 | display: inline-block; 10 | 11 | width: var(--size); 12 | height: var(--size); 13 | 14 | vertical-align: middle; 15 | 16 | border: 5px solid #fff; 17 | border-radius: 5px; 18 | background: #fff; 19 | 20 | &:after { 21 | font-family: "brocadeicons"; 22 | font-size: var(--size); 23 | line-height: 1; 24 | 25 | position: absolute; 26 | top: 0; 27 | left: 0; 28 | 29 | width: var(--size); 30 | height: var(--size); 31 | 32 | content: "\e94d"; 33 | text-align: center; 34 | 35 | color: #000; 36 | } 37 | } 38 | 39 | .small { 40 | width: var(--sizesm); 41 | height: var(--sizesm); 42 | 43 | border: 4px solid #fff; 44 | 45 | &:after { 46 | font-size: var(--sizesm); 47 | 48 | top: 0; 49 | 50 | width: var(--sizesm); 51 | height: var(--sizesm); 52 | } 53 | } 54 | 55 | .image { 56 | position: relative; 57 | z-index: 1; 58 | 59 | width: var(--size); 60 | height: var(--size); 61 | 62 | background: #fff; 63 | box-shadow: 0 0 0 3px white; 64 | 65 | &-small { 66 | width: var(--sizesm); 67 | height: var(--sizesm); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /modules/st2-panel/tests/test-content-empty.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { ContentEmpty } from '..'; 21 | 22 | describe(`${ContentEmpty.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <ContentEmpty 27 | className="foobar" 28 | /> 29 | ); 30 | 31 | expect(instance.node.classList).to.contain('foobar'); 32 | }); 33 | 34 | it('proxies extra props', () => { 35 | const instance = ReactTester.create( 36 | <ContentEmpty 37 | foo="bar" 38 | /> 39 | ); 40 | 41 | expect(instance.node.props.foo).to.equal('bar'); 42 | }); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /modules/st2-panel/tests/test-content.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { Content } from '..'; 21 | 22 | describe(`${Content.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <Content 27 | className="foobar" 28 | /> 29 | ); 30 | 31 | expect(instance.node.classList).to.contain('foobar'); 32 | }); 33 | 34 | it('proxies extra props', () => { 35 | const instance = ReactTester.create( 36 | <Content 37 | foo="bar" 38 | /> 39 | ); 40 | 41 | expect(instance.node.props.foo).to.equal('bar'); 42 | }); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /modules/st2-panel/tests/test-details-body.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { DetailsBody } from '..'; 21 | 22 | describe(`${DetailsBody.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <DetailsBody 27 | className="foobar" 28 | /> 29 | ); 30 | 31 | expect(instance.node.classList).to.contain('foobar'); 32 | }); 33 | 34 | it('proxies extra props', () => { 35 | const instance = ReactTester.create( 36 | <DetailsBody 37 | foo="bar" 38 | /> 39 | ); 40 | 41 | expect(instance.node.props.foo).to.equal('bar'); 42 | }); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /modules/st2-panel/tests/test-details-buttons-panel.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { DetailsButtonsPanel } from '..'; 21 | 22 | describe(`${DetailsButtonsPanel.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <DetailsButtonsPanel 27 | className="foobar" 28 | /> 29 | ); 30 | 31 | expect(instance.node.classList).to.contain('foobar'); 32 | }); 33 | 34 | it('proxies extra props', () => { 35 | const instance = ReactTester.create( 36 | <DetailsButtonsPanel 37 | foo="bar" 38 | /> 39 | ); 40 | 41 | expect(instance.node.props.foo).to.equal('bar'); 42 | }); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /modules/st2-panel/tests/test-details-header.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { DetailsHeader } from '..'; 21 | 22 | describe(`${DetailsHeader.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <DetailsHeader 27 | className="foobar" 28 | title="title" 29 | /> 30 | ); 31 | 32 | expect(instance.node.classList).to.contain('foobar'); 33 | }); 34 | 35 | it('proxies extra props', () => { 36 | const instance = ReactTester.create( 37 | <DetailsHeader 38 | foo="bar" 39 | title="title" 40 | /> 41 | ); 42 | 43 | expect(instance.node.props.foo).to.equal('bar'); 44 | }); 45 | }); 46 | }); 47 | -------------------------------------------------------------------------------- /modules/st2-panel/tests/test-details-panel-body.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { DetailsPanelBody } from '..'; 21 | 22 | describe(`${DetailsPanelBody.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <DetailsPanelBody 27 | className="foobar" 28 | /> 29 | ); 30 | 31 | expect(instance.node.classList).to.contain('foobar'); 32 | }); 33 | 34 | it('proxies extra props', () => { 35 | const instance = ReactTester.create( 36 | <DetailsPanelBody 37 | foo="bar" 38 | /> 39 | ); 40 | 41 | expect(instance.node.props.foo).to.equal('bar'); 42 | }); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /modules/st2-panel/tests/test-details-panel-empty.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { DetailsPanelEmpty } from '..'; 21 | 22 | describe(`${DetailsPanelEmpty.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <DetailsPanelEmpty 27 | className="foobar" 28 | /> 29 | ); 30 | 31 | expect(instance.node.classList).to.contain('foobar'); 32 | }); 33 | 34 | it('proxies extra props', () => { 35 | const instance = ReactTester.create( 36 | <DetailsPanelEmpty 37 | foo="bar" 38 | /> 39 | ); 40 | 41 | expect(instance.node.props.foo).to.equal('bar'); 42 | }); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /modules/st2-panel/tests/test-details-panel-heading.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { DetailsPanelHeading } from '..'; 21 | 22 | describe(`${DetailsPanelHeading.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <DetailsPanelHeading 27 | className="foobar" 28 | title="Title" 29 | /> 30 | ); 31 | 32 | expect(instance.node.classList).to.contain('foobar'); 33 | }); 34 | 35 | it('proxies extra props', () => { 36 | const instance = ReactTester.create( 37 | <DetailsPanelHeading 38 | foo="bar" 39 | title="Title" 40 | /> 41 | ); 42 | 43 | expect(instance.node.props.foo).to.equal('bar'); 44 | }); 45 | }); 46 | }); 47 | -------------------------------------------------------------------------------- /modules/st2-panel/tests/test-details-panel.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { DetailsPanel } from '..'; 21 | 22 | describe(`${DetailsPanel.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <DetailsPanel 27 | className="foobar" 28 | /> 29 | ); 30 | 31 | expect(instance.node.classList).to.contain('foobar'); 32 | }); 33 | 34 | it('proxies extra props', () => { 35 | const instance = ReactTester.create( 36 | <DetailsPanel 37 | foo="bar" 38 | /> 39 | ); 40 | 41 | expect(instance.node.props.foo).to.equal('bar'); 42 | }); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /modules/st2-panel/tests/test-details-switch.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { DetailsSwitch } from '..'; 21 | 22 | describe(`${DetailsSwitch.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <DetailsSwitch 27 | className="foobar" 28 | sections={[]} 29 | current="current" 30 | /> 31 | ); 32 | 33 | expect(instance.node.classList).to.contain('foobar'); 34 | }); 35 | 36 | it('proxies extra props', () => { 37 | const instance = ReactTester.create( 38 | <DetailsSwitch 39 | foo="bar" 40 | sections={[]} 41 | current="current" 42 | /> 43 | ); 44 | 45 | expect(instance.node.props.foo).to.equal('bar'); 46 | }); 47 | }); 48 | }); 49 | -------------------------------------------------------------------------------- /modules/st2-panel/tests/test-details-toolbar-separator.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { DetailsToolbarSeparator } from '..'; 21 | 22 | describe(`${DetailsToolbarSeparator.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <DetailsToolbarSeparator 27 | className="foobar" 28 | /> 29 | ); 30 | 31 | expect(instance.node.classList).to.contain('foobar'); 32 | }); 33 | 34 | it('proxies extra props', () => { 35 | const instance = ReactTester.create( 36 | <DetailsToolbarSeparator 37 | foo="bar" 38 | /> 39 | ); 40 | 41 | expect(instance.node.props.foo).to.equal('bar'); 42 | }); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /modules/st2-panel/tests/test-details-toolbar.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { DetailsToolbar } from '..'; 21 | 22 | describe(`${DetailsToolbar.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <DetailsToolbar 27 | className="foobar" 28 | /> 29 | ); 30 | 31 | expect(instance.node.classList).to.contain('foobar'); 32 | }); 33 | 34 | it('proxies extra props', () => { 35 | const instance = ReactTester.create( 36 | <DetailsToolbar 37 | foo="bar" 38 | /> 39 | ); 40 | 41 | expect(instance.node.props.foo).to.equal('bar'); 42 | }); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /modules/st2-panel/tests/test-panel-details.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { PanelDetails } from '..'; 21 | 22 | describe(`${PanelDetails.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <PanelDetails 27 | className="foobar" 28 | /> 29 | ); 30 | 31 | expect(instance.node.classList).to.contain('foobar'); 32 | }); 33 | 34 | it('proxies extra props', () => { 35 | const instance = ReactTester.create( 36 | <PanelDetails 37 | foo="bar" 38 | /> 39 | ); 40 | 41 | expect(instance.node.props.foo).to.equal('bar'); 42 | }); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /modules/st2-panel/tests/test-panel-navigation.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { PanelNavigation } from '..'; 21 | 22 | describe(`${PanelNavigation.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <PanelNavigation 27 | className="foobar" 28 | /> 29 | ); 30 | 31 | expect(instance.node.classList).to.contain('foobar'); 32 | }); 33 | 34 | it('proxies extra props', () => { 35 | const instance = ReactTester.create( 36 | <PanelNavigation 37 | foo="bar" 38 | /> 39 | ); 40 | 41 | expect(instance.node.props.foo).to.equal('bar'); 42 | }); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /modules/st2-panel/tests/test-panel-view.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { PanelView } from '..'; 21 | 22 | describe(`${PanelView.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <PanelView 27 | className="foobar" 28 | /> 29 | ); 30 | 31 | expect(instance.node.classList).to.contain('foobar'); 32 | }); 33 | 34 | it('proxies extra props', () => { 35 | const instance = ReactTester.create( 36 | <PanelView 37 | foo="bar" 38 | /> 39 | ); 40 | 41 | expect(instance.node.props.foo).to.equal('bar'); 42 | }); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /modules/st2-panel/tests/test-panel.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { Panel } from '..'; 21 | 22 | describe(`${Panel.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <Panel 27 | className="foobar" 28 | /> 29 | ); 30 | 31 | expect(instance.node.classList).to.contain('foobar'); 32 | }); 33 | 34 | it('proxies extra props', () => { 35 | const instance = ReactTester.create( 36 | <Panel 37 | foo="bar" 38 | /> 39 | ); 40 | 41 | expect(instance.node.props.foo).to.equal('bar'); 42 | }); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /modules/st2-panel/tests/test-toggle-button.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { ToggleButton } from '..'; 21 | 22 | describe(`${ToggleButton.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <ToggleButton 27 | className="foobar" 28 | /> 29 | ); 30 | 31 | expect(instance.node.classList).to.contain('foobar'); 32 | }); 33 | 34 | it('proxies extra props', () => { 35 | const instance = ReactTester.create( 36 | <ToggleButton 37 | foo="bar" 38 | /> 39 | ); 40 | 41 | expect(instance.node.props.foo).to.equal('bar'); 42 | }); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /modules/st2-panel/tests/test-toolbar-actions.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { ToolbarActions } from '..'; 21 | 22 | describe(`${ToolbarActions.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <ToolbarActions 27 | className="foobar" 28 | /> 29 | ); 30 | 31 | expect(instance.node.classList).to.contain('foobar'); 32 | }); 33 | 34 | it('proxies extra props', () => { 35 | const instance = ReactTester.create( 36 | <ToolbarActions 37 | foo="bar" 38 | /> 39 | ); 40 | 41 | expect(instance.node.props.foo).to.equal('bar'); 42 | }); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /modules/st2-panel/tests/test-toolbar-button.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { ToolbarButton } from '..'; 21 | 22 | describe(`${ToolbarButton.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <ToolbarButton 27 | className="foobar" 28 | /> 29 | ); 30 | 31 | expect(instance.node.classList).to.contain('foobar'); 32 | }); 33 | 34 | it('proxies extra props', () => { 35 | const instance = ReactTester.create( 36 | <ToolbarButton 37 | foo="bar" 38 | /> 39 | ); 40 | 41 | expect(instance.node.props.foo).to.equal('bar'); 42 | }); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /modules/st2-panel/tests/test-toolbar-filters.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { ToolbarFilters } from '..'; 21 | 22 | describe(`${ToolbarFilters.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <ToolbarFilters 27 | className="foobar" 28 | /> 29 | ); 30 | 31 | expect(instance.node.classList).to.contain('foobar'); 32 | }); 33 | 34 | it('proxies extra props', () => { 35 | const instance = ReactTester.create( 36 | <ToolbarFilters 37 | foo="bar" 38 | /> 39 | ); 40 | 41 | expect(instance.node.props.foo).to.equal('bar'); 42 | }); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /modules/st2-panel/tests/test-toolbar-search.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { ToolbarSearch } from '..'; 21 | 22 | describe(`${ToolbarSearch.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <ToolbarSearch 27 | className="foobar" 28 | title="Title" 29 | value="value" 30 | /> 31 | ); 32 | 33 | expect(instance.node.classList).to.contain('foobar'); 34 | }); 35 | 36 | it('proxies extra props', () => { 37 | const instance = ReactTester.create( 38 | <ToolbarSearch 39 | foo="bar" 40 | title="Title" 41 | value="value" 42 | /> 43 | ); 44 | 45 | expect(instance.node.props.foo).to.equal('bar'); 46 | }); 47 | }); 48 | }); 49 | -------------------------------------------------------------------------------- /modules/st2-panel/tests/test-toolbar-title.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { ToolbarTitle } from '..'; 21 | 22 | describe(`${ToolbarTitle.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <ToolbarTitle 27 | className="foobar" 28 | /> 29 | ); 30 | 31 | expect(instance.node.classList).to.contain('foobar'); 32 | }); 33 | 34 | it('proxies extra props', () => { 35 | const instance = ReactTester.create( 36 | <ToolbarTitle 37 | foo="bar" 38 | /> 39 | ); 40 | 41 | expect(instance.node.props.foo).to.equal('bar'); 42 | }); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /modules/st2-panel/tests/test-toolbar-view.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { ToolbarView } from '..'; 21 | 22 | describe(`${ToolbarView.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <ToolbarView 27 | className="foobar" 28 | /> 29 | ); 30 | 31 | expect(instance.node.classList).to.contain('foobar'); 32 | }); 33 | 34 | it('proxies extra props', () => { 35 | const instance = ReactTester.create( 36 | <ToolbarView 37 | foo="bar" 38 | /> 39 | ); 40 | 41 | expect(instance.node.props.foo).to.equal('bar'); 42 | }); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /modules/st2-panel/tests/test-toolbar.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { Toolbar } from '..'; 21 | 22 | describe(`${Toolbar.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <Toolbar 27 | className="foobar" 28 | title="Title" 29 | /> 30 | ); 31 | 32 | expect(instance.node.classList).to.contain('foobar'); 33 | }); 34 | 35 | it('proxies extra props', () => { 36 | const instance = ReactTester.create( 37 | <Toolbar 38 | foo="bar" 39 | title="Title" 40 | /> 41 | ); 42 | 43 | expect(instance.node.props.foo).to.equal('bar'); 44 | }); 45 | }); 46 | }); 47 | -------------------------------------------------------------------------------- /modules/st2-popup/style.css: -------------------------------------------------------------------------------- 1 | @import "@stackstorm/st2-style/colors.css"; 2 | 3 | .component { 4 | font-family: Roboto, sans-serif; 5 | 6 | position: fixed; 7 | z-index: 2; 8 | top: 0; 9 | right: 0; 10 | bottom: 0; 11 | left: 0; 12 | 13 | cursor: pointer; 14 | 15 | background-color: rgba(0, 0, 0, .8); 16 | 17 | .st2-panel__scroller { 18 | padding: 10px 0 10px 10px; 19 | } 20 | 21 | .st2-details__panel { 22 | padding-left: 0; 23 | } 24 | } 25 | 26 | .details { 27 | height: 100%; 28 | margin: 0 auto; 29 | padding: 10px; 30 | padding-right: 0; 31 | 32 | cursor: default; 33 | 34 | background-color: var(--grey-lighten-5); 35 | 36 | width: initial; 37 | } 38 | 39 | .title { 40 | font-size: 24px; 41 | padding: 20px 20px 0; 42 | } 43 | -------------------------------------------------------------------------------- /modules/st2-popup/tests/test-popup-title.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import { PopupTitle } from '..'; 21 | 22 | describe(`${PopupTitle.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <PopupTitle 27 | className="foobar" 28 | /> 29 | ); 30 | 31 | expect(instance.node.classList).to.contain('foobar'); 32 | }); 33 | 34 | it('proxies extra props', () => { 35 | const instance = ReactTester.create( 36 | <PopupTitle 37 | foo="bar" 38 | /> 39 | ); 40 | 41 | expect(instance.node.props.foo).to.equal('bar'); 42 | }); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /modules/st2-popup/tests/test-popup.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import '@stackstorm/module-test-utils/bootstrap/misc'; 21 | import { Popup } from '..'; 22 | 23 | describe(`${Popup.name} Component`, () => { 24 | describe('common functionality', () => { 25 | it('proxies className', () => { 26 | const instance = ReactTester.create( 27 | <Popup 28 | className="foobar" 29 | onCancel={() => {}} 30 | /> 31 | ); 32 | 33 | expect(instance.node.classList).to.contain('foobar'); 34 | }); 35 | 36 | it('proxies extra props', () => { 37 | const instance = ReactTester.create( 38 | <Popup 39 | foo="bar" 40 | onCancel={() => {}} 41 | /> 42 | ); 43 | 44 | expect(instance.node.props.foo).to.equal('bar'); 45 | }); 46 | }); 47 | }); 48 | -------------------------------------------------------------------------------- /modules/st2-portion-bar/style.css: -------------------------------------------------------------------------------- 1 | @import "@stackstorm/st2-style/colors.css"; 2 | 3 | .component { 4 | width: 100%; 5 | } 6 | 7 | .bar { 8 | display: table; 9 | 10 | width: 100%; 11 | margin: 0; 12 | padding: 0; 13 | 14 | list-style: none; 15 | 16 | &-value { 17 | display: table-cell; 18 | 19 | height: 10px; 20 | 21 | &_actions { 22 | background-color: #428bca; 23 | } 24 | 25 | &_aliases { 26 | background-color: var(--green-base); 27 | } 28 | 29 | &_rules { 30 | background-color: #5bc0de; 31 | } 32 | 33 | &_sensors { 34 | background-color: var(--yellow-base); 35 | } 36 | 37 | &_tests { 38 | background-color: var(--red-base); 39 | } 40 | 41 | &_triggers { 42 | background-color: #ffa500; 43 | } 44 | } 45 | } 46 | 47 | .info { 48 | font-size: 12px; 49 | 50 | display: flex; 51 | 52 | margin: 0; 53 | padding: 0; 54 | 55 | list-style: none; 56 | 57 | background-color: #ddddde; 58 | 59 | &-value { 60 | flex: 1; 61 | 62 | padding: 5px; 63 | 64 | text-align: center; 65 | white-space: nowrap; 66 | } 67 | } 68 | 69 | -------------------------------------------------------------------------------- /modules/st2-portion-bar/tests/test-portion-bar.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | 17 | import React from 'react'; 18 | import { ReactTester } from '@stackstorm/module-test-utils'; 19 | 20 | import PortionBar from '..'; 21 | 22 | describe(`${PortionBar.name} Component`, () => { 23 | describe('common functionality', () => { 24 | it('proxies className', () => { 25 | const instance = ReactTester.create( 26 | <PortionBar 27 | className="foobar" 28 | content={{}} 29 | /> 30 | ); 31 | 32 | expect(instance.node.classList).to.contain('foobar'); 33 | }); 34 | 35 | it('proxies extra props', () => { 36 | const instance = ReactTester.create( 37 | <PortionBar 38 | foo="bar" 39 | content={{}} 40 | /> 41 | ); 42 | 43 | expect(instance.node.props.foo).to.equal('bar'); 44 | }); 45 | }); 46 | }); 47 | -------------------------------------------------------------------------------- /modules/st2-proportional/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@stackstorm/module-proportional", 3 | "version": "2.4.3", 4 | "description": "", 5 | "main": "proportional.js", 6 | "directories": { 7 | "test": "tests" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/stackstorm/st2web.git" 15 | }, 16 | "license": "Apache-2.0", 17 | "bugs": { 18 | "url": "https://github.com/stackstorm/st2web/issues" 19 | }, 20 | "homepage": "https://github.com/stackstorm/st2web#readme", 21 | "browserify": { 22 | "transform": [ 23 | "babelify" 24 | ] 25 | }, 26 | "publishConfig": { 27 | "access": "public" 28 | }, 29 | "dependencies": { 30 | "lodash": "4.17.21", 31 | "react": "16.8.6", 32 | "react-dom": "16.8.6" 33 | }, 34 | "devDependencies": { 35 | "@stackstorm/module-test-utils": "^2.4.3", 36 | "chai": "4.2.0", 37 | "sinon": "7.3.2" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /modules/st2-proportional/tests/test-proportional.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | import sinon from 'sinon'; 17 | 18 | import '@stackstorm/module-test-utils/bootstrap/events'; 19 | import proportional from '..'; 20 | 21 | describe('proportional', () => { 22 | let spyAdd; 23 | let spyRemove; 24 | let makeProportional; 25 | before(() => { 26 | spyAdd = sinon.spy(global.window, 'addEventListener'); 27 | spyRemove = sinon.spy(global.window, 'removeEventListener'); 28 | 29 | makeProportional = proportional(); 30 | }); 31 | after(() => { 32 | spyAdd.restore(); 33 | spyRemove.restore(); 34 | }); 35 | 36 | it('adds and removes event listeners', () => { 37 | makeProportional({}); 38 | expect(spyAdd.callCount).to.equal(1); 39 | expect(spyRemove.callCount).to.equal(0); 40 | 41 | makeProportional(null); 42 | expect(spyAdd.callCount).to.equal(1); 43 | expect(spyRemove.callCount).to.equal(1); 44 | }); 45 | }); 46 | -------------------------------------------------------------------------------- /modules/st2-remote-form/style.css: -------------------------------------------------------------------------------- 1 | @import "@stackstorm/st2-style/colors.css"; 2 | 3 | .st2-auto-form { 4 | /* TODO: Should it be .st2-remote-form? */ 5 | } 6 | -------------------------------------------------------------------------------- /modules/st2-router/history.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { createHashHistory } from 'history'; 16 | 17 | const history = createHashHistory({}); 18 | 19 | export default history; 20 | -------------------------------------------------------------------------------- /modules/st2-router/index.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | export { default as Router } from './router.component'; 16 | export { default as Route } from './route.component'; 17 | export { default as Link } from './link.component'; 18 | export { default as Redirect } from './redirect.component'; 19 | 20 | import methods from './methods'; 21 | 22 | export default methods; 23 | -------------------------------------------------------------------------------- /modules/st2-router/methods.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import store from '@stackstorm/module-store'; 16 | 17 | export function updateLocation(target, action) { 18 | const { location } = store.getState(); 19 | 20 | return store.dispatch({ 21 | type: 'CHANGE_LOCATION', 22 | action, 23 | location: { ...location, ...target }, 24 | }); 25 | } 26 | 27 | const methods = { 28 | push: (location) => updateLocation(location, 'PUSH'), 29 | replace: (location) => updateLocation(location, 'REPLACE'), 30 | }; 31 | 32 | export default methods; 33 | -------------------------------------------------------------------------------- /modules/st2-router/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@stackstorm/module-router", 3 | "version": "2.4.3", 4 | "description": "", 5 | "main": "index.js", 6 | "directories": { 7 | "test": "tests" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/stackstorm/st2web.git" 15 | }, 16 | "license": "Apache-2.0", 17 | "bugs": { 18 | "url": "https://github.com/stackstorm/st2web/issues" 19 | }, 20 | "homepage": "https://github.com/stackstorm/st2web#readme", 21 | "browserify": { 22 | "transform": [ 23 | "babelify" 24 | ] 25 | }, 26 | "publishConfig": { 27 | "access": "public" 28 | }, 29 | "dependencies": { 30 | "@stackstorm/module-api": "^2.4.3", 31 | "@stackstorm/module-login": "^2.4.3", 32 | "@stackstorm/module-router": "^2.4.3", 33 | "@stackstorm/module-store": "^2.4.3", 34 | "history": "^4.9.0", 35 | "lodash": "4.17.21", 36 | "prop-types": "15.7.2", 37 | "react": "16.8.6", 38 | "react-dom": "16.8.6", 39 | "react-redux": "7.0.2", 40 | "react-router": "^5.0.0", 41 | "react-router-dom": "^5.0.0" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /modules/st2-router/redirect.component.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import React from 'react'; 16 | import { PropTypes } from 'prop-types'; 17 | 18 | import methods from './methods'; 19 | 20 | export default class Redirect extends React.Component { 21 | static propTypes = { 22 | push: PropTypes.bool, 23 | to: PropTypes.oneOfType([ PropTypes.string, PropTypes.object ]).isRequired, 24 | }; 25 | 26 | componentDidMount() { 27 | this.perform(); 28 | } 29 | 30 | componentDidUpdate(prevProps) { 31 | this.perform(); 32 | } 33 | 34 | perform() { 35 | const { push, to } = this.props; 36 | 37 | if (push) { 38 | methods.push({ pathname: to }); 39 | } 40 | else { 41 | methods.replace({ pathname: to }); 42 | } 43 | } 44 | 45 | render() { 46 | return null; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /modules/st2-router/reducer.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | export default function reducer(state = {}, action) { 16 | state = { ...state }; 17 | 18 | switch(action.type) { 19 | case 'CHANGE_LOCATION': 20 | const { pathname, search='', hash='' } = action.location; 21 | state.location = { pathname, search, hash }; 22 | break; 23 | default: 24 | break; 25 | } 26 | 27 | return state; 28 | } 29 | -------------------------------------------------------------------------------- /modules/st2-router/route.component.js: -------------------------------------------------------------------------------- 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 React from 'react'; 17 | import { PropTypes } from 'prop-types'; 18 | import { connect } from 'react-redux'; 19 | import { matchPath } from 'react-router'; 20 | 21 | @connect( 22 | ({ location }) => ({ location }) 23 | ) 24 | export default class Route extends React.Component { 25 | static propTypes = { 26 | location: PropTypes.object, 27 | path: PropTypes.string.isRequired, 28 | render: PropTypes.func.isRequired, 29 | } 30 | 31 | render() { 32 | const { location, path, render } = this.props; 33 | const match = matchPath(location.pathname, { path }); 34 | const props = { match, location }; 35 | 36 | return match ? render(props) : null; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /modules/st2-scroll-into-view/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@stackstorm/module-scroll-into-view", 3 | "version": "2.4.3", 4 | "description": "", 5 | "main": "scroll-into-view.js", 6 | "directories": { 7 | "test": "tests" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/stackstorm/st2web.git" 15 | }, 16 | "license": "Apache-2.0", 17 | "bugs": { 18 | "url": "https://github.com/stackstorm/st2web/issues" 19 | }, 20 | "homepage": "https://github.com/stackstorm/st2web#readme", 21 | "browserify": { 22 | "transform": [ 23 | "babelify" 24 | ] 25 | }, 26 | "publishConfig": { 27 | "access": "public" 28 | }, 29 | "devDependencies": { 30 | "chai": "4.2.0" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /modules/st2-scroll-into-view/scroll-into-view.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | export default function(container, element) { 16 | if (!container || !element) { 17 | return; 18 | } 19 | 20 | const containerOffset = container.getBoundingClientRect(); 21 | const elementOffset = element.getBoundingClientRect(); 22 | const topDiff = elementOffset.top - containerOffset.top; 23 | const bottomDiff = topDiff + elementOffset.height - containerOffset.height; 24 | 25 | if (topDiff < 0) { 26 | container.scrollTop += topDiff; 27 | } 28 | else if (bottomDiff > 0) { 29 | container.scrollTop += bottomDiff; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /modules/st2-select-on-click/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@stackstorm/module-select-on-click", 3 | "version": "2.4.3", 4 | "description": "", 5 | "main": "select-on-click.js", 6 | "directories": { 7 | "test": "tests" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/stackstorm/st2web.git" 15 | }, 16 | "license": "Apache-2.0", 17 | "bugs": { 18 | "url": "https://github.com/stackstorm/st2web/issues" 19 | }, 20 | "homepage": "https://github.com/stackstorm/st2web#readme", 21 | "browserify": { 22 | "transform": [ 23 | "babelify" 24 | ] 25 | }, 26 | "publishConfig": { 27 | "access": "public" 28 | }, 29 | "devDependencies": { 30 | "chai": "4.2.0", 31 | "sinon": "7.3.2" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /modules/st2-select-on-click/select-on-click.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | export default function(element) { 16 | if (!element) { 17 | return; 18 | } 19 | 20 | element.addEventListener('click', () => { 21 | const range = document.createRange(); 22 | range.selectNodeContents(element); 23 | 24 | const sel = window.getSelection(); 25 | sel.removeAllRanges(); 26 | sel.addRange(range); 27 | }, true); 28 | } 29 | -------------------------------------------------------------------------------- /modules/st2-select-on-click/tests/test-select-on-click.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { expect } from 'chai'; 16 | import sinon from 'sinon'; 17 | 18 | import selectOnClick from '..'; 19 | 20 | describe('proportional', () => { 21 | it('adds event listeners', () => { 22 | const addEventListener = sinon.spy(); 23 | selectOnClick({ addEventListener }); 24 | expect(addEventListener.callCount).to.equal(1); 25 | }); 26 | 27 | it('accepts null arguments', () => { 28 | selectOnClick(null); 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /modules/st2-store/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@stackstorm/module-store", 3 | "version": "2.4.3", 4 | "description": "", 5 | "main": "store.js", 6 | "directories": { 7 | "test": "tests" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/stackstorm/st2web.git" 15 | }, 16 | "license": "Apache-2.0", 17 | "bugs": { 18 | "url": "https://github.com/stackstorm/st2web/issues" 19 | }, 20 | "homepage": "https://github.com/stackstorm/st2web#readme", 21 | "browserify": { 22 | "transform": [ 23 | "babelify" 24 | ] 25 | }, 26 | "publishConfig": { 27 | "access": "public" 28 | }, 29 | "dependencies": { 30 | "@stackstorm/module-router": "^2.4.3", 31 | "react": "16.8.6", 32 | "redux": "4.0.1", 33 | "react-dom": "16.8.6" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /modules/st2-style/branding.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StackStorm/st2web/be6b339777778e3f6992e7b6e70648a581ddf195/modules/st2-style/branding.css -------------------------------------------------------------------------------- /modules/st2-style/font/DroidSansMono.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Droid Sans Mono'; 3 | src: url('../font/DroidSansMono.eot?80426639'); 4 | src: url('../font/DroidSansMono.eot?80426639#iefix') format('embedded-opentype'), 5 | url('../font/DroidSansMono.woff?80426639') format('woff'), 6 | url('../font/DroidSansMono.ttf?80426639') format('truetype'), 7 | url('../font/DroidSansMono.svg?80426639#ststanley') format('svg'); 8 | font-weight: normal; 9 | font-style: normal; 10 | } 11 | -------------------------------------------------------------------------------- /modules/st2-style/font/Roboto.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Roboto'; 3 | font-weight: 400; 4 | font-style: normal; 5 | src: url('../font/Roboto-300.eot'); 6 | src: url('../font/Roboto-300.eot?#iefix') format('embedded-opentype'), 7 | local('Roboto'), 8 | local('Roboto-300'), 9 | url('../font/Roboto-300.woff2') format('woff2'), 10 | url('../font/Roboto-300.woff') format('woff'), 11 | url('../font/Roboto-300.ttf') format('truetype'), 12 | url('../font/Roboto-300.svg#Roboto') format('svg'); 13 | } 14 | 15 | @font-face { 16 | font-family: 'Roboto'; 17 | font-weight: 600; 18 | font-style: normal; 19 | src: url('../font/Roboto-500.eot'); 20 | src: url('../font/Roboto-500.eot?#iefix') format('embedded-opentype'), 21 | local('Roboto Medium'), 22 | local('Roboto-500'), 23 | url('../font/Roboto-500.woff2') format('woff2'), 24 | url('../font/Roboto-500.woff') format('woff'), 25 | url('../font/Roboto-500.ttf') format('truetype'), 26 | url('../font/Roboto-500.svg#Roboto') format('svg'); 27 | } 28 | -------------------------------------------------------------------------------- /modules/st2-style/font/ststanley-codes.css: -------------------------------------------------------------------------------- 1 | 2 | .st2-icon__off:before { content: '\e800'; } /* '' */ 3 | .st2-icon__edit:before { content: '\e801'; } /* '' */ 4 | .st2-icon__cancel:before { content: '\e802'; } /* '' */ 5 | .st2-icon__right-open:before { content: '\e803'; } /* '' */ 6 | .st2-icon__down-open:before { content: '\e804'; } /* '' */ 7 | .st2-icon__actions:before { content: '\e805'; } /* '' */ 8 | .st2-icon__reload:before { content: '\e806'; } /* '' */ 9 | .st2-icon__flow-cascade:before { content: '\e807'; } /* '' */ 10 | .st2-icon__rules:before { content: '\e808'; } /* '' */ 11 | .st2-icon__history:before { content: '\e809'; } /* '' */ 12 | .st2-icon__tick:before { content: '\e80a'; } /* '' */ 13 | .st2-icon__cube:before { content: '\e80b'; } /* '' */ 14 | .st2-icon__left-open:before { content: '\e80c'; } /* '' */ 15 | .st2-icon__up-open:before { content: '\e80d'; } /* '' */ 16 | .st2-icon__eye:before { content: '\e80e'; } /* '' */ 17 | .st2-icon__search:before { content: '\e80f'; } /* '' */ 18 | .st2-icon__info-circled:before { content: '\e810'; } /* '' */ 19 | .st2-icon__attention:before { content: '\e811'; } /* '' */ 20 | .st2-icon__cancel-circled:before { content: '\e812'; } /* '' */ 21 | .st2-icon__cogs:before { content: '\e813'; } /* '' */ 22 | .st2-icon__code:before { content: '\e814'; } /* '' */ 23 | .st2-icon__calendar:before { content: '\e815'; } /* '' */ 24 | .st2-icon__user:before { content: '\e816'; } /* '' */ 25 | .st2-icon__bug:before { content: '\e818'; } /* '' */ 26 | .st2-icon__trash-empty:before { content: '\e819'; } /* '' */ 27 | .st2-icon__wrench:before { content: '\e81a'; } /* '' */ 28 | .st2-icon__plus:before { content: '\e81b'; } /* '' */ -------------------------------------------------------------------------------- /modules/st2-style/fonts.css: -------------------------------------------------------------------------------- 1 | 2 | @import "font/st2.css"; 3 | @import "font/DroidSansMono.css"; 4 | @import "font/Roboto.css"; 5 | @import "font/ststanley-embedded.css"; 6 | @import "font/animation.css"; 7 | @import "./colors.css"; 8 | @import "font/brocadeicons.css"; 9 | -------------------------------------------------------------------------------- /modules/st2-style/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@stackstorm/st2-style", 3 | "version": "2.4.3", 4 | "description": "", 5 | "main": "style.js", 6 | "directories": { 7 | "test": "tests" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/stackstorm/st2web.git" 15 | }, 16 | "license": "Apache-2.0", 17 | "bugs": { 18 | "url": "https://github.com/stackstorm/st2web/issues" 19 | }, 20 | "homepage": "https://github.com/stackstorm/st2web#readme", 21 | "browserify": { 22 | "transform": [ 23 | "babelify", 24 | [ 25 | "@stackstorm/browserify-postcss", 26 | { 27 | "extensions": [ 28 | ".css" 29 | ], 30 | "inject": "insert-css", 31 | "modularize": false, 32 | "plugin": [ 33 | "postcss-import", 34 | "postcss-nested", 35 | "postcss-preset-env" 36 | ] 37 | } 38 | ] 39 | ] 40 | }, 41 | "publishConfig": { 42 | "access": "public" 43 | }, 44 | "dependencies": { 45 | }, 46 | "devDependencies": { 47 | "@stackstorm/st2-style": "2.4.3", 48 | "@stackstorm/browserify-postcss": "0.3.4-patch.5", 49 | "normalize.css": "8.0.1", 50 | "babelify": "10.0.0", 51 | "postcss": "8.4.31", 52 | "postcss-import": "12.0.1", 53 | "postcss-nested": "4.1.2", 54 | "postcss-preset-env": "6.6.0" 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /modules/st2-style/style.css: -------------------------------------------------------------------------------- 1 | @import "normalize.css/normalize.css"; 2 | 3 | @import "./branding.css"; 4 | @import "./fonts.css"; 5 | @import "./colors.css"; 6 | 7 | html, 8 | body, 9 | .wrapper { 10 | font-size: 12px; 11 | 12 | display: flex; 13 | overflow: hidden; 14 | flex-direction: column; 15 | 16 | height: 100%; 17 | 18 | background-color: var(--body-bg-color); 19 | } 20 | 21 | main { 22 | position: relative; 23 | 24 | display: flex; 25 | flex: 1; 26 | 27 | font-family: Roboto, sans-serif; 28 | 29 | color: var(--text); 30 | } 31 | 32 | .hljs { 33 | background-color: transparent; 34 | } 35 | 36 | [class^="st2-icon__"]:before, 37 | [class*=" st2-icon__"]:before { 38 | font-size: 120%; 39 | 40 | margin: 0; 41 | } 42 | 43 | a:link, 44 | a:visited, 45 | a:hover, 46 | a:active { 47 | color: #008CEB; 48 | text-decoration: none; 49 | } 50 | -------------------------------------------------------------------------------- /modules/st2-style/style.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import './style.css'; 16 | -------------------------------------------------------------------------------- /modules/st2-test-utils/bootstrap/events.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | global.document = { 16 | ...global.document, 17 | 18 | addEventListener: () => null, 19 | removeEventListener: () => null, 20 | }; 21 | 22 | global.window = { 23 | ...global.window, 24 | 25 | addEventListener: () => null, 26 | removeEventListener: () => null, 27 | }; 28 | -------------------------------------------------------------------------------- /modules/st2-test-utils/bootstrap/location.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | global.window = { 16 | ...global.window, 17 | 18 | location: { 19 | host: 'example.com', 20 | }, 21 | }; 22 | -------------------------------------------------------------------------------- /modules/st2-test-utils/bootstrap/misc.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | global.document = { 16 | ...global.document, 17 | 18 | createElement: () => null, 19 | }; 20 | 21 | global.btoa = (input) => Buffer.from(input).toString('base64'); 22 | global.atob = (input) => Buffer.from(input, 'base64').toString(); 23 | -------------------------------------------------------------------------------- /modules/st2-test-utils/bootstrap/st2constants.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | global.window = { 16 | ...global.window, 17 | 18 | st2constants: { st2Config: {} }, 19 | }; 20 | -------------------------------------------------------------------------------- /modules/st2-test-utils/bootstrap/storage.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | global.localStorage = { 16 | ...global.localStorage, 17 | 18 | getItem: () => null, 19 | setItem: () => null, 20 | removeItem: () => null, 21 | }; 22 | 23 | global.sessionStorage = { 24 | ...global.sessionStorage, 25 | 26 | getItem: () => null, 27 | setItem: () => null, 28 | removeItem: () => null, 29 | }; 30 | -------------------------------------------------------------------------------- /modules/st2-test-utils/bootstrap/title.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | global.document = { 16 | ...global.document, 17 | 18 | _title: 'My App Title', 19 | get title() { 20 | return this._title; 21 | }, 22 | set title(title) { 23 | this._title = title; 24 | }, 25 | }; 26 | -------------------------------------------------------------------------------- /modules/st2-test-utils/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@stackstorm/module-test-utils", 3 | "version": "2.4.3", 4 | "description": "", 5 | "main": "test-utils.js", 6 | "directories": { 7 | "test": "tests" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/stackstorm/st2web.git" 15 | }, 16 | "license": "Apache-2.0", 17 | "bugs": { 18 | "url": "https://github.com/stackstorm/st2web/issues" 19 | }, 20 | "homepage": "https://github.com/stackstorm/st2web#readme", 21 | "browserify": { 22 | "transform": [ 23 | "babelify" 24 | ] 25 | }, 26 | "publishConfig": { 27 | "access": "public" 28 | }, 29 | "dependencies": { 30 | "react": "16.8.6", 31 | "react-test-renderer": "16.8.6" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /modules/st2-time/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@stackstorm/module-time", 3 | "version": "2.4.3", 4 | "description": "", 5 | "main": "time.component.js", 6 | "directories": { 7 | "test": "tests" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/stackstorm/st2web.git" 15 | }, 16 | "license": "Apache-2.0", 17 | "bugs": { 18 | "url": "https://github.com/stackstorm/st2web/issues" 19 | }, 20 | "homepage": "https://github.com/stackstorm/st2web#readme", 21 | "browserify": { 22 | "transform": [ 23 | "babelify" 24 | ] 25 | }, 26 | "publishConfig": { 27 | "access": "public" 28 | }, 29 | "dependencies": { 30 | "react-time": "4.3.0", 31 | "prop-types": "15.7.2", 32 | "react": "16.8.6", 33 | "react-dom": "16.8.6" 34 | }, 35 | "devDependencies": { 36 | "@stackstorm/module-test-utils": "^2.4.3", 37 | "chai": "4.2.0" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /modules/st2-time/time.component.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import React from 'react'; 16 | import { PropTypes } from 'prop-types'; 17 | import TimeComponent from 'react-time'; 18 | 19 | export default class Time extends React.Component { 20 | static propTypes = { 21 | timestamp: PropTypes.string.isRequired, 22 | format: PropTypes.string.isRequired, 23 | utc: PropTypes.bool.isRequired, 24 | } 25 | 26 | static defaultProps = { 27 | format: 'ddd, DD MMM YYYY HH:mm:ss', 28 | utc: false, 29 | } 30 | 31 | render() { 32 | const { timestamp, format, utc, ...props } = this.props; 33 | 34 | let dateFormat = format; 35 | if (utc) { 36 | dateFormat += ' UTC'; 37 | } 38 | 39 | return ( 40 | <TimeComponent 41 | {...props} 42 | value={new Date(timestamp)} 43 | format={dateFormat} 44 | utc={utc} 45 | /> 46 | ); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /modules/st2-title/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@stackstorm/module-title", 3 | "version": "2.4.3", 4 | "description": "", 5 | "main": "title.js", 6 | "directories": { 7 | "test": "tests" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/stackstorm/st2web.git" 15 | }, 16 | "license": "Apache-2.0", 17 | "bugs": { 18 | "url": "https://github.com/stackstorm/st2web/issues" 19 | }, 20 | "homepage": "https://github.com/stackstorm/st2web#readme", 21 | "browserify": { 22 | "transform": [ 23 | "babelify" 24 | ] 25 | }, 26 | "publishConfig": { 27 | "access": "public" 28 | }, 29 | "dependencies": { 30 | "react": "16.8.6", 31 | "react-dom": "16.8.6" 32 | }, 33 | "devDependencies": { 34 | "@stackstorm/module-test-utils": "^2.4.3", 35 | "chai": "4.2.0" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /modules/st2-title/title.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Extreme Networks, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | const TITLE = document.title; 16 | 17 | export default function setTitle(title) { 18 | if (!Array.isArray(title)) { 19 | title = [ title ]; 20 | } 21 | 22 | title = title.filter(v => v); 23 | 24 | document.title = title.length ? `${title.join(' - ')} | ${TITLE}` : TITLE; 25 | } 26 | -------------------------------------------------------------------------------- /modules/st2-value-format/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@stackstorm/module-value-format", 3 | "version": "2.4.3", 4 | "description": "", 5 | "main": "value-format.js", 6 | "directories": { 7 | "test": "tests" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/stackstorm/st2web.git" 15 | }, 16 | "license": "Apache-2.0", 17 | "bugs": { 18 | "url": "https://github.com/stackstorm/st2web/issues" 19 | }, 20 | "homepage": "https://github.com/stackstorm/st2web#readme", 21 | "browserify": { 22 | "transform": [ 23 | "babelify" 24 | ] 25 | }, 26 | "publishConfig": { 27 | "access": "public" 28 | }, 29 | "devDependencies": { 30 | "chai": "4.2.0" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /modules/st2flow-canvas/const.js: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The StackStorm Authors. 2 | // Copyright 2020 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 Vector from './vector'; 17 | 18 | const origin = new Vector(20, 40); 19 | const ORBIT_DISTANCE = 20; 20 | 21 | export { origin, ORBIT_DISTANCE }; 22 | -------------------------------------------------------------------------------- /modules/st2flow-editor/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@stackstorm/st2flow-editor", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "directories": { 7 | "test": "tests" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/stackstorm/st2web.git" 15 | }, 16 | "license": "Apache-2.0", 17 | "bugs": { 18 | "url": "https://github.com/stackstorm/st2web/issues" 19 | }, 20 | "homepage": "https://github.com/stackstorm/st2web#readme", 21 | "browserify": { 22 | "transform": [ 23 | "babelify", 24 | [ 25 | "@stackstorm/browserify-postcss", 26 | { 27 | "extensions": [ 28 | ".css" 29 | ], 30 | "inject": "insert-css", 31 | "modularize": { 32 | "camelCase": true 33 | }, 34 | "plugin": [ 35 | "postcss-import", 36 | "postcss-nested", 37 | "postcss-preset-env" 38 | ] 39 | } 40 | ] 41 | ] 42 | }, 43 | "publishConfig": { 44 | "access": "public" 45 | }, 46 | "dependencies": { 47 | "@stackstorm/st2flow-notifications": "^1.0.0", 48 | "brace": "0.11.1", 49 | "insert-css": "2.0.0" 50 | }, 51 | "devDependencies": { 52 | "@stackstorm/browserify-postcss": "0.3.4-patch.5", 53 | "babelify": "10.0.0", 54 | "classnames": "^2.2.6", 55 | "postcss": "8.4.31", 56 | "postcss-import": "12.0.1", 57 | "postcss-nested": "4.1.2", 58 | "postcss-preset-env": "6.6.0" 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /modules/st2flow-editor/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021 The StackStorm Authors. 3 | Copyright 2020 Extreme Networks, Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | .component { 19 | flex: 1; 20 | position: relative; 21 | border-left: 2px solid #f0f0f0; 22 | } 23 | 24 | .has-error { 25 | border-left-color: var(--red-darken-1) 26 | } 27 | 28 | .notifications { 29 | margin-left: 48px; /* editor gutter width */ 30 | } 31 | 32 | .editor { 33 | width: 100%; 34 | height: 100%; 35 | } 36 | 37 | .active-task { 38 | position: absolute; 39 | z-index: 2; 40 | background-color: var(--yellow-lighten-5); 41 | border-left: 4px solid var(--yellow-base); 42 | } 43 | 44 | .error-line { 45 | position: absolute; 46 | z-index: 2; 47 | background-color: var(--red-lighten-3); 48 | border-left: 4px solid var(--red-darken-1); 49 | } 50 | -------------------------------------------------------------------------------- /modules/st2flow-header/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@stackstorm/st2flow-header", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "directories": { 7 | "test": "tests" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/stackstorm/st2web.git" 15 | }, 16 | "license": "Apache-2.0", 17 | "bugs": { 18 | "url": "https://github.com/stackstorm/st2web/issues" 19 | }, 20 | "homepage": "https://github.com/stackstorm/st2web#readme", 21 | "browserify": { 22 | "transform": [ 23 | "babelify", 24 | [ 25 | "@stackstorm/browserify-postcss", 26 | { 27 | "extensions": [ 28 | ".css" 29 | ], 30 | "inject": "insert-css", 31 | "modularize": { 32 | "camelCase": true 33 | }, 34 | "plugin": [ 35 | "postcss-import", 36 | "postcss-nested", 37 | "postcss-preset-env" 38 | ] 39 | } 40 | ] 41 | ] 42 | }, 43 | "publishConfig": { 44 | "access": "public" 45 | }, 46 | "dependencies": { 47 | "@stackstorm/module-api": "2.0.0", 48 | "insert-css": "2.0.0" 49 | }, 50 | "devDependencies": { 51 | "@stackstorm/browserify-postcss": "0.3.4-patch.5", 52 | "babelify": "10.0.0", 53 | "classnames": "^2.2.6", 54 | "postcss": "8.4.31", 55 | "postcss-import": "12.0.1", 56 | "postcss-nested": "4.1.2", 57 | "postcss-preset-env": "6.6.0" 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /modules/st2flow-model/base-model.js: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The StackStorm Authors. 2 | // Copyright 2020 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 | // @flow 17 | 18 | import BaseClass from './base-class'; 19 | 20 | /** 21 | * The BaseModel class is intended to be extended by the primary models: 22 | * Orquesta, Mistra, ActionChain 23 | * 24 | * This is based on the server model: 25 | * https://github.com/StackStorm/orquesta/tree/master/orquesta/specs 26 | */ 27 | class BaseModel extends BaseClass { 28 | get name() { 29 | return this.get('name'); 30 | } 31 | 32 | get version() { 33 | return this.get('version'); 34 | } 35 | 36 | get description() { 37 | return this.get('description'); 38 | } 39 | 40 | get tags() { 41 | return this.get('tags'); 42 | } 43 | } 44 | 45 | export default BaseModel; 46 | -------------------------------------------------------------------------------- /modules/st2flow-model/index.js: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The StackStorm Authors. 2 | // Copyright 2020 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 OrquestaModel from './model-orquesta'; 17 | import MistralModel from './model-mistral'; 18 | 19 | export { layout } from './layout'; 20 | 21 | const models = {}; 22 | 23 | [ 24 | OrquestaModel, 25 | MistralModel, 26 | ].forEach(M => { 27 | M.runner_types.forEach(type => { 28 | models[type] = M; 29 | }); 30 | }); 31 | 32 | export { models, OrquestaModel, MistralModel }; 33 | -------------------------------------------------------------------------------- /modules/st2flow-model/layout.js: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The StackStorm Authors. 2 | // Copyright 2020 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 | // @flow 17 | 18 | import type { ModelInterface } from './interfaces'; 19 | 20 | export function layout(model: ModelInterface) { 21 | model.tasks.forEach(task => { 22 | const { name } = task; 23 | model.updateTask({ name }, { coords: { x: -1, y: -1 }}); 24 | }); 25 | } 26 | -------------------------------------------------------------------------------- /modules/st2flow-model/model-meta.js: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The StackStorm Authors. 2 | // Copyright 2020 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 | // @flow 17 | 18 | import BaseClass from './base-class'; 19 | import schema from './schemas/metadata.json'; 20 | 21 | class MetaModel extends BaseClass { 22 | constructor(yaml: ?string) { 23 | super(schema, yaml); 24 | } 25 | 26 | static minimum = 'pack: default\nenabled: true\n'; 27 | 28 | get name(): string { 29 | return this.get('name'); 30 | } 31 | 32 | get description(): string { 33 | return this.get('description'); 34 | } 35 | 36 | get enabled(): string { 37 | return this.get('enabled'); 38 | } 39 | 40 | get entry_point(): string { 41 | return this.get('entry_point'); 42 | } 43 | 44 | get pack(): string { 45 | return this.get('pack'); 46 | } 47 | 48 | get runner_type(): string { 49 | return this.get('runner_type'); 50 | } 51 | 52 | get parameters(): Object { 53 | return this.get('parameters'); 54 | } 55 | } 56 | 57 | export default MetaModel; 58 | -------------------------------------------------------------------------------- /modules/st2flow-model/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@stackstorm/st2flow-model", 3 | "version": "1.0.0-pre.5", 4 | "description": "", 5 | "main": "index.js", 6 | "directories": { 7 | "test": "tests" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/stackstorm/st2web.git" 15 | }, 16 | "license": "Apache-2.0", 17 | "bugs": { 18 | "url": "https://github.com/stackstorm/st2web/issues" 19 | }, 20 | "homepage": "https://github.com/stackstorm/st2web#readme", 21 | "browserify": { 22 | "transform": [ 23 | "babelify" 24 | ] 25 | }, 26 | "publishConfig": { 27 | "access": "public" 28 | }, 29 | "dependencies": { 30 | "@stackstorm/st2flow-yaml": "1.0.0-pre.5", 31 | "ajv": "^6.5.4", 32 | "dagre": "0.8.4", 33 | "deep-diff": "^1.0.2", 34 | "eventemitter3": "^3.1.0" 35 | }, 36 | "devDependencies": { 37 | "babelify": "^10.0.0", 38 | "chai-subset": "^1.6.0", 39 | "js-yaml": "^3.12.0" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /modules/st2flow-model/schemas/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "Metadata Schema", 4 | "description": "A schema describing the metadata for individual workflows.", 5 | "type": "object", 6 | "required": [ 7 | "name" 8 | ], 9 | "properties": { 10 | "name": { 11 | "type": "string", 12 | "minLength": 1 13 | }, 14 | "description": { 15 | "type": "string", 16 | "minLength": 1 17 | }, 18 | "enabled": { 19 | "type": "boolean" 20 | }, 21 | "uid": { 22 | "type": "string", 23 | "minLength": 1 24 | }, 25 | "ref": { 26 | "type": "string", 27 | "minLength": 1 28 | }, 29 | "id": { 30 | "type": "string", 31 | "minLength": 1 32 | }, 33 | "entry_point": { 34 | "type": "string", 35 | "minLength": 1 36 | }, 37 | "pack": { 38 | "type": "string", 39 | "minLength": 1 40 | }, 41 | "runner_type": { 42 | "type": "string", 43 | "minLength": 1 44 | }, 45 | "parameters": { 46 | "type": "object", 47 | "patternProperties": { 48 | "^\\w+$": { 49 | "anyOf": [ 50 | {"type": "null"}, 51 | {"type": "array"}, 52 | {"type": "boolean"}, 53 | {"type": "integer"}, 54 | {"type": "number"}, 55 | {"type": "object"}, 56 | {"type": "string"} 57 | ] 58 | } 59 | } 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /modules/st2flow-model/tests/data/actionchain-basic.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | chain: 3 | - 4 | name: "c1" 5 | ref: "core.local" 6 | parameters: 7 | cmd: "echo c1" 8 | on-success: "c2" 9 | on-failure: "c4" 10 | - 11 | name: "c2" 12 | ref: "core.local" 13 | parameters: 14 | cmd: "echo \"c2: parent exec is {{action_context.parent.execution_id}}.\"" 15 | on-success: "c3" 16 | on-failure: "c4" 17 | - 18 | name: "c3" 19 | ref: "core.local" 20 | parameters: 21 | cmd: "echo c3" 22 | on-failure: "c4" 23 | - 24 | name: "c4" 25 | ref: "core.local" 26 | parameters: 27 | cmd: "echo fail c4" 28 | default: "c1" 29 | -------------------------------------------------------------------------------- /modules/st2flow-model/tests/data/mistral-basic.yaml: -------------------------------------------------------------------------------- 1 | version: '2.0' 2 | 3 | examples.mistral-basic: 4 | description: > 5 | A sample workflow that demonstrates how to use conditions 6 | to determine which path in the workflow to take. 7 | type: direct 8 | input: 9 | - which 10 | tasks: 11 | t1: 12 | action: core.local 13 | input: 14 | cmd: "printf <% $.which %>" 15 | publish: 16 | path: <% task(t1).result.stdout %> 17 | on-success: 18 | - a: <% $.path = 'a' %> 19 | - b: <% $.path = 'b' %> 20 | - c: <% not $.path in list(a, b) %> 21 | on-error: 22 | - a 23 | a: 24 | action: core.local 25 | input: 26 | cmd: "echo 'Took path A.'" 27 | publish: 28 | stdout: <% task(a).result.stdout %> 29 | b: 30 | action: core.local 31 | input: 32 | cmd: "echo 'Took path B.'" 33 | publish: 34 | stdout: <% task(b).result.stdout %> 35 | c: 36 | action: core.local 37 | input: 38 | cmd: "echo 'Took path C.'" 39 | publish: 40 | stdout: <% task(c).result.stdout %> 41 | -------------------------------------------------------------------------------- /modules/st2flow-model/tests/data/orquesta-basic.yaml: -------------------------------------------------------------------------------- 1 | version: 1.0 2 | 3 | description: > 4 | A sample workflow that demonstrates how to use conditions 5 | to determine which path in the workflow to take. 6 | 7 | input: 8 | - which 9 | 10 | tasks: 11 | t1: 12 | action: core.local 13 | input: 14 | cmd: printf <% $.which %> 15 | next: 16 | - when: <% succeeded() and result().stdout = 'a' %> 17 | publish: path=<% result().stdout %> 18 | do: 19 | - a 20 | - b 21 | - when: <% succeeded() and result().stdout = 'b' %> 22 | publish: path=<% result().stdout %> 23 | do: b 24 | - when: <% succeeded() and not result().stdout in list(a, b) %> 25 | publish: path=<% result().stdout %> 26 | do: c 27 | a: 28 | action: core.local cmd="echo 'Took path A.'" 29 | b: 30 | action: core.local cmd="echo 'Took path B.'" 31 | next: 32 | - do: 'foobar' 33 | c: 34 | action: core.local cmd="echo 'Took path C.'" 35 | foobar: 36 | action: core.local cmd="echo 'Took path foobar.'" 37 | -------------------------------------------------------------------------------- /modules/st2flow-notifications/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@stackstorm/st2flow-notifications", 3 | "version": "1.0.0", 4 | "description": "A package for displaying notifications and errors in the st2flow UI", 5 | "author": "Ryan Wheale <ryan.wheale@gmail.com>", 6 | "homepage": "https://github.com/stackstorm/st2web#readme", 7 | "license": "Apache-2.0", 8 | "main": "index.js", 9 | "publishConfig": { 10 | "access": "public" 11 | }, 12 | "browserify": { 13 | "transform": [ 14 | "babelify", 15 | [ 16 | "@stackstorm/browserify-postcss", 17 | { 18 | "extensions": [ 19 | ".css" 20 | ], 21 | "inject": "insert-css", 22 | "modularize": { 23 | "camelCase": true 24 | }, 25 | "plugin": [ 26 | "postcss-import", 27 | "postcss-nested", 28 | "postcss-preset-env" 29 | ] 30 | } 31 | ] 32 | ] 33 | }, 34 | "repository": { 35 | "type": "git", 36 | "url": "git+https://github.com/stackstorm/st2web.git" 37 | }, 38 | "scripts": { 39 | "test": "echo \"Error: run tests from root\" && exit 1" 40 | }, 41 | "bugs": { 42 | "url": "https://github.com/stackstorm/st2web/issues" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /modules/st2flow-palette/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@stackstorm/st2flow-palette", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "directories": { 7 | "test": "tests" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/stackstorm/st2web.git" 15 | }, 16 | "license": "Apache-2.0", 17 | "bugs": { 18 | "url": "https://github.com/stackstorm/st2web/issues" 19 | }, 20 | "homepage": "https://github.com/stackstorm/st2web#readme", 21 | "browserify": { 22 | "transform": [ 23 | "babelify", 24 | [ 25 | "@stackstorm/browserify-postcss", 26 | { 27 | "extensions": [ 28 | ".css" 29 | ], 30 | "inject": "insert-css", 31 | "modularize": { 32 | "camelCase": true 33 | }, 34 | "plugin": [ 35 | "postcss-import", 36 | "postcss-nested", 37 | "postcss-preset-env" 38 | ] 39 | } 40 | ] 41 | ] 42 | }, 43 | "publishConfig": { 44 | "access": "public" 45 | }, 46 | "dependencies": { 47 | "insert-css": "2.0.0" 48 | }, 49 | "devDependencies": { 50 | "@stackstorm/browserify-postcss": "0.3.4-patch.5", 51 | "babelify": "10.0.0", 52 | "classnames": "^2.2.6", 53 | "postcss": "8.4.31", 54 | "postcss-import": "12.0.1", 55 | "postcss-nested": "4.1.2", 56 | "postcss-preset-env": "6.6.0" 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /modules/st2flow-perf/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@stackstorm/st2flow-perf", 3 | "version": "1.0.0-pre.5", 4 | "description": "A small performance library using the performance API and some extra smartness", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/stackstorm/st2web.git" 12 | }, 13 | "license": "Apache-2.0", 14 | "bugs": { 15 | "url": "https://github.com/stackstorm/st2web/issues" 16 | }, 17 | "homepage": "https://github.com/stackstorm/st2web#readme", 18 | "browserify": { 19 | "transform": [ 20 | "babelify" 21 | ] 22 | }, 23 | "publishConfig": { 24 | "access": "public" 25 | }, 26 | "devDependencies": { 27 | "babelify": "^10.0.0" 28 | }, 29 | "dependencies": { 30 | "debug": "^4.0.1" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /modules/st2flow-yaml/index.js: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The StackStorm Authors. 2 | // Copyright 2020 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 | // @flow 17 | 18 | import * as util from './util'; 19 | 20 | export { default as TokenSet } from './token-set'; 21 | export { default as crawler } from './crawler'; 22 | export { util }; 23 | export type { TokenMeta, JPath, JpathKey, Range } from './types'; 24 | -------------------------------------------------------------------------------- /modules/st2flow-yaml/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@stackstorm/st2flow-yaml", 3 | "version": "1.0.0-pre.5", 4 | "description": "", 5 | "main": "index.js", 6 | "directories": { 7 | "test": "tests" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/stackstorm/st2web.git" 15 | }, 16 | "license": "Apache-2.0", 17 | "bugs": { 18 | "url": "https://github.com/stackstorm/st2web/issues" 19 | }, 20 | "homepage": "https://github.com/stackstorm/st2web#readme", 21 | "browserify": { 22 | "transform": [ 23 | "babelify" 24 | ] 25 | }, 26 | "publishConfig": { 27 | "access": "public" 28 | }, 29 | "devDependencies": { 30 | "babelify": "^10.0.0" 31 | }, 32 | "dependencies": { 33 | "@stackstorm/st2flow-perf": "1.0.0-pre.5", 34 | "yaml-ast-parser": "0.0.43" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /modules/st2flow-yaml/tests/data/basic-json.yaml: -------------------------------------------------------------------------------- 1 | # this is a valid yaml file 2 | { 3 | emptyArray: [], 4 | emptyObject: {}, 5 | bools: { 6 | true: [true, true, true], 7 | false: [false, false, false] 8 | }, 9 | floats: { 10 | canonical: 685230.15, 11 | exponential: 685230.15, 12 | fixed: 685230.15 13 | }, 14 | ints: { 15 | decimal: 685230, 16 | octal: '0o2472256', 17 | hexadecimal: 685230 18 | }, 19 | nulls: { 20 | empty: null, 21 | canonical: null, 22 | english: null, 23 | sparse: [null, '2nd entry', null, '4th entry', null] 24 | }, 25 | strings: { 26 | simpleString: 'hello world', 27 | simpleStringComma: 'hello, world', 28 | stackTrace: 'Error: foo\n at repl:1:5\n at REPLServer.defaultEval (repl.js:116:27)\n at bound (domain.js:254:14)\n', trailingSpace: 'hello space ', 29 | trailingTab: 'hello tab \t', 30 | trailingCR: 'hello newline\n', 31 | simpleQuotes: 'won''t you be my neighbor\n', 32 | unprintable: 'number 1 is \u0001 and the biggest byte is \uFFFF ok', 33 | multiline: 'hello\nworld\n', 34 | multilineChomp: 'hello\nworld\n', 35 | multilineTrailingCR: 'hello\nworld\n' 36 | }, 37 | timestamps: { 38 | canonical: 2001-12-15T02:59:43.1Z, 39 | 'valid iso8601': 2001-12-14t21:59:43.10-05:00, 40 | 'space separated': 2001-12-14 21:59:43.10 -5, 41 | 'no time zone (Z)': 2001-12-15 2:59:43.10, 42 | 'date (00:00:00Z)': 2002-12-14, 43 | 'not a date': '2002-1-1' 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /modules/st2flow-yaml/tests/data/basic.yaml: -------------------------------------------------------------------------------- 1 | emptyArray: [] 2 | emptyObject: {} 3 | 4 | bools: 5 | true: 6 | - true 7 | - True 8 | - TRUE 9 | false: 10 | - false 11 | - False 12 | - FALSE 13 | 14 | floats: 15 | canonical: 6.8523015e+5 16 | exponential: 685.23015e+03 17 | fixed: 685230.15 18 | 19 | ints: 20 | decimal: 685230 21 | octal: 0o2472256 22 | hexadecimal: 0x0A74AE 23 | 24 | nulls: 25 | empty: 26 | canonical: ~ 27 | english: null 28 | sparse: 29 | - ~ 30 | - 2nd entry 31 | - 32 | - 4th entry 33 | - Null 34 | 35 | strings: 36 | simpleString: hello world 37 | simpleStringComma: 'hello, world' 38 | stackTrace: | 39 | Error: foo 40 | at repl:1:5 41 | at REPLServer.defaultEval (repl.js:116:27) 42 | at bound (domain.js:254:14) 43 | 44 | trailingSpace: 'hello space ' 45 | trailingTab: "hello tab \t" 46 | trailingCR: | 47 | hello newline 48 | simpleQuotes: | 49 | won't you be my neighbor 50 | unprintable: "number 1 is \x01 and the biggest byte is \uFFFF ok" 51 | multiline: | 52 | hello 53 | world 54 | multilineChomp: | 55 | hello 56 | world 57 | multilineTrailingCR: | 58 | hello 59 | world 60 | 61 | timestamps: 62 | canonical: 2001-12-15T02:59:43.1Z 63 | valid iso8601: 2001-12-14t21:59:43.10-05:00 64 | space separated: 2001-12-14 21:59:43.10 -5 65 | no time zone (Z): 2001-12-15 2:59:43.10 66 | date (00:00:00Z): 2002-12-14 67 | not a date: 2002-1-1 68 | -------------------------------------------------------------------------------- /modules/st2flow-yaml/tests/data/simple-json.yaml: -------------------------------------------------------------------------------- 1 | # this is valid yaml 2 | { 3 | bools: { 4 | trues: [true, true, true] 5 | }, 6 | strings: { 7 | string: 'string with spaces', 8 | longstring1: 'a long string with an ignored newline\n', 9 | longstring2: 'a long string with a maintained\nnewline\n' 10 | }, 11 | lists: [{ 12 | foo: 'bar', 13 | bar: ['foo', 'bar'] 14 | }] 15 | } 16 | -------------------------------------------------------------------------------- /modules/st2flow-yaml/tests/data/simple.yaml: -------------------------------------------------------------------------------- 1 | bools: 2 | trues: 3 | - true 4 | - True 5 | - TRUE 6 | 7 | strings: 8 | string: string with spaces 9 | longstring1: > 10 | a long string with an ignored 11 | newline 12 | longstring2: | 13 | a long string with a maintained 14 | newline 15 | 16 | lists: 17 | - foo: bar 18 | bar: 19 | - foo 20 | - bar 21 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "config:base", 4 | ":pinVersions" 5 | ], 6 | "pathRules": [ 7 | { 8 | "paths": ["modules/*/package.json", "apps/*/packages.json"], 9 | "extends": [":pinOnlyDevDependencies"] 10 | } 11 | ], 12 | "supportPolicy": ["lts_latest"] 13 | } 14 | -------------------------------------------------------------------------------- /rpm/st2web.spec: -------------------------------------------------------------------------------- 1 | %define pkg_version %(node -e "console.log(require('./package.json').st2_version);") 2 | %define version %(echo "${PKG_VERSION:-%{pkg_version}}") 3 | %define release %(echo "${PKG_RELEASE:-1}") 4 | #define epoch %(_epoch=`echo %{version} | grep -q dev || echo 1`; echo "${_epoch:-0}") 5 | 6 | Name: st2web 7 | Version: %{version} 8 | %if 0%{?epoch} 9 | Epoch: %{epoch} 10 | %endif 11 | Release: %{release} 12 | Summary: St2Web - StackStorm Web UI 13 | 14 | License: Apache 2.0 15 | URL: https://github.com/stackstorm/st2web 16 | Source0: st2web 17 | 18 | Prefix: /opt/stackstorm/static/webui 19 | 20 | %define _builddir %(pwd) 21 | %define _rpmdir %(pwd)/.. 22 | %define _build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm 23 | 24 | 25 | %description 26 | React-based HTML5 real-time Web UI interface for StackStorm open-source automation platform. 27 | Allows to control the whole process of execution, from running an action to seeing the results of the execution. 28 | It also helps to explore workflow executions up to the results of individual tasks. 29 | 30 | %prep 31 | rm -rf %{buildroot} 32 | mkdir -p %{buildroot} 33 | 34 | %build 35 | make 36 | 37 | %install 38 | %make_install 39 | 40 | %clean 41 | rm -rf %{buildroot} 42 | 43 | %files 44 | /* 45 | -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | @import "node_modules/@stackstorm/st2-style/style.css"; 2 | 3 | html, body, .wrapper { 4 | font-size: 13px; 5 | font-family: "Roboto", Arial, sans-serif; 6 | display: flex; 7 | overflow: hidden; 8 | flex-direction: column; 9 | height: 100%; 10 | background-color: #fff; 11 | background-color: var(--body-bg-color); 12 | } 13 | /*Workflow tab zoom icon Css*/ 14 | .icon-zoom_out:before { 15 | font-family: 'st2'; 16 | content: "\eb45" !important; 17 | 18 | } 19 | .icon-zoom_in:before { 20 | font-family: 'st2'; 21 | content: "\eb43" !important; 22 | 23 | } 24 | .icon-zoom_reset:before { 25 | font-family: 'st2'; 26 | content: '\ee65'; 27 | 28 | } 29 | .palette-chevron-icon:before { 30 | font-size: 10px; 31 | padding: 0 5px; 32 | line-height: 42px; 33 | display: block; 34 | } 35 | .icon-plus-class i{ 36 | display: none !important; 37 | } 38 | .gearclass{ 39 | margin-left: -10px; 40 | } 41 | -------------------------------------------------------------------------------- /tasks/build.js: -------------------------------------------------------------------------------- 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 | 'use strict'; 17 | 18 | const gulp = require('gulp'); 19 | 20 | gulp.task('build', gulp.series([ 'lint', 'browserify' ])); 21 | -------------------------------------------------------------------------------- /tasks/default.js: -------------------------------------------------------------------------------- 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 | 'use strict'; 17 | 18 | const gulp = require('gulp'); 19 | 20 | gulp.task('default', gulp.series([ 'lint', 'watch', 'serve' ])); 21 | -------------------------------------------------------------------------------- /tasks/font.js: -------------------------------------------------------------------------------- 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 | 'use strict'; 17 | 18 | const gulp = require('gulp'); 19 | const fontelloUpdate = require('fontello-update'); 20 | 21 | gulp.task('font', () => fontelloUpdate({ 22 | config: 'fontello.json', 23 | fonts: 'font', 24 | css: 'font', 25 | })); 26 | -------------------------------------------------------------------------------- /tasks/index.js: -------------------------------------------------------------------------------- 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 | 'use strict'; 17 | 18 | // original 19 | const gulp = require('gulp'); 20 | const fwdRef = require('undertaker-forward-reference'); 21 | 22 | gulp.registry(fwdRef()); 23 | 24 | const requireDir = require('require-dir'); 25 | module.exports = requireDir('./', { recurse: true }); 26 | -------------------------------------------------------------------------------- /tasks/lint.js: -------------------------------------------------------------------------------- 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 | 'use strict'; 17 | 18 | const gulp = require('gulp'); 19 | const settings = require('./settings.json'); 20 | const plugins = require('gulp-load-plugins')(settings.plugins); 21 | 22 | gulp.task('lint', (done) => gulp.src(settings.lint, { cwd: settings.dev }) 23 | .pipe(plugins.plumber()) 24 | .pipe(plugins.eslint({ fix: true })) 25 | .pipe(plugins.eslint.format()) 26 | .pipe(plugins.eslint.failAfterError()) 27 | .on('end', () => done()) 28 | .on('error', (err) => done(err)) 29 | ); 30 | -------------------------------------------------------------------------------- /tasks/production/environment.js: -------------------------------------------------------------------------------- 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 | 'use strict'; 17 | 18 | const gulp = require('gulp'); 19 | 20 | gulp.task('production-environment', (done) => { 21 | process.env.NODE_ENV = 'production'; 22 | done(); 23 | }); 24 | -------------------------------------------------------------------------------- /tasks/production/index.js: -------------------------------------------------------------------------------- 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 | 'use strict'; 17 | 18 | // original 19 | const gulp = require('gulp'); 20 | const requireDir = require('require-dir'); 21 | 22 | module.exports = requireDir('./', { recurse: true }); 23 | 24 | gulp.task('production', gulp.series([ 25 | 'production-environment', 26 | 'production-scripts', 27 | 'production-styles', 28 | 'production-static', 29 | 'production-package-metadata', 30 | ])); 31 | -------------------------------------------------------------------------------- /tasks/production/scripts.js: -------------------------------------------------------------------------------- 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 | 'use strict'; 17 | 18 | const gulp = require('gulp'); 19 | const settings = require('../settings.json'); 20 | const plugins = require('gulp-load-plugins')(settings.plugins); 21 | const uglify = require('gulp-uglify-es').default; 22 | 23 | gulp.task('production-scripts', gulp.series([ 'browserify' ], () => 24 | gulp.src(settings.production.scripts, { base: '.' }) 25 | .pipe(uglify({ 26 | mangle: false, 27 | compress: { 28 | keep_fnames: true, 29 | }, 30 | })) 31 | .pipe(gulp.dest(settings.production.dest)) 32 | .pipe(plugins.size({ 33 | showFiles: true, 34 | })) 35 | .pipe(plugins.size({ 36 | showFiles: true, 37 | gzip: true, 38 | })) 39 | )); 40 | -------------------------------------------------------------------------------- /tasks/production/serve.js: -------------------------------------------------------------------------------- 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 | 'use strict'; 17 | 18 | const gulp = require('gulp'); 19 | const settings = require('../settings.json'); 20 | const plugins = require('gulp-load-plugins')(settings.plugins); 21 | 22 | let server; 23 | 24 | gulp.task('serve-production', gulp.series([ 'production' ], () => { 25 | server = gulp.src('./build') 26 | .pipe(plugins.webserver({ 27 | host: '0.0.0.0', 28 | port: 3000, 29 | })); 30 | 31 | return server; 32 | })); 33 | -------------------------------------------------------------------------------- /tasks/production/static.js: -------------------------------------------------------------------------------- 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 | 'use strict'; 17 | 18 | const gulp = require('gulp'); 19 | const settings = require('../settings.json'); 20 | 21 | gulp.task('production-static', () => 22 | gulp.src(settings.production.static, { base: '.' }) 23 | .pipe(gulp.dest(settings.production.dest)) 24 | ); 25 | -------------------------------------------------------------------------------- /tasks/production/styles.js: -------------------------------------------------------------------------------- 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 | 'use strict'; 17 | 18 | const gulp = require('gulp'); 19 | const settings = require('../settings.json'); 20 | const plugins = require('gulp-load-plugins')(settings.plugins); 21 | 22 | gulp.task('production-styles', () => 23 | gulp.src(settings.production.styles, { base: '.' }) 24 | .pipe(gulp.dest(settings.production.dest)) 25 | .pipe(plugins.size({ 26 | showFiles: true, 27 | })) 28 | .pipe(plugins.size({ 29 | showFiles: true, 30 | gzip: true, 31 | })) 32 | ); 33 | -------------------------------------------------------------------------------- /tasks/production/test.js: -------------------------------------------------------------------------------- 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 | 'use strict'; 17 | 18 | const gulp = require('gulp'); 19 | const settings = require('../settings.json'); 20 | const plugins = require('gulp-load-plugins')(settings.plugins); 21 | 22 | const argv = require('yargs').argv; 23 | 24 | gulp.task('test-production', gulp.series([ 'production' ], (done) => { 25 | const server = gulp.src('.') 26 | .pipe(plugins.webserver({ 27 | host: '0.0.0.0', 28 | port: 3002, 29 | })); 30 | 31 | plugins.env({ 32 | vars: { 33 | PORT: 3002, 34 | }, 35 | }); 36 | 37 | return gulp.src(argv['test-files'] || settings.production.tests, { read: false }) 38 | .pipe(plugins.plumber()) 39 | .pipe(plugins.mocha({ 40 | reporter: 'dot', 41 | require: [ 42 | '@babel/register', 43 | ], 44 | })) 45 | .on('end', () => { 46 | server.emit('kill'); 47 | return done(); 48 | }) 49 | .on('error', (err) => done(err)); 50 | })); 51 | -------------------------------------------------------------------------------- /tasks/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "port": 3000, 3 | "dev": ".", 4 | "styles": { 5 | "dest": "css" 6 | }, 7 | "modules": { 8 | "main.js": "main.js" 9 | }, 10 | "html": "index.html", 11 | "production": { 12 | "dest": "build/", 13 | "scripts": [ 14 | "js/*.js" 15 | ], 16 | "static": [ 17 | "index.html", 18 | "img/*", 19 | "font/*", 20 | "static/*", 21 | "config.js", 22 | "favicon.ico" 23 | ], 24 | "styles": [ 25 | "css/*.css" 26 | ], 27 | "tests": [ 28 | "tests/**/test-*.js", 29 | "!**/node_modules/**" 30 | ] 31 | }, 32 | "lint": [ 33 | "*.js", 34 | "modules/**/*.js", 35 | "apps/**/*.js", 36 | "tasks/**/*.js", 37 | "!**/node_modules/**" 38 | ], 39 | "tests": [ 40 | "tests/**/test-*.js", 41 | "!**/node_modules/**" 42 | ], 43 | "units": [ 44 | "apps/**/test-*.js", 45 | "modules/**/test-*.js", 46 | "!**/node_modules/**" 47 | ] 48 | } 49 | -------------------------------------------------------------------------------- /tasks/test-functional.js: -------------------------------------------------------------------------------- 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 | 'use strict'; 17 | 18 | const gulp = require('gulp'); 19 | const settings = require('./settings.json'); 20 | const plugins = require('gulp-load-plugins')(settings.plugins); 21 | 22 | const argv = require('yargs').argv; 23 | 24 | gulp.task('test-functional', gulp.series([ 'build' ], (done) => { 25 | const server = gulp.src('.') 26 | .pipe(plugins.webserver({ 27 | host: '0.0.0.0', 28 | port: 3001, 29 | })); 30 | 31 | plugins.env({ 32 | vars: { 33 | PORT: 3001, 34 | }, 35 | }); 36 | 37 | return gulp.src(argv['test-files'] || settings.tests, {read: false}) 38 | .pipe(plugins.plumber()) 39 | .pipe(plugins.mocha({ 40 | reporter: 'spec', 41 | require: [ 42 | '@babel/register', 43 | ], 44 | })) 45 | .on('end', () => { 46 | server.emit('kill'); 47 | return done(); 48 | }) 49 | .on('error', (err) => done(err)) 50 | ; 51 | })); 52 | -------------------------------------------------------------------------------- /tasks/test-unit.js: -------------------------------------------------------------------------------- 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 | 'use strict'; 17 | 18 | const gulp = require('gulp'); 19 | const settings = require('./settings.json'); 20 | const plugins = require('gulp-load-plugins')(settings.plugins); 21 | 22 | const { argv } = require('yargs'); 23 | 24 | gulp.task('test-unit', (done) => gulp.src(argv['test-files'] || settings.units, {read: false}) 25 | .pipe(plugins.plumber()) 26 | .pipe(plugins.mocha({ 27 | reporter: 'dot', 28 | require: [ 29 | '@babel/register', 30 | 'ignore-styles', 31 | ], 32 | })) 33 | .on('end', () => done()) 34 | .on('error', (err) => done(err)) 35 | ); 36 | -------------------------------------------------------------------------------- /tasks/test.js: -------------------------------------------------------------------------------- 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 | 'use strict'; 17 | 18 | const gulp = require('gulp'); 19 | 20 | gulp.task('test', gulp.series([ 21 | 'test-unit', 22 | 'test-functional', 23 | ])); 24 | -------------------------------------------------------------------------------- /tasks/watch.js: -------------------------------------------------------------------------------- 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 | 'use strict'; 17 | 18 | const gulp = require('gulp'); 19 | const settings = require('./settings.json'); 20 | 21 | gulp.task('watch', gulp.series([ 'watchify' ], (done) => { 22 | gulp.watch(settings.lint); 23 | done(); 24 | })); 25 | --------------------------------------------------------------------------------