Skip to content

Commit

Permalink
#1976 Miscellaneous docs changes (#1986)
Browse files Browse the repository at this point in the history
Signed-off-by: CTomlyn <[email protected]>
  • Loading branch information
tomlyn authored May 25, 2024
1 parent 225bb51 commit c5e423f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/pages/01.06-notification-panel.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Notification Panel

The Notificaiotn Panel allows the application to display error, warning, success and info messages to the user.
The Notification Panel allows the application to display error, warning, success and info messages to the user.

<img src="../assets/cc-notification-panel.png" width="350" />

Expand Down
6 changes: 4 additions & 2 deletions docs/pages/03.09-read-only-or-locked-flows.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Some host applications need to display flows that cannot be edited by the user. This might be because the flow artifact is currently being edited by another user (locked) or because the user does not have authority to edit the flow (read-only) or some other reason. We'll use the term 'read-only' below to refer to both locked and read-only canvases.

There are many aspects of common-canvas components that need to considered for a read-only canvas. Since Common Canvas is highly customizable it is not possible for the common-canvas code to manage components of the canvas that have been customized by the host application. For example, if the host app code added tools to the toolbar, Common Canvas does not know whether those tools should be disabled when displaying a read-only canvas or not. So the host application code will need to manage that. Let's look at each element of Common Canvas and see what needs to be done.
There are many aspects of common-canvas components that need to be considered for a read-only canvas. Since Common Canvas is highly customizable it is not possible for the common-canvas code to manage components of the canvas that have been customized by the host application. For example, if the host app code added tools to the toolbar, Common Canvas does not know whether those tools should be disabled when displaying a read-only canvas or not. So the host application code will need to manage that. Let's look at each element of Common Canvas and see what needs to be done.

## General Config
There is one main canvas configuration property that will change the common-canvas behavior to implement a read-only canvas. This is [`enableEditingActions`](03.02.01-canvas-config.md#enableeditingactions) which defaults to true and needs to be set to `false` for read-only canvases. The sections below will cover what effect this will have on the different components of Common Canvas and what you need to do for any customizations you have made.
Expand Down Expand Up @@ -42,6 +42,8 @@ The toolbar can display buttons for standard common-canvas actions and also butt

You should review any application-specific action buttons you have added to the toolbar and decide if they need to be disabled or removed from the toolbar when displaying a read-only canvas.

If you decide you want to hide the toolbar, this can be achieved using the [`enableToolbarLayout`](03.02.01-canvas-config.md/#enabletoolbarlayout) canvas config field.

## Keyboard
Common Canvas supports a number of keyboard shortcuts. Setting `enableEditingActions` to false, disables any keyboard shortcuts that edit the canvas objects (such as Delete). See the [`enableEditingActions` documentation](03.02.01-canvas-config.md#enableeditingactions) for a list of keyboard shortcuts that are disabled.

Expand All @@ -54,7 +56,7 @@ Setting `enableEditingActions` to false:
You should decide if your application should display the palette when displaying a read-only canvas or not. The palette can be hidden by setting the canvas config property [`enablePaletteLayout`](03.02.01-canvas-config.md#enablepalettelayout) to "None".

## State Tag
Common Canvas allows the application to display a state tag, which is a label displayed directly on top of the canvas to allow the application to indicate what state (read-oly or locked) the flow is in. The state tag can be switched on using the [enableStateTag](03.02.01-canvas-config.md#enablestatetag) canvas configuration field.
Common Canvas allows the application to display a state tag, which is a label displayed directly on top of the canvas to allow the application to indicate what state (read-only or locked) the flow is in. The state tag can be switched on using the [enableStateTag](03.02.01-canvas-config.md#enablestatetag) canvas configuration field.

## Test Harness: Sample Read-Only application
The test harness contains a sample application called "Read-Only" which shows how a read-only canvas can be built using the `enableEditingActions` config option. In the application there are three toolbar buttons which can be used to navigate between Editable state, Read-Only state and Locked state. You can review the `.jsx` and `.scss` files in the [application code](https://github.com/elyra-ai/canvas/tree/master/canvas_modules/harness/src/client/components/custom-canvases/read-only) to see how the application is implemented and styled.

0 comments on commit c5e423f

Please sign in to comment.