Commit 34d0172a authored by redboul's avatar redboul

feat(fileViewer): Add file viewer widget

Create a file viewer widget that allows to view Bonita document
or files via a URL. A preview can be displayed under the file name
and cilc on a PDF or image file opens a fullscreen overlay
thanks to fancybo jquery plugin.

Closes [BS-14978](https://bonitasoft.atlassian.net/browse/BS-14978)
Closes [BS-14979](https://bonitasoft.atlassian.net/browse/BS-14979)
Closes [BS-14980](https://bonitasoft.atlassian.net/browse/BS-14980)
Closes [BS-14983](https://bonitasoft.atlassian.net/browse/BS-14983)
Closes [BS-14984](https://bonitasoft.atlassian.net/browse/BS-14984)
parent 863b18b1
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"template": "@pbButton.tpl.html", "template": "@pbButton.tpl.html",
"controller": "@pbButton.ctrl.js", "controller": "@pbButton.ctrl.js",
"description": "Trigger for an action in a page or form", "description": "Trigger for an action in a page or form",
"order": "11", "order": "10",
"icon": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 20'><g><path fill='#CBD5E1' d='M47,15.2c0,0.7-1.7,1.8-1.7,1.8S4.8,17,3.7,17c-1.6,0-3.6-1.9-3.6-1.9s0.7,4.8,4,5c2.4,0.1,42.4,0,42.4,0 s3.5-0.2,3.5-3.6c0-1.3,0.1-11.5,0.1-12.4c-0.1-2-4-4-4-4L47,1.8C47,1.8,47,14.5,47,15.2z'/><path fill='#fff' d='M3.9,1h40.3C45.7,1,47,2.2,47,3.6v10.8c0,1.4-1.3,2.6-2.9,2.6H3.9C2.3,17,1,15.8,1,14.4V3.6 C1,2.2,2.3,1,3.9,1z M3,0C1.3,0,0,1.3,0,3v12c0,1.7,1.3,3,3,3h42c1.7,0,3-1.3,3-3V3c0-1.7-1.3-3-3-3H3z'/></g></svg>", "icon": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 20'><g><path fill='#CBD5E1' d='M47,15.2c0,0.7-1.7,1.8-1.7,1.8S4.8,17,3.7,17c-1.6,0-3.6-1.9-3.6-1.9s0.7,4.8,4,5c2.4,0.1,42.4,0,42.4,0 s3.5-0.2,3.5-3.6c0-1.3,0.1-11.5,0.1-12.4c-0.1-2-4-4-4-4L47,1.8C47,1.8,47,14.5,47,15.2z'/><path fill='#fff' d='M3.9,1h40.3C45.7,1,47,2.2,47,3.6v10.8c0,1.4-1.3,2.6-2.9,2.6H3.9C2.3,17,1,15.8,1,14.4V3.6 C1,2.2,2.3,1,3.9,1z M3,0C1.3,0,0,1.3,0,3v12c0,1.7,1.3,3,3,3h42c1.7,0,3-1.3,3-3V3c0-1.7-1.3-3-3-3H3z'/></g></svg>",
"properties": [ "properties": [
{ {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"template": "@pbImage.tpl.html", "template": "@pbImage.tpl.html",
"description": "Display an image from assets or from a URL", "description": "Display an image from assets or from a URL",
"icon": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 20'><path fill='#fff' d='M10 1v18h30V1H10zm29 17H11V2h28v16zM20 9.1l3 3 5-7L36 16H14l6-6.9zM18 6c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2z'/></svg>", "icon": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 20'><path fill='#fff' d='M10 1v18h30V1H10zm29 17H11V2h28v16zM20 9.1l3 3 5-7L36 16H14l6-6.9zM18 6c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2z'/></svg>",
"order": "14", "order": "17",
"properties": [{ "properties": [{
"label": "Source Type", "label": "Source Type",
"name": "srcType", "name": "srcType",
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"type": "widget", "type": "widget",
"template": "@pbLink.tpl.html", "template": "@pbLink.tpl.html",
"description": "Navigation link to another page or form, or for file download", "description": "Navigation link to another page or form, or for file download",
"order": "10", "order": "12",
"icon": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 20'><g><path fill='#CBD5E1' d='M46.8,3h-1.9l-3.8,11.9H43L46.8,3z M42.8,3h-1.9l-3.8,11.9H39L42.8,3z M36.9,13.1H35v1.9h1.9V13.1z M36.9,7 H35v1.9h1.9V7z M25.8,10.6c0-1.4,0.4-2.8,2.1-2.8c1.6,0,2.1,1.3,2.1,2.6c0,1-0.4,2.6-2,2.6C26.4,13.1,25.8,11.9,25.8,10.6z M25.8,6 H24v11.8h1.9v-4.3h0c0.3,0.5,0.9,1.3,2.7,1.3c2.4,0,3.3-2.3,3.3-4.7c0-2.9-1.4-4.3-3.2-4.3c-1.7,0-2.4,0.8-2.8,1.4h0V6z M20.9,3.6 H19v2.3h-1.2v1.9H19V13c0,1.1,0.3,1.8,1.9,1.8h0.3c0.4,0,0.7,0,1.1,0v-1.7c-0.2,0-0.3,0-0.5,0c-0.9,0-0.9-0.2-0.9-0.7V7.8h1.4V5.9 h-1.4V3.6z M15.9,3.6H14v2.3h-1.2v1.9H14V13c0,1.1,0.3,1.8,1.9,1.8h0.3c0.4,0,0.7,0,1.1,0v-1.7c-0.2,0-0.3,0-0.5,0 c-0.9,0-0.9-0.2-0.9-0.7V7.8h1.4V5.9h-1.4V3.6z M11.9,8.8c0-1.9-1.1-2.9-2.8-2.9c-1.6,0-2.8,0.6-3.2,1.3h0V3H4v11.9h1.9v-5 c0-1.3,1-2,2.3-2C10,7.8,10,8.9,10,9.6v5.3h1.9V8.8z'/></g></svg>", "icon": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 20'><g><path fill='#CBD5E1' d='M46.8,3h-1.9l-3.8,11.9H43L46.8,3z M42.8,3h-1.9l-3.8,11.9H39L42.8,3z M36.9,13.1H35v1.9h1.9V13.1z M36.9,7 H35v1.9h1.9V7z M25.8,10.6c0-1.4,0.4-2.8,2.1-2.8c1.6,0,2.1,1.3,2.1,2.6c0,1-0.4,2.6-2,2.6C26.4,13.1,25.8,11.9,25.8,10.6z M25.8,6 H24v11.8h1.9v-4.3h0c0.3,0.5,0.9,1.3,2.7,1.3c2.4,0,3.3-2.3,3.3-4.7c0-2.9-1.4-4.3-3.2-4.3c-1.7,0-2.4,0.8-2.8,1.4h0V6z M20.9,3.6 H19v2.3h-1.2v1.9H19V13c0,1.1,0.3,1.8,1.9,1.8h0.3c0.4,0,0.7,0,1.1,0v-1.7c-0.2,0-0.3,0-0.5,0c-0.9,0-0.9-0.2-0.9-0.7V7.8h1.4V5.9 h-1.4V3.6z M15.9,3.6H14v2.3h-1.2v1.9H14V13c0,1.1,0.3,1.8,1.9,1.8h0.3c0.4,0,0.7,0,1.1,0v-1.7c-0.2,0-0.3,0-0.5,0 c-0.9,0-0.9-0.2-0.9-0.7V7.8h1.4V5.9h-1.4V3.6z M11.9,8.8c0-1.9-1.1-2.9-2.8-2.9c-1.6,0-2.8,0.6-3.2,1.3h0V3H4v11.9h1.9v-5 c0-1.3,1-2,2.3-2C10,7.8,10,8.9,10,9.6v5.3h1.9V8.8z'/></g></svg>",
"properties": [ "properties": [
{ {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"template": "@pbTable.tpl.html", "template": "@pbTable.tpl.html",
"controller": "@pbTable.ctrl.js", "controller": "@pbTable.ctrl.js",
"description": "Tabular presentation of data from an array", "description": "Tabular presentation of data from an array",
"order": "14", "order": "15",
"icon": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 20'><g><path fill='#CBD5E1' d='M36,15v2h11v-2H36z M40,10v2h7v-2H40z M11,10v2h14v-2H11z M3,10v2h3v-2H3z M11,15v2h17v-2H11z M3,15v2h3 v-2H3z'/><path fill='#fff' d='M1,19V1h48v18H1z M0,0v20h50V0H0z'/><path fill='#CBD5E1' d='M1,7v1h7v11h1V8h22v11h1V8h17V7H32V1h-1v6H9V1H8v6H1z'/><path fill='#fff' d='M35,3h12v2H35V3z M11,3h13v2H11V3z M3,3h3v2H3V3z'/></g></svg>", "icon": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 20'><g><path fill='#CBD5E1' d='M36,15v2h11v-2H36z M40,10v2h7v-2H40z M11,10v2h14v-2H11z M3,10v2h3v-2H3z M11,15v2h17v-2H11z M3,15v2h3 v-2H3z'/><path fill='#fff' d='M1,19V1h48v18H1z M0,0v20h50V0H0z'/><path fill='#CBD5E1' d='M1,7v1h7v11h1V8h22v11h1V8h17V7H32V1h-1v6H9V1H8v6H1z'/><path fill='#fff' d='M35,3h12v2H35V3z M11,3h13v2H11V3z M3,3h3v2H3V3z'/></g></svg>",
"properties": [ "properties": [
{ {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"type": "widget", "type": "widget",
"template": "@pbText.tpl.html", "template": "@pbText.tpl.html",
"description": "Short string or paragraph of text to be displayed. Can include HTML tags", "description": "Short string or paragraph of text to be displayed. Can include HTML tags",
"order": "13", "order": "14",
"icon": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 20'><g><path fill='#fff' d='M8.2,20h15v-1h-15V20z M8.2,17h31v-1h-31V17z M8.2,4h32V3h-32V4z M8.2,14h34v-1h-34V14z M8.2,7h30V6h-30V7z M8.2,1h35V0h-35V1z'/></g></svg>", "icon": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 20'><g><path fill='#fff' d='M8.2,20h15v-1h-15V20z M8.2,17h31v-1h-31V17z M8.2,4h32V3h-32V4z M8.2,14h34v-1h-34V14z M8.2,7h30V6h-30V7z M8.2,1h35V0h-35V1z'/></g></svg>",
"properties": [ "properties": [
{ {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"type": "widget", "type": "widget",
"template": "@pbTitle.tpl.html", "template": "@pbTitle.tpl.html",
"description": "Text used to structure the page or form content", "description": "Text used to structure the page or form content",
"order": "12", "order": "13",
"icon": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 20'><g><path fill='#fff' d='M29.6,8H33v10h3V4h-2.3c-0.1,0.9-1.4,2-4.1,2l-0.4,0.1L29.6,8z M24,11v7h3V3h-3v6h-6V3h-3v15h3v-7H24z'/></g></svg>", "icon": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 20'><g><path fill='#fff' d='M29.6,8H33v10h3V4h-2.3c-0.1,0.9-1.4,2-4.1,2l-0.4,0.1L29.6,8z M24,11v7h3V3h-3v6h-6V3h-3v15h3v-7H24z'/></g></svg>",
"properties": [ "properties": [
{ {
......
...@@ -48,3 +48,14 @@ ...@@ -48,3 +48,14 @@
padding:0 2em; padding:0 2em;
} }
.FileViewer-fileName {
display: inline-block;
padding-top: 7px;
margin-right: 5px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: top;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment