Skip to content

Commit

Permalink
Merge pull request #113 from honzakostejn/master
Browse files Browse the repository at this point in the history
Developer / Controls / FileExplorer - Custom Command Bar Buttons & Custom View Columns
  • Loading branch information
honzakostejn authored Jul 21, 2024
2 parents 6f1b8a7 + 87f7a2b commit 8ab84dd
Show file tree
Hide file tree
Showing 8 changed files with 306 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ module.exports = config({
['/en/developer-guide/applications/controls/FileExplorer/actions.md', 'Actions'],
['/en/developer-guide/applications/controls/FileExplorer/collaborationworkspaces.md', 'Collaboration Workspaces'],
['/en/developer-guide/applications/controls/FileExplorer/documenttemplating.md', 'Templates & Classification'],
['/en/developer-guide/applications/controls/FileExplorer/custom-command-bar-buttons.md', 'Custom Command Bar Buttons'],
['/en/developer-guide/applications/controls/FileExplorer/custom-view-columns.md', 'Custom View Columns'],
]
},
['/en/developer-guide/applications/controls/general.md', 'General Information'],
Expand All @@ -393,7 +395,7 @@ module.exports = config({
['/en/developer-guide/applications/controls/quicklookupedit.md', 'Quick Lookup Edit'],
['/en/developer-guide/applications/controls/rating.md', 'Rating'],
['/en/developer-guide/applications/controls/treeview.md', 'Tree View'],
['/en/developer-guide/applications/controls/wbs.md', 'WBS - Work Breakdown Structure']
['/en/developer-guide/applications/controls/wbs.md', 'WBS - Work Breakdown Structure'],
]
},
{
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,18 @@ Each configuration has an explanation written below it.
- **Default Opener:** Set the primary way to open documents such as Word, Excel, PowerPoint.
- **File Explorer Mode:** Path/List. Only Path is currently supported.
- **File Explorer Provider:** Sharepoint/Environment File System. Only Sharepoint is currently supported.
- **Show Root Folder Name:** Use this field if you do not want to display the folder name if the user's current working directory is set to root of the _File Explorer_ control instance.
- **Root Folder Name:** Use this field if you do not want to display the name of the last folder in the path.
- **Lock on Disable:** If you wish to disable some functionality, such as recording or deleting, on inactive records, select Yes here.
- **Columns to be Shown:** Enter the columns you wish to display here. Separate the individual columns with a comma. Currently available column names: author, datemodified, filesize, version.
- **Hide Header Buttons:** There are always buttons in the header to create and upload a file. When you select Yes, action buttons for existing files appear in the header when you select two or more files. In this mode, individual files are interacted with by buttons directly on the file line. Otherwise, the action buttons appear in the header when one or more files are selected.
- **Hide File Classification Dialog:** A dialog that contains the Language and File Type fields, which the user must fill in each time a file is uploaded.
- [**DEPRECATED**](/en/developer-guide/applications/controls/FileExplorer/custom-view-columns) **Columns to be Shown:** Enter the columns you wish to display here. Separate the individual columns with a comma. Currently available column names: datemodified.
- **Event Handlers:** Support for this functionality will be added in future releases.
- **Expand Query:** The query to get data from associated entities. Contact your administrator for setup help.
- **Expand Query:** The query to get data from related records of the source record the _File Explorer_ control instance is bound to. Contact your administrator for setup help.
- **Folder Path:** The path to the destination folder in Sharepoint Online. Separate folders with '/'. Path supports the LIQUID markup language. Contact your administrator for setup help.
- **Graph Filter Query:** A filter used by the File Explorer to correctly find the target site in Sharepoint Online. Contact your administrator for setup help.
- **Form ID:** Enter the main form ID for the file metadata here. Default value is 357117a8-ac48-ee11-be6d-000d3adc1f33.
- **File Record Expand Query:** It is possible to expand file record with related data for custom view columns. Typically this will be used for files related to a specific record such as contract through `talxis_regardingobjectid` lookup.

Ask WAS for help if needed.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
Author: Jan Kostejn
---

# Custom Command Bar Buttons
_File Explorer_ control can be extended to support custom command bar buttons, which can trigger / cause some action.

## Configuration
These buttons can be added through configuration. First of all, make sure that you have a [collaboration workspace template record](/en/developer-guide/applications/controls/FileExplorer/collaborationworkspaces/#collaboration-workspace-template) created. This record is defining the features of an individual _File Explorer_ control instance. Once that is sorted out, you can start adding buttons in the **🖱️ Custom Buttons** tab.
![Custom Buttons tab on the Collaboration Workspace Template form](/.attachments/en/developer-guide/applications/controls/FileExplorer/custom-command-bar-buttons-tab-on-collaboration-workspace-template-form.png)

Here you add a new button (record) to the existing _File Explorer_ control instance. These records can be then exported and versioned in the data package through `pac tool cmt` cli command, which opens _Configuration Migration Tool_ on your local machine.

### _Collaboration Workspace Custom Command Bar Button_ Record
![Custom Command Bar Buttons main form](/.attachments/en/developer-guide/applications/controls/FileExplorer/custom-command-bar-buttons-main-form.png)

#### IDENTIFICATION Section
| Attribute | Description |
| ------------------------------ | ---------------------------------------------- |
| Name | Logical name of the button |
| Collaboration Workspace Header | Associated _Collaboration Workspace Template_. |
| Status Reason | Only _Active_ records are retrieved and valid. |

#### BEHAVIOR Section
| Attribute | Description |
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Action | Action that should happen once the button is clicked on. See [available actions](#action-type-codes). |
| On-demand Workflow / Flow Id \* | Id of the on-demand workflow or flow you wish to trigger. The triggering record is always the file you've triggered the action from. |
| Shown When | When should be the button shown to the user in the UI. See [available values](#shown-when-type-codes). |
| File Name Filter | Allows you to show the button only for a specific type of file. Example: `*.*` allows to select only files and not folders. There is [`minimatch`](https://www.npmjs.com/package/minimatch) library used for evaluation of these expressions. |

\* : Visible only if the _Action_ is set to _On-demand Workflow / Flow_ value.

##### Action Type Codes
| Name | Value | Description |
| ------------------------- | --------- | -------------------------------------------------------------------------------------------- |
| On-demand Workflow / Flow | 742070000 | Triggers an on-demand workflow or cloud flow. This action can't be awaited. Fire and forget. |

If there is "your" action missing, feel free to extend this feature and implement it.

##### Shown When Type Codes
| Name | Value | Description |
| ------------- | --------- | ------------------------------------------------------ |
| Always | 742070000 | Show the button all the time. |
| Selected Row | 742070001 | Show only if one file or folder is selected. |
| Selected Rows | 742070002 | Show if multiple files are selected. |
| None | 742070003 | Show the button only if no file or folder is selected. |

#### LOOK Section
| Attribute | Description |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Icon Name | Name of the Fluent UI icon that you wish to use. The icons are referenced in _PascalCase_ notation. You can use [this resource](https://icon-sets.iconify.design/fluent-mdl2/) to find the right icon. |
| Display Name \* | Display name of the button. This text is shown in the UI to the end user. |
| Success Message \* | Success message that is shown once the _Action_ is completed. |
| Error Message \* | Error message that is shown, when the _Action_ could not be completed. |

\* : Localized JSON objects can be used. These values are not known at design time and due to the localization requirement, this was the best value / effort solution. The object has string _lcid_ (language codes) for properties with translated values. Example: `{ "1033": "This is the english localized value.", "1029": "Tohle je český překlad." }`.
Loading

0 comments on commit 8ab84dd

Please sign in to comment.