-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #390 from freon4dsl/show-validations
Show validations
- Loading branch information
Showing
83 changed files
with
6,595 additions
and
1,525 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Strange and unexpected behaviour | ||
|
||
There are number of behaviour in Freon that we should look into. They are a bit strange. | ||
Either we should warn the user, or we should make some documentation, or ... | ||
|
||
## Model unit name change | ||
When the name of a model unit is changed it is saved in a different file. This is unexpected. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Bugs | ||
|
||
## Incorrect projection for expression | ||
|
||
**Description:** When the AST specifies a specific expression, e.g. for `DocuProject.InsurancePart.risk`, the editor creates a generaic expression projection with a pre- and post- action box. | ||
**Problem:** This is incorrect, as only a NumberLiteralExpression is allowed. | ||
|
||
**Solution:** The projection generator should detect that the NumberLiyteralExpression is not a general expression and leave out the pre- and post boxes. | ||
|
||
## Node version | ||
|
||
(node:55540) [DEP0147] DeprecationWarning: In future versions of Node.js, fs.rmdir(path, { recursive: true }) will be removed. Use fs.rm(path, { recursive: true }) instead | ||
(Use `node --trace-deprecation ...` to show where the warning was created) | ||
|
||
# ActionBox background remains blue | ||
|
||
The background of a, actionbox become light blue when it is selected/editing. After leaving the actionbox it remains light blue, but it should remove the light blue background. | ||
|
||
- TAB in CLICK out: remains blue | ||
|
||
- TAB in TAB out: remains blue | ||
|
||
- CLICK in TAB out: ok, blue background dissappears | ||
|
||
- CLICK in CLICK out: ok, blue background dissappears | ||
|
||
## Styling | ||
|
||
In `core-svelte/src/notes-on-styling` the olf freon CSS variables are referred to. | ||
|
||
This should now use the new css styles for the compponents | ||
|
||
## After changing view, cursor is lost | ||
|
||
After selecting other projections there is no focus in the editor. You need to first click somewhere. | ||
|
||
The cursor should be inside the editor, eg st: | ||
|
||
- the same element as it was before | ||
|
||
- if that elemenet is not visible, at its paremt | ||
|
||
- ... | ||
|
||
# Box tree error | ||
|
||
The following error occurrs: | ||
|
||
` ERROR: Box: nextLeafRight: TextBox for ID-31 of concept Method is mising in its parent (index === -1)` | ||
|
||
when selecting method type with click and tryinhg to tab right. | ||
|
||
The internal textbox parent should be a referencebox. | ||
|
||
**Solved:** AbstractSelectBox `children` returned empty array, but should return an array with the internal textbox. | ||
|
||
## External property replacer cannot inpuit anything | ||
|
||
In the external tester project the replacers for properties do not react upon any key stroke. So you cannot type anything. | ||
|
||
# LoggerSettings from webapp-lib to webapp-starter | ||
|
||
See heading |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
RadioComponent uses "--mdc-theme-secondary" for its color, if you want to override this value set "--freon-boolean-radiobox-color". | ||
CheckComponent uses "--mdc-theme-secondary", if you want to override set "--freon-boolean-checkbox-color". | ||
CheckComponent uses "--mdc-theme-secondary", if you want to override use "--freon-boolean-checkbox-color". | ||
SwitchComponent uses "--mdc-theme-primary", if you want to override set "--freon-boolean-switch-color". | ||
NumericSliderComponent uses "--mdc-theme-primary", if you want to override set "--freon-numeric-slider-color". | ||
InnerSwitchComponent uses "--mdc-theme-primary", if you want to override set "--freon-boolean-switch-color". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
packages/core-svelte/src/lib/components/ErrorMarker.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<script lang="ts"> | ||
import {afterUpdate, onMount, tick} from "svelte"; | ||
import ErrorTooltip from "$lib/components/ErrorTooltip.svelte"; | ||
import {viewport} from "$lib/components/svelte-utils/index.js"; | ||
import {Box} from "@freon4dsl/core"; | ||
export let box: Box; | ||
export let element; | ||
let content; | ||
let top = 10; | ||
let height = 8; | ||
async function calcPos() { | ||
await tick(); | ||
if (!!element) { | ||
let elementRect = element.getBoundingClientRect(); | ||
if (!!elementRect) { | ||
// console.log(`ErrorMarker top ${elementRect.top} bottom ${elementRect.bottom} height ${elementRect.height} viewport.top ${$viewport.top}`) | ||
// get the position of the element relative to the editor view | ||
top = elementRect.top - $viewport.top; | ||
} else { | ||
console.log("No bounding rect") | ||
} | ||
} else { | ||
console.log("NO element") | ||
} | ||
} | ||
onMount(() => { | ||
calcPos(); | ||
content = box.errorMessages; | ||
}) | ||
afterUpdate( () => { | ||
calcPos(); | ||
content = box.errorMessages; | ||
}) | ||
// todo Calculate parentLeft, or change it to parentRight. At the moment we assume that the ErrorMarker is at the left border of the FreonComponent. | ||
</script> | ||
|
||
<span class="error-positioning" style="top: {top}px; height: {height}px;"> | ||
<ErrorTooltip {box} hasErr={true} parentTop={top} parentLeft={2}> | ||
<span class="error-marker" style="height: {height}px;"> </span> | ||
</ErrorTooltip> | ||
</span> |
71 changes: 71 additions & 0 deletions
71
packages/core-svelte/src/lib/components/ErrorTooltip.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<!-- Copied and adapted from https://svelte.dev/repl/dd6754a2ad0547c5b1c1ea37c0293fef?version=4.2.19 --> | ||
|
||
<script lang="ts"> | ||
import { viewport } from "$lib/components/svelte-utils/EditorViewportStore.js"; | ||
import {Box} from "@freon4dsl/core"; | ||
export let box: Box; | ||
export let hasErr: boolean = false; | ||
export let parentTop: number = 0; | ||
export let parentLeft: number = 0; | ||
let content: string[] = []; | ||
let isHovered: boolean = false; | ||
// position of error message(s) | ||
let top = 0; | ||
let left = 0; | ||
async function mouseOver(event: MouseEvent) { | ||
if (hasErr) { | ||
isHovered = true; | ||
// Get the position of the mouse relative to the editor view and - if applicable - to its ErrorMarker parent. | ||
// Because an ErrorMarker also has its 'position' set to something other than 'static', we need to take its position into account. | ||
left = event.pageX - $viewport.left - parentLeft + 5; | ||
top = event.pageY - $viewport.top - parentTop + 5; | ||
// console.log(`ErrorTooltip: left-top [${left}, ${top}] event [${event.pageX}, ${event.pageY}] parent [${parentLeft}, ${parentTop}] viewport [${$viewport.left}, ${$viewport.top}]`) | ||
content = box.errorMessages; | ||
} | ||
} | ||
function mouseMove(event: MouseEvent) { | ||
if (hasErr && isHovered) { | ||
// Get the position of the mouse relative to the editor view and - if applicable - to its ErrorMarker parent. | ||
// Because an ErrorMarker also has its 'position' set to something other than 'static'. | ||
left = event.pageX - $viewport.left - parentLeft + 5; | ||
top = event.pageY - $viewport.top - parentTop + 5; | ||
} | ||
} | ||
function mouseLeave() { | ||
isHovered = false; | ||
} | ||
// Empty function to avoid error: "Svelte: A11y: on:mouseover must be accompanied by on:focus" | ||
function onFocus() { | ||
} | ||
</script> | ||
|
||
<span role= "group" | ||
on:mouseover={mouseOver} | ||
on:mouseleave={mouseLeave} | ||
on:mousemove={mouseMove} | ||
on:focus={onFocus} | ||
> | ||
<slot /> | ||
</span> | ||
|
||
{#if isHovered} | ||
<div | ||
style="top: {top}px; left: {left}px;" | ||
class="error-tooltip" | ||
> | ||
{#if content.length > 1} | ||
<ol class="error-tooltip-list-content"> | ||
{#each content as item} | ||
{#if item.length > 0} | ||
<li>{item}</li> | ||
{/if} | ||
{/each} | ||
</ol> | ||
{:else} | ||
<span class="error-tooltip-single-content">{content[0]} </span> | ||
{/if} | ||
</div> | ||
{/if} |
Oops, something went wrong.