Skip to content

Commit

Permalink
Merge pull request #522 from ditrit/feature/error_management
Browse files Browse the repository at this point in the history
Feature: error management
  • Loading branch information
Zorin95670 authored Aug 12, 2024
2 parents 258952e + 9e4bd66 commit 69f9c78
Show file tree
Hide file tree
Showing 32 changed files with 517 additions and 290 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ jobs:
run: |
npm install -g [email protected] && \
npm ci && \
npm run plugin:install -- repository-name="githubator-plugin" repository-url="https://github.com/ditrit/githubator-plugin.git#0.4.1" && \
npm run plugin:install -- repository-name="terrator-plugin" repository-url="https://github.com/ditrit/terrator-plugin.git#0.10.0" && \
npm run plugin:install -- repository-name="githubator-plugin" repository-url="https://github.com/ditrit/githubator-plugin.git#0.4.2" && \
npm run plugin:install -- repository-name="terrator-plugin" repository-url="https://github.com/ditrit/terrator-plugin.git#0.11.0" && \
npm run plugin:init && \
docker build -t leto-modelizer -f DockerfileE2E .
- name: Run application
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ To run all the e2e tests, you need to run the application with ALL official plug

```bash
npm ci
npm run plugin:install -- repository-name="terrator-plugin" repository-url="https://github.com/ditrit/terrator-plugin.git#0.10.0"
npm run plugin:install -- repository-name="githubator-plugin" repository-url="https://github.com/ditrit/githubator-plugin.git#0.4.1"
npm run plugin:install -- repository-name="terrator-plugin" repository-url="https://github.com/ditrit/terrator-plugin.git#0.11.0"
npm run plugin:install -- repository-name="githubator-plugin" repository-url="https://github.com/ditrit/githubator-plugin.git#0.4.2"
npm run plugin:init
TEMPLATE_LIBRARY_BASE_URL="https://raw.githubusercontent.com/ditrit/leto-modelizer-templates-library/leto-modelizer/e2e_test" npm run dev
```
Expand All @@ -66,8 +66,8 @@ TEMPLATE_LIBRARY_BASE_URL="https://raw.githubusercontent.com/ditrit/leto-modeliz

```bash
npm ci
npm run plugin:install -- repository-name="terrator-plugin" repository-url="https://github.com/ditrit/terrator-plugin.git#0.10.0"
npm run plugin:install -- repository-name="githubator-plugin" repository-url="https://github.com/ditrit/githubator-plugin.git#0.4.1"
npm run plugin:install -- repository-name="terrator-plugin" repository-url="https://github.com/ditrit/terrator-plugin.git#0.11.0"
npm run plugin:install -- repository-name="githubator-plugin" repository-url="https://github.com/ditrit/githubator-plugin.git#0.4.2"
npm run plugin:init
```

Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,19 @@ For now, we don't have many plugins to offer you, but follow us and in the next

Plugin to manage terraform files, by default it comes with aws provider definition.

[GitHub url](https://github.com/ditrit/terrator-plugin#0.10.0)
[GitHub url](https://github.com/ditrit/terrator-plugin#0.11.0)

### Github plugin

Plugin to manage GitHub action files.

[GitHub url](https://github.com/ditrit/githubator-plugin#0.4.1)
[GitHub url](https://github.com/ditrit/githubator-plugin#0.4.2)

### Kubernetes plugin

Plugin to manage Kubernetes files.

[GitHub url](https://github.com/ditrit/kubernator-plugin#0.2.0)
[GitHub url](https://github.com/ditrit/kubernator-plugin#0.2.1)

## Compatibility versions table

Expand Down Expand Up @@ -110,10 +110,10 @@ Plugin to manage Kubernetes files.
</tr>
<tr>
<td>next version</td>
<td>= 0.25.0</td>
<td>= 0.10.0</td>
<td>= 0.4.1</td>
<td>= 0.2.0</td>
<td>= 0.26.2</td>
<td>= 0.11.0</td>
<td>= 0.4.2</td>
<td>= 0.2.1</td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -146,27 +146,27 @@ Choose __Custom plugin__ to install a specific plugin not referenced as an offic
Examples with official plugins:
- terrator-plugin:
- plugin name: `terrator-plugin`
- git repository url: `https://github.com/ditrit/terrator-plugin.git#0.10.0`
- git repository url: `https://github.com/ditrit/terrator-plugin.git#0.11.0`
- githubator-plugin:
- plugin name: `githubator-plugin`
- git repository url: `https://github.com/ditrit/githubator-plugin.git#0.4.1`
- git repository url: `https://github.com/ditrit/githubator-plugin.git#0.4.2`
- kubernator-plugin:
- plugin name: `kubernator-plugin`
- git repository url: `https://github.com/ditrit/kubernator-plugin.git#0.2.0`
- git repository url: `https://github.com/ditrit/kubernator-plugin.git#0.2.1`

### Install custom plugin in command line

Options `repository-name` and `repository-url` can be added with the `npm run plugin:install` command to bypass cli prompts.

```bash
# Example with terraform plugin
npm run plugin:install -- repository-name="terrator-plugin" repository-url="https://github.com/ditrit/terrator-plugin.git#0.10.0"
npm run plugin:install -- repository-name="terrator-plugin" repository-url="https://github.com/ditrit/terrator-plugin.git#0.11.0"

# Example with github action plugin
npm run plugin:install -- repository-name="githubator-plugin" repository-url="https://github.com/ditrit/githubator-plugin.git#0.4.1"
npm run plugin:install -- repository-name="githubator-plugin" repository-url="https://github.com/ditrit/githubator-plugin.git#0.4.2"

# Example with kubernator plugin
npm run plugin:install -- repository-name="kubernator-plugin" repository-url="https://github.com/ditrit/kubernator-plugin.git#0.2.0"
npm run plugin:install -- repository-name="kubernator-plugin" repository-url="https://github.com/ditrit/kubernator-plugin.git#0.2.1"
```

Now that your plugin is installed, you can continue to install other plugins with the same command if you want.
Expand Down Expand Up @@ -210,7 +210,7 @@ It will generate the built application in the `dist` folder.

To build this app with docker (the two main plugins for terraform & github are included), please use this command:
```bash
docker build . -build-arg TERRATOR_PLUGIN_VERSION="0.10.0" -build-arg GITHUBATOR_PLUGIN_VERSION="0.4.1" -build-arg KUBERNATOR_PLUGIN_VERSION="0.2.0" -t leto-modelizer
docker build . -build-arg TERRATOR_PLUGIN_VERSION="0.11.0" -build-arg GITHUBATOR_PLUGIN_VERSION="0.4.2" -build-arg KUBERNATOR_PLUGIN_VERSION="0.2.1" -t leto-modelizer
```

### Docker run
Expand Down
9 changes: 5 additions & 4 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Add route to clear token.
* Improve dockerfile with version of plugins as argument.
* Export diagram as svg.
* Error management on monaco editor and error footer.

### Changed

Expand All @@ -34,10 +35,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Technical content:
* Update import of vue components.
* Plugin management:
* Work with [plugin-core](https://github.com/ditrit/leto-modelizer-plugin-core/tree/0.25.0) version 0.25.0.
* Work with [terrator-plugin](https://github.com/ditrit/terrator-plugin/tree/0.10.0) version 0.10.0.
* Work with [githubator-plugin](https://github.com/ditrit/githubator-plugin/tree/0.4.1) version 0.4.1.
* Work with [kubernator-plugin](https://github.com/ditrit/kubernator-plugin/tree/0.2.0) version 0.2.0.
* Work with [plugin-core](https://github.com/ditrit/leto-modelizer-plugin-core/tree/0.25.0) version 0.26.2.
* Work with [terrator-plugin](https://github.com/ditrit/terrator-plugin/tree/0.11.0) version 0.11.0.
* Work with [githubator-plugin](https://github.com/ditrit/githubator-plugin/tree/0.4.2) version 0.4.2.
* Work with [kubernator-plugin](https://github.com/ditrit/kubernator-plugin/tree/0.2.1) version 0.2.1.
* Improve performance on git add.
* Replace OIDC authentication by Leto-Modelizer-Api, see [this issue](https://github.com/ditrit/leto-modelizer/issues/425).
* Separating git-related functions into a dedicated composable.
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/ModelizerPage/SwitchView/AddComponent.feature
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ Feature: Test switch model to text view: add component/link
And I wait 1 second
And I expect '.id_1.component' exists
And I expect '.id_2.component' exists
And I expect '.id_2_to_id_1.link' exists
And I expect '.id_1_to_id_2.link' exists
2 changes: 1 addition & 1 deletion cypress/e2e/ModelizerPage/SwitchView/Delete.feature
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ Feature: Test switch model to text view: delete component/link
When I click on '[data-cy="navigation-bar"] [data-cy="modelizer-switch-button"] [aria-pressed="false"]'
And I wait 1 second
Then I expect '[data-cy="navigation-bar"] [data-cy="modelizer-switch-button"] [aria-pressed="true"] [class="block"]' is 'Draw'
And I expect '.id_2_to_id_1.link' appear 1 time on screen
And I expect '.id_1_to_id_2.link' appear 1 time on screen

# NOTE: must force click because the following two elements are covered by an overflowing svg element
# When I force click on '[class="link"]'
Expand Down
9 changes: 5 additions & 4 deletions cypress/e2e/RoundTrips/DrawEditor.feature
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,11 @@ Feature: Test roundtrip of the application: draw editor
And I expect component ".id_3.component .model" to be at position 130,30

When I drag ".id_3.component .model" of 100,100
Then I expect component ".id_3.component .model" to be at position 230,130
## TODO: Uncomment when pixel error are resolved.
# Then I expect component ".id_3.component .model" to be at position 230,130

# Rearrange
When I click on '[data-cy="rearrange-button"]'
And I click on '[data-cy="rearrange-button"]'

# Check their positions after rearranging
Then I expect component ".id_1.component .model" to be at position 30,30
Expand Down Expand Up @@ -372,11 +373,11 @@ Feature: Test roundtrip of the application: draw editor
And I expect '.id_3.component' not exists
And I expect '.id_4.component' not exists
And I expect '.id_5.component' not exists
And I expect '.id_4_to_id_3.link' not exists
And I expect '.id_3_to_id_4.link' not exists

When I click on '[data-cy="component-definition_Test application"]'
And I wait 1 second
Then I expect '.id_3.component' exists
And I expect '.id_4.component' exists
And I expect '.id_5.component' exists
And I expect '.id_4_to_id_3.link' exists
And I expect '.id_3_to_id_4.link' exists
12 changes: 6 additions & 6 deletions leto-modelizer-plugin-cli.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[
{
"name": "terrator-plugin",
"url": "https://github.com/ditrit/terrator-plugin.git#0.10.0",
"version": "0.10.0"
"url": "https://github.com/ditrit/terrator-plugin.git#0.11.0",
"version": "0.11.0"
},
{
"name": "githubator-plugin",
"url": "https://github.com/ditrit/githubator-plugin.git#0.4.1",
"version": "0.4.1"
"url": "https://github.com/ditrit/githubator-plugin.git#0.4.2",
"version": "0.4.2"
},
{
"name": "kubernator-plugin",
"url": "https://github.com/ditrit/kubernator-plugin.git#0.2.0",
"version": "0.2.0"
"url": "https://github.com/ditrit/kubernator-plugin.git#0.2.1",
"version": "0.2.1"
}
]
48 changes: 0 additions & 48 deletions src/components/drawer/ComponentDropOverlay.vue

This file was deleted.

50 changes: 39 additions & 11 deletions src/components/drawer/ConsoleFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<q-tab
v-for="tab in tabs"
:key="tab.name"
:label="tab.label"
:label="$t(`footer.consoleFooter.tabs.${tab.name}`, { number: logs.length })"
:name="tab.name"
:data-cy="`console-tab_${tab.name}`"
:data-cy="tab.name"
@click="toggleTab(tab.name)"
/>
</q-tabs>
Expand All @@ -26,28 +26,38 @@
name="errors"
class="text-h6"
>
<errors-table :errors="props.errors" />
<errors-table
:errors="logs"
:editor-type="props.editorType"
/>
</q-tab-panel>
</q-tab-panels>
</q-footer>
</template>

<script setup>
import { ref } from 'vue';
import {
onMounted,
onUnmounted,
ref,
} from 'vue';
import ErrorsTable from 'components/table/ErrorsTable';
import LogEvent from 'src/composables/events/LogEvent';
const props = defineProps({
errors: {
type: Array,
required: true,
editorType: {
type: String,
default: 'text',
},
});
const selectedTab = ref(null);
const tabs = ref([
{ name: 'errors', label: `errors (${props.errors.length})`, open: false },
]);
const logs = ref([]);
const tabs = ref([{
name: 'errors',
open: false,
}]);
let fileLogEventSubscription;
/**
* Expand or reduce tab (console footer with it).
* @param {string} tabName - Name of the clicked tab
Expand All @@ -60,6 +70,24 @@ function toggleTab(tabName) {
selectedTab.value = null;
}
}
/**
* Update current logs.
* @param {ParseLogs} fileLogs - Logs.
*/
function updateFileLogs(fileLogs) {
logs.value = fileLogs;
}
onMounted(() => {
fileLogEventSubscription = LogEvent.FileLogEvent.subscribe(
(e) => { updateFileLogs(e); },
);
});
onUnmounted(() => {
fileLogEventSubscription.unsubscribe();
});
</script>

<style>
Expand Down
2 changes: 1 addition & 1 deletion src/components/drawer/ModelizerDrawLeftDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
side="left"
:width="400"
data-cy="draw-page-left-drawer"
class="no-scroll"
>
<q-splitter
v-model="splitterModel"
:limits="[10, 15]"
style="height: calc(100vh - 64px);"
>
<template #before>
<q-tabs
Expand Down
Loading

0 comments on commit 69f9c78

Please sign in to comment.