diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..254143f0 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,36 @@ +name: Deploy static site to GitHub Pages + +on: + push: + branches: [ "develop" ] # or "main" – pick your branch + paths: + - "Documentation/Website/**" + - ".github/workflows/deploy.yml" + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + # Upload your static site folder directly + - uses: actions/upload-pages-artifact@v3 + with: + path: Documentation/Website + + # Publish to Pages + - id: deployment + uses: actions/deploy-pages@v4 diff --git a/ACT/LibMC.xml b/ACT/LibMC.xml index f189b692..4096d0a7 100644 --- a/ACT/LibMC.xml +++ b/ACT/LibMC.xml @@ -701,6 +701,10 @@ + + + + diff --git a/ACT/LibMCData.xml b/ACT/LibMCData.xml index 2e4dbd0b..2e1ae470 100644 --- a/ACT/LibMCData.xml +++ b/ACT/LibMCData.xml @@ -438,7 +438,13 @@ - + + + + + + + @@ -1761,151 +1767,210 @@ - + - - + + - - - + + + - - + + + + - - - + + + + + + + + + - - + + - - + + - - - - - - + + + + + + - - - - - - + + + + + + + + - - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - - - - + + + + + + + + + + + - - - - + + + + + + - - + + - - + + - - - + + + - - - + + + + + + + + + - - - + + - - - - + + + - - - - + + + + - - - + + + + - - - - + - - - - + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2003,6 +2068,10 @@ + + + + diff --git a/ACT/LibMCEnv.xml b/ACT/LibMCEnv.xml index fca39b4a..143e3f96 100644 --- a/ACT/LibMCEnv.xml +++ b/ACT/LibMCEnv.xml @@ -289,7 +289,7 @@ - + @@ -3339,6 +3339,12 @@ + + + + + + @@ -3347,6 +3353,12 @@ + + + + + + @@ -3355,6 +3367,12 @@ + + + + + + @@ -4755,105 +4773,235 @@ - + - - + + - - + + - - + + - - - - - - - - - - - + + + - - - + + + - - + - + - - + + - - + + + + + + - - + + - - - - - - - - - + + + + + - - - - - + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5744,6 +5892,9 @@ + + + diff --git a/Artifacts/clientdist/_githash_client.txt b/Artifacts/clientdist/_githash_client.txt index 9e7b90b0..4b36a2a9 100644 --- a/Artifacts/clientdist/_githash_client.txt +++ b/Artifacts/clientdist/_githash_client.txt @@ -1 +1 @@ -de4928052636939a11b8e223e2f440da41fb23e6 +864af701b933b1d4bae3e21bac376e640f076aa3 diff --git a/Artifacts/clientdist/clientpackage.zip b/Artifacts/clientdist/clientpackage.zip index 0f54e186..287203dd 100644 Binary files a/Artifacts/clientdist/clientpackage.zip and b/Artifacts/clientdist/clientpackage.zip differ diff --git a/Artifacts/clientdist/clientsourcepackage.zip b/Artifacts/clientdist/clientsourcepackage.zip index 1f43656d..c400fceb 100644 Binary files a/Artifacts/clientdist/clientsourcepackage.zip and b/Artifacts/clientdist/clientsourcepackage.zip differ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7cac1888..d82df77b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -30,7 +30,7 @@ Maintainers are responsible for responding to pull requests and issues, as well We currently have three maintainers: - Alexander Oster alexander.oster@autodesk.com -- Martin Wassmann martin.wassmann@autodesk.com +- Martin Wassmann martin.weismann@autodesk.com - Philipp Neumann philipp.neumann@autodesk.com If you've established yourself as an impactful contributor to the project, and are willing take on the extra work, we'd love to have your help maintaining it! Email the current maintainers for details. diff --git a/Client/src/App.vue b/Client/src/App.vue index 387c82a5..f1944ffd 100644 --- a/Client/src/App.vue +++ b/Client/src/App.vue @@ -352,6 +352,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. uiOnTimer() { if (this.Application) { + this.Application.updateModules (); this.Application.updateContentItems (); } }, diff --git a/Client/src/common/AMCApplication.js b/Client/src/common/AMCApplication.js index f547526a..5a03c470 100644 --- a/Client/src/common/AMCApplication.js +++ b/Client/src/common/AMCApplication.js @@ -477,9 +477,75 @@ export default class AMCApplication extends Common.AMCObject { } + } + + updateModule(module) { + + // Early return if module is invalid + if (!module) + return; + + // Reset refresh flag before attempting update + module.refresh = false; + + if (module.isActive()) { + + // Prepare authorization headers (same policy as for content items) + let headers = {}; + let authToken = this.API.authToken; + + if (authToken != Common.nullToken()) + headers.Authorization = "Bearer " + authToken; + + // Optional state segment + let stateidstring = ""; + if (module.stateid > 0) + stateidstring = "/" + module.stateid; + + // Build request URL for modules + let url = this.API.baseURL + "/ui/module/" + Assert.UUIDValue(module.uuid) + stateidstring; + + Axios({ + method: "GET", + "headers": headers, + url: url + }) + .then(resultJSON => { + + // Update module from server payload (if present) + if (resultJSON.data) { + if (resultJSON.data.content) { + if (module && typeof module.updateFromJSON === "function") { + module.updateFromJSON(resultJSON.data.content); + } + } + } + + // Reset failure counter on success + this.unsuccessfulUpdateCounter = 0; + }) + .catch(err => { + + // Increment failure counter and react accordingly + this.unsuccessfulUpdateCounter = this.unsuccessfulUpdateCounter + 1; + if (this.unsuccessfulUpdateCounter > 5) { + this.setStatusToError(err.message); + } + }); + } } - - + + updateModules() { + + let uuid, module; + if (this.AppContent.ModuleMap) { + for ([uuid, module] of this.AppContent.ModuleMap) { + uuid; + this.updateModule(module); + } + } + } + onJobUploadChunkSuccess (application, uploadObject, chunkData, uploadOffset) { Assert.ObjectInstance (application, "amcApplication"); @@ -745,6 +811,11 @@ export default class AMCApplication extends Common.AMCObject { let pageString = String(page); this.AppState.activePage = pageString; + let pageObject = this.AppContent.PageMap.get(pageString); + if(pageObject) { + pageObject.setActive(); + } + if (this.AppState.appResizeEvent) this.AppState.appResizeEvent (); diff --git a/Client/src/common/AMCPage.js b/Client/src/common/AMCPage.js index b046a0fd..897b8812 100644 --- a/Client/src/common/AMCPage.js +++ b/Client/src/common/AMCPage.js @@ -45,6 +45,8 @@ export default class AMCApplicationPage extends Common.AMCObject { this.application = application; this.name = pageJSON.name; + this.uuid = pageJSON.uuid; + this.showevent = pageJSON.showevent || ""; this.modules = []; for (let moduleDefinitionJSON of pageJSON.modules) { @@ -87,4 +89,12 @@ export default class AMCApplicationPage extends Common.AMCObject { return false; } + + setActive () + { + if (this.showevent && typeof this.application.triggerUIEvent === "function") { + this.application.triggerUIEvent(this.showevent, this.uuid, {}, () => {}); + } + } + } diff --git a/Client/src/modules/AMCModule_Content.js b/Client/src/modules/AMCModule_Content.js index fc3cb0fb..ab7fb66d 100644 --- a/Client/src/modules/AMCModule_Content.js +++ b/Client/src/modules/AMCModule_Content.js @@ -43,6 +43,7 @@ import AMCApplicationItem_Content_Image from "./AMCModule_ContentItem_Image.js" import AMCApplicationItem_Content_Paragraph from "./AMCModule_ContentItem_Paragraph.js" import AMCApplicationItem_Content_ParameterList from "./AMCModule_ContentItem_ParameterList.js" import AMCApplicationItem_Content_Upload from "./AMCModule_ContentItem_Upload.js" +import AMCApplicationItem_Content_ConfigurationList from "./AMCModule_ContentItem_ConfigurationList.js" @@ -59,7 +60,9 @@ export default class AMCApplicationModule_Content extends Common.AMCApplicationM this.headline = Assert.StringValue (moduleJSON.headline); this.title = Assert.StringValue (moduleJSON.title); this.subtitle = Assert.StringValue (moduleJSON.subtitle); - + + this.visible = Assert.BoolValue (moduleJSON.visible); + this.items = []; @@ -96,6 +99,9 @@ export default class AMCApplicationModule_Content extends Common.AMCApplicationM if (itemJSON.type === "form") item = new AMCApplicationItem_Content_Form (this, itemJSON); + + if (itemJSON.type === "configurationlist") + item = new AMCApplicationItem_Content_ConfigurationList (this, itemJSON); if (item) { this.items.push (item); @@ -107,7 +113,14 @@ export default class AMCApplicationModule_Content extends Common.AMCApplicationM } } - + + updateFromJSON(updateJSON) { + + Assert.ObjectValue(updateJSON); + + if(updateJSON.visible !== undefined) + this.visible = Assert.BoolValue(updateJSON.visible); + } } diff --git a/Client/src/modules/AMCModule_Content.vue b/Client/src/modules/AMCModule_Content.vue index c48a6179..3fe1c27e 100644 --- a/Client/src/modules/AMCModule_Content.vue +++ b/Client/src/modules/AMCModule_Content.vue @@ -54,7 +54,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - + + + @@ -74,6 +76,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import ContentItem_ParameterList from '../modules/AMCModule_ContentItem_ParameterList.vue'; import ContentItem_ButtonGroup from '../modules/AMCModule_ContentItem_ButtonGroup.vue'; import ContentItem_Form from '../modules/AMCModule_ContentItem_Form.vue'; + import ContentItem_ConfigurationList from '../modules/AMCModule_ContentItem_ConfigurationList.vue'; export default { @@ -89,7 +92,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ContentItem_AlertList, ContentItem_ParameterList, ContentItem_ButtonGroup, - ContentItem_Form + ContentItem_Form, + ContentItem_ConfigurationList } }; diff --git a/Client/src/modules/AMCModule_ContentItem_ConfigurationList.js b/Client/src/modules/AMCModule_ContentItem_ConfigurationList.js new file mode 100644 index 00000000..7185250e --- /dev/null +++ b/Client/src/modules/AMCModule_ContentItem_ConfigurationList.js @@ -0,0 +1,140 @@ +/*++ + +Copyright (C) 2021 Autodesk Inc. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + * Neither the name of the Autodesk Inc. nor the +names of its contributors may be used to endorse or promote products +derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + */ + + +import * as Assert from "../common/AMCAsserts.js"; +import * as Common from "../common/AMCCommon.js" + + +export default class AMCApplicationItem_Content_ConfigurationList extends Common.AMCApplicationItem { + + constructor (moduleInstance, itemJSON) + { + Assert.ObjectValue (itemJSON); + super (moduleInstance, itemJSON.uuid, itemJSON.type); + this.registerClass ("amcItem_ConfigurationList"); + + this.entries = []; + + this.headers = []; + for (let header of itemJSON.headers) { + let checkedHeader = { + "text": header.text, + "value": header.value, + "sortable": header.sortable, + "width": header.width, + "align": header.align + } + + this.headers.push(checkedHeader); + } + + this.entrybuttons = []; + if (itemJSON.entrybuttons) { + for (let entrybutton of itemJSON.entrybuttons) { + + let checkedEntryButton = { + "uuid": entrybutton.uuid, + "caption": entrybutton.caption, + "color": entrybutton.color, + "cursor": entrybutton.cursor, + "selectevent": entrybutton.selectevent + } + + this.entrybuttons.push(checkedEntryButton); + } + } + + + this.loadingtext = ""; + this.selectevent = ""; + this.selectionvalueuuid = Common.nullUUID (); + this.buttonvalueuuid = Common.nullUUID (); + this.thumbnailaspectratio = 1.8; + this.thumbnailheight = "150pt"; + this.thumbnailwidth = ""; + this.entriesperpage = 5; + + /* this.entrybuttons = [ + { + uuid: "123", + caption: "Details", + color: "primary", + cursor: "cursor-pointer", + selectionvalueuuid: Common.nullUUID (), + selectevent: "12324353", + + }, + { + uuid: "234", + caption: "History", + color: "primary", + cursor: "cursor-pointer", + selectionvalueuuid: Common.nullUUID (), + selectevent: "12324353", + } + ]; */ + + this.updateFromJSON (itemJSON); + + this.setRefreshFlag (); + + } + + + updateFromJSON (updateJSON) + { + Assert.ObjectValue (updateJSON); + Assert.ArrayValue (updateJSON.entries); + + if (updateJSON.loadingtext) + this.loadingtext = Assert.StringValue (updateJSON.loadingtext); + if (updateJSON.selectevent) + this.selectevent = Assert.IdentifierString (updateJSON.selectevent); + if (updateJSON.selectionvalueuuid) + this.selectionvalueuuid = Assert.IdentifierString (updateJSON.selectionvalueuuid); + if (updateJSON.buttonvalueuuid) + this.buttonvalueuuid = Assert.IdentifierString (updateJSON.buttonvalueuuid); + if (updateJSON.entriesperpage) + this.entriesperpage = Assert.IntegerValue (updateJSON.entriesperpage); + + let oldEntryCount = this.entries.length; + for (let index = 0; index < oldEntryCount; index++) { + this.entries.pop(); + } + + for (let entry of updateJSON.entries) { + this.entries.push(entry); + } + + } + + +} diff --git a/Client/src/modules/AMCModule_ContentItem_ConfigurationList.vue b/Client/src/modules/AMCModule_ContentItem_ConfigurationList.vue new file mode 100644 index 00000000..2e221994 --- /dev/null +++ b/Client/src/modules/AMCModule_ContentItem_ConfigurationList.vue @@ -0,0 +1,143 @@ + + + + + \ No newline at end of file diff --git a/Client/src/modules/AMCModule_ContentItem_Form.js b/Client/src/modules/AMCModule_ContentItem_Form.js index 453211e0..6a03f622 100644 --- a/Client/src/modules/AMCModule_ContentItem_Form.js +++ b/Client/src/modules/AMCModule_ContentItem_Form.js @@ -41,6 +41,8 @@ export default class AMCApplicationItem_Content_Form extends Common.AMCApplicati super (moduleInstance, itemJSON.uuid, itemJSON.type); this.registerClass ("amcItem_Form"); + this.visible = true; + Assert.ArrayValue (itemJSON.entities); // TODO: parse input this.entities = itemJSON.entities; @@ -74,6 +76,8 @@ export default class AMCApplicationItem_Content_Form extends Common.AMCApplicati { Assert.ObjectValue (updateJSON); + this.setVisible(updateJSON.visible); + if (updateJSON.entities) { Assert.ArrayValue (updateJSON.entities); @@ -104,6 +108,8 @@ export default class AMCApplicationItem_Content_Form extends Common.AMCApplicati } - - + + setVisible(flag) { + this.visible = !!flag; + } } \ No newline at end of file diff --git a/Client/src/modules/AMCModule_ContentItem_Form.vue b/Client/src/modules/AMCModule_ContentItem_Form.vue index 4325fcd8..e45b8118 100644 --- a/Client/src/modules/AMCModule_ContentItem_Form.vue +++ b/Client/src/modules/AMCModule_ContentItem_Form.vue @@ -30,7 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.