Skip to content

Commit

Permalink
Merge branch 'dev-2311' into Add-dialogs-to-template
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/templates.simple/ax/src/templates/unit/server/UnitTemplate.razor
#	src/templates.simple/axpansion/server/Pages/Context/Units/Units.razor
  • Loading branch information
blazej.kuhajda committed Feb 20, 2024
2 parents 8940918 + fff8a9b commit 4f721b4
Show file tree
Hide file tree
Showing 136 changed files with 9,674 additions and 5,701 deletions.
6 changes: 3 additions & 3 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"AXSharp.ixc": {
"version": "0.18.0-alpha.189",
"version": "0.18.0-alpha.193",
"commands": [
"ixc"
]
Expand All @@ -15,13 +15,13 @@
]
},
"AXSharp.ixd": {
"version": "0.18.0-alpha.189",
"version": "0.18.0-alpha.193",
"commands": [
"ixd"
]
},
"AXSharp.ixr": {
"version": "0.18.0-alpha.189",
"version": "0.18.0-alpha.193",
"commands": [
"ixr"
]
Expand Down
4 changes: 2 additions & 2 deletions src/base/src/AXOpen.VisualComposer/AccordionComponent.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="accordion-item">
<div class="accordion-header">
<div class="input-group flex-nowrap">
<i class="bi bi-boxes m-2"></i>
<span class="bi bi-boxes align-self-center mx-2" aria-hidden="true" />
<button class="accordion-button collapsed py-2" type="button" data-bs-toggle="collapse" data-bs-target="#@SourceTwinElement.Symbol.ModalIdHelper()" aria-expanded="false" aria-controls="@SourceTwinElement.Symbol.ModalIdHelper()">
@SourceTwinElement.Symbol
</button>
Expand All @@ -26,7 +26,7 @@
if (kid is ITwinPrimitive prim)
{
<li class="list-group-item d-flex">
<i class="bi bi-card-text mr-2"></i>
<span class="bi bi-card-text me-2" aria-hidden="true" />
<p class="mb-0">@prim.Symbol</p>
<a class="ms-auto text-decoration-none text-black" style="cursor: pointer;" @onclick="() => Parent.AddChildren(prim)"><span class="bi bi-plus-lg" aria-hidden="true"/></a>
</li>
Expand Down
5 changes: 0 additions & 5 deletions src/base/src/AXOpen.VisualComposer/EmptyContainer.razor

This file was deleted.

47 changes: 26 additions & 21 deletions src/base/src/AXOpen.VisualComposer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VisualComposer library is for creating draggable elements in AXOpen applications
## Usage

~~~ HTML
<VisualComposerContainer Objects="@(new[] {Entry.Plc.Context.UnitTemplate})" />
<VisualComposerContainer Objects="@(new[] {Entry.Plc.Context.UnitTemplate})" Id="@Component.Symbol" />
~~~

## VisualComposerContainer
Expand All @@ -14,36 +14,41 @@ The `VisualComposerContainer` is default component that is used to generate cust

### Attributes

Objects - The list of ITwinObject from which is been claim all children and all primitives.
Id - The id of the container. If not specified, the id is generated automatically.
- `Objects` - The list of ITwinObjects that will be available for display.
- `Id` - The id of the container. If not specified, the id is generated automatically.

## Customizing

You can pan and zoom the entire Visual Composer container by holding the Ctrl key.
All option that is bellow is only available with role Administrator.

## Adding items

- `Show all` button you can show all children that is available from objects. And you can add them into view.
- `Show all primitives` button you can show all primitives that is available from objects. And you can add them into view.
- `Controller objects` - show all objects, that can be added to the view.

### Customizable option
## Views options

With drag-and-drop you can move every item on site.
- `Used objects` - show all object, that is used in view. Provide simple access to customizable or remove item
- `Create new` - create new view
- `Create copy` - create new view as copy of current selected view
- `Views` - show all views with clear zoom and pan, remove, add/remove from base views, enable/disable zooming and panning and set as default view
- `Background` - set background of view. You can choose from image or simple color
- `Change theme` - change color of icon for customizable item (black/white)
- after every change is view automatically saved into json

You can every item customizing with these options:
## Customizable options

- Presentation (Status-Display or Command-Control) - can be checked `Custom` and write your own name of presentation
- Transform (combination of left, center, right, top, center, bottom)
- Width - double value in rem, or -1 for auto
- Height - double value in rem, or -1 for auto
- ZIndex - int value, default is 0
- Roles - list of roles, that can see this item (`process_settings_access` or `process_settings_access, process_traceability_access`)
With drag-and-drop you can move every item on view.

### Layout
You can every item customizing with these options:

- `Save` - save current layout
- `Save as default` - save current layout as default layout. Default layout is loaded when application is started. Its available for every user.
- `Save as` - save current layout as new layout. Only administrator can change to this layout. (from name of new file is removed all special characters, that is not supported in file name)
- `Templates` - show all templates with remove buttons
- `Set image` - set image for current layout
- `Top` - the top position of the object
- `Left` - the left position of the object
- `Presentation` - Command-Control, Status-Display or Spot. Can be checked `Custom` and write your own name of presentation
- `Transform` - the location from which the position will be calculated (combination of left, center, right and top, center, bottom)
- `Width` - width of element (double value in rem, or -1 for auto)
- `Height` - height of element (double value in rem, or -1 for auto)
- `ZIndex` - the layer in which the object should be located (int value, default is 0)
- `Scale` - zoom of item
- `Roles` - list of roles, that can see this item (`process_settings_access` or `process_settings_access, process_traceability_access`)
- `Template` - specifies the way the item is formatted and presented
- `Background` - item background
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace AXOpen.VisualComposer.Serializing
{
internal class SerializableConfiguration
{
public SerializableConfiguration(List<string> views, string? defaultView)
{
Views = views;
DefaultView = defaultView;
}

public List<string> Views { get; set; }

public string? DefaultView { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,33 @@
{
internal class SerializableObject
{
public SerializableObject(string? imgSrc, List<SerializableVisualComposerItem> items, double scale, int translateX, int translateY)
public SerializableObject(string? imgSrc, int backgroundWidth, int backgroundHeight, bool emptyBackground, string backgroundColor, List<SerializableVisualComposerItem> items, string theme, double scale, int translateX, int translateY, bool allowZoomingAndPanning)
{
ImgSrc = imgSrc;
BackgroundWidth = backgroundWidth;
BackgroundHeight = backgroundHeight;
EmptyBackground = emptyBackground;
BackgroundColor = backgroundColor;
Items = items;
Theme = theme;
Scale = scale;
TranslateX = translateX;
TranslateY = translateY;
AllowZoomingAndPanning = allowZoomingAndPanning;
}

public string? ImgSrc { get; set; }
public int BackgroundWidth { get; set; }
public int BackgroundHeight { get; set; }
public bool EmptyBackground { get; set; }
public string BackgroundColor { get; set; } = "";
public List<SerializableVisualComposerItem> Items { get; set; }

public string Theme { get; set; }

public double Scale { get; set; }
public int TranslateX { get; set; }
public int TranslateY { get; set; }
public bool AllowZoomingAndPanning { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,11 @@
{
internal class SerializableVisualComposerItem
{
public SerializableVisualComposerItem(string id,
double ratioImgX,
double ratioImgY,
string transform,
string presentation,
double width,
double height,
int zIndex,
double scale,
string roles,
string presentationTemplate)
public SerializableVisualComposerItem(string id, double left, double top, string transform, string presentation, double width, double height, int zIndex, double scale, string roles, string presentationTemplate, bool background, string backgroundColor)
{
Id = id;
RatioImgX = ratioImgX;
RatioImgY = ratioImgY;
Left = left;
Top = top;
Transform = transform;
Presentation = presentation;
Width = width;
Expand All @@ -25,11 +15,13 @@ public SerializableVisualComposerItem(string id,
Scale = scale;
Roles = roles;
PresentationTemplate = presentationTemplate;
Background = background;
BackgroundColor = backgroundColor;
}

public string Id { get; set; }
public double RatioImgX { get; set; } = 10;
public double RatioImgY { get; set; } = 10;
public double Left { get; set; } = 10;
public double Top { get; set; } = 10;
public string Transform { get; set; } = "TopCenter";
public string Presentation { get; set; } = "Status-Display";
public double Width { get; set; } = -1;
Expand All @@ -38,5 +30,7 @@ public SerializableVisualComposerItem(string id,
public double Scale { get; set; } = 1;
public string Roles { get; set; } = "";
public string PresentationTemplate { get; set; } = "";
public bool Background { get; set; } = false;
public string BackgroundColor { get; set; } = "";
}
}
Loading

0 comments on commit 4f721b4

Please sign in to comment.