Commit graph

4854 commits

Author SHA1 Message Date
771e32e368
[#341] procedure._serialize_action should also support strings. 2024-09-13 18:21:27 +02:00
156a6379d0
[#341] Added for for/break/continue statements in procedure editor. 2024-09-13 18:19:02 +02:00
c4610254f8
Merge branch '341/procedure-entities' into 341/procedure-entities-ui 2024-09-12 02:16:32 +02:00
853fce2521
[procedures] Fixed if queue flushing logic.
Any pending `if`s in the parsing queue of a procedure should also be
cleared if the current statement in the procedure is a
break/continue/return.

In such case we should terminate the current branch, and that involves
ensuring that any `if`s branches that are still being parsed are
inserted before the branch-terminating statement.
2024-09-12 02:14:40 +02:00
b337bf7a53
[#341] Added return block to ProcedureEditor. 2024-09-12 02:02:27 +02:00
152c2020de
Merge branch '341/procedure-entities' into 341/procedure-entities-ui 2024-09-10 22:55:53 +02:00
daa030ff4c
[UI] Improved Draggable component events.
`Draggable` components should emit `dragend`, not `drop` events.

`drop` should only be emitted by `Droppable` components, or the receiver
of a component that uses both won't be able to tell if a `drop` event
came from a component being dragged, or from an element where a dragged
element was dropped.
2024-09-10 22:54:12 +02:00
471ec1370c
[Procedure Editor] Added support for conditions and nested blocks. 2024-09-10 22:53:14 +02:00
202cff093f
[UI] Modals should react on escape only if the container element is present. 2024-09-10 22:42:50 +02:00
6eb8b7954d
[UI] Added styles for tiles. 2024-09-10 22:41:53 +02:00
0bc714d0e3
[UI] Added fold animation. 2024-09-10 22:41:35 +02:00
1e9f7fb2c6
[procedure] Added support for custom values on the return statement.
This enables constructs like this in procedures:

```yaml
- return

- return 1

- return: ${output}
```
2024-09-10 19:55:26 +02:00
946c7b1783
[procedure] Ignore id field in Procedure.build.
The reason is that an `id` specified on procedure level will be applied
to all the child requests.

This means that the first response from the first completed request will
be sent to Redis and mistakenly interpreted by HTTP listeners as the
return value of the whole procedure.

`Procedure.build` should instead calculate its own ID for the procedure,
and apply different IDs to the child requests.
2024-09-10 19:53:14 +02:00
5a7068501a
[request] The action name can be specified either on action or name.
This is for UI compatibility purposes.
2024-09-10 19:52:23 +02:00
efe2bb6196
Merge branch '341/procedure-entities' into 341/procedure-entities-ui 2024-09-06 12:04:32 +02:00
05b1fcd43a
[procedures] Don't validate the presence of the actions field in procedures.save.
When saving procedures with if/else/for blocks, some blocks aren't
supposed to have the `actions` field.
2024-09-06 11:55:03 +02:00
f18d0d8b74
[procedures] Recursive serialization in procedures.to_yaml. 2024-09-06 11:53:35 +02:00
15cf611c95
[#341] [UI] Implemented support for procedure entities.
- Added UI panel.

- Added support for entity types.

- Enhanced ability to edit procedures.

- Added ability to create, rename, edit, duplicate and delete stored
  procedures.

- Added support for YAML dumps of non-Python procedures.

- Added support for visualizing Python procedures directly in their
  source files.
2024-09-05 02:02:44 +02:00
bbfc5b32e6
[UI] Added integration icons to the ActionEditor autocomplete. 2024-09-05 02:00:52 +02:00
1133c6019a
[UI] Added general-purpose entity icon editor component. 2024-09-05 01:58:28 +02:00
1316af9553
[UI] Added general-purpose drag-and-drop components.
This is to bridge the gap between pointer-based and touch-based devices
and provide a drag-and-drop implementation that exposes a consistent API
for both the interfaces.

These components work by wrapping an underlying draggable/droppable DOM
element and proxying the event handlers consistently when drag/touch
events are detected.

This allows to listen to high-level drag/drop events even on touch-based
interface based on touch start/move/end events.

Example usage:

```vue
<template>
  <div class="draggable" ref="draggable">
    I can be dragged.
  </div>

  <div class="droppable" ref="droppable">
    Drop elements here.
  </div>

  <Draggable :element="$refs.draggable"
             @drag="console.log('The element is being dragged')"
             @drop="console.log('The element is been dropped')" />

  <Droppable :element="$refs.droppable"
             @dragenter="console.log('Entering')"
             @dragleave="console.log('Leaving')"
             @dragover="console.log('Dragging over')"
             @drop="console.log('Dropped!')" />
</template>

<style lang="scss" scoped>
.draggable {
  &.dragged {
    opacity: 0.5;
  }
}

.droppable {
  &.active {
    border: 1px solid green;
  }

  &.selected {
    background: yellow;
  }
}
</style>
```
2024-09-05 01:41:04 +02:00
44e319e7ca
[UI] Listen for keyup, keydown and touch events on NameEditor. 2024-09-05 01:40:26 +02:00
4e5c740908
[File UI] Added support for custom line positioning in file editor.
- Adds the ability to select lines from the editor, which in turn will
  highlight them.

- Adds the ability to load a file and scroll at a specific line if the
  URL has with the `line` argument.

- Adds the ability to maximize the file editor modal.
2024-09-05 01:39:43 +02:00
cc621cdca6
[UI] Support both string and objects on the Response component. 2024-09-05 01:35:05 +02:00
b0d9a95331
[UI] Added title propery to EditButton component. 2024-09-05 01:32:51 +02:00
485a1db3d3
[UI] Several improvements to the FloatingButton component.
- Added support for multiple element classes.

- Added `glow` property.

- Added support for absolute initial positioning.

- Added dynamic button size.

- Added FloatingButtons component to support groups of floating buttons.
2024-09-05 01:31:32 +02:00
e17abc34c1
[UI] Several improvements on the Modal component.
- Don't propagate `close` events. This prevents underlying modals from
  being closed on cascade when the current modal is closed.

- Added logic to filter out <ESC> keystrokes that have already targeted
  the outermost open modal, so underlying modals won't be closed.

- Added `:before-close` property. This is a callback that can optionally
  be passed to the component and it will run some custom logic before
  the modal is closed. If it returns false then the modal will stay
  open.
2024-09-05 01:28:47 +02:00
b74b8aa154
[#341] Added procedure entity icon. 2024-09-05 01:22:19 +02:00
d623b3d1b8
[UI] Added default styles for monospace content and draggable elements. 2024-09-05 01:21:13 +02:00
68e3cc51e4
[UI] Added shink, expand and unfold animations. 2024-09-05 01:20:43 +02:00
dd2ea2092e
[UI] Added more color settings. 2024-09-05 01:20:13 +02:00
3249053eb0
[UI] Added support for custom HTML and data in Autocomplete component. 2024-09-05 01:19:26 +02:00
bbc70fe6e6
[UI] The main module should load the config dir and main file paths at startup. 2024-09-05 01:17:35 +02:00
9ec21fe10d
[#341] Added icon for procedures plugin. 2024-09-05 01:16:33 +02:00
c54269e3d2
[#341] Added utility procedures.to_yaml action. 2024-09-05 01:13:30 +02:00
e39e36e5f6
[CI/CD] A more resilient github-mirror script.
- Fail immediately if no branches are checked out.

- Rebase only if we're pushing on master (don't bother for feature
  branches).

- Do a push force to Github.
2024-09-02 02:31:11 +02:00
c5c872eb68
[chore] Removed unused file re-added upon rebase. 2024-09-02 02:27:33 +02:00
26f491025a
[#341] Improvements on procedures.save.
- Update the cached representation of the procedure asynchronously on
  the `publish_entities` callback. This prevents stale records from
  being loaded from the db before the entities engine has persisted the
  new ones.

- Don't re-publish all entities when calling `procedures.status` at the
  end of `procedures.save`. This is both for performance reasons and to
  avoid sending to the entities engine stale representation of the data.
2024-09-02 02:24:43 +02:00
90a953b738
[WIP] 2024-09-02 02:24:42 +02:00
981ae3479e
An empty commit to re-trigger the CI/CD pipelines 2024-09-02 02:24:42 +02:00
bca340ebc1
An empty commit to re-trigger the CI/CD pipelines 2024-09-02 02:24:42 +02:00
9aff704444
An empty commit to re-trigger the CI/CD pipelines 2024-09-02 02:24:42 +02:00
5061c5290c
An empty commit to re-trigger the CI/CD pipelines 2024-09-02 02:24:42 +02:00
c68cf4b585
An empty commit to re-trigger the CI/CD pipelines 2024-09-02 02:24:41 +02:00
b53c4c5c18
An empty commit to re-trigger the CI/CD pipelines 2024-09-02 02:24:41 +02:00
e01782c344
An empty commit to re-trigger the CI/CD pipelines 2024-09-02 02:24:41 +02:00
6df699359c
Merge branch 'master' into 341/procedure-entities 2024-09-01 20:00:41 +02:00
861e7e7c52
[#341] More improvements on the procedures plugin.
- `procedures.status` should always sync with the db to ensure that the
  action returns the most up-to-date version of the procedures.

- Store, return and propagate entity procedure metadata.
2024-09-01 18:13:06 +02:00
1369848114
[#341] More procedures features.
- `procedures.exec` now supports running procedures "on the fly" given a
  definition with a list of actions.

- Fixed procedure renaming/overwrite logic.

- Access to `_all_procedures` should always be guarded by a lock.
2024-09-01 01:47:39 +02:00
9d086a4a10
[system] Don't use is_defined macro for system plugin entities.
It seems to clash with something and cause plugin actions to return
random `ImportError`.
2024-09-01 01:34:58 +02:00