Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions ACT/LibMC.xml
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,10 @@
<error name="INVALIDFRONTENDMODULEPATH" code="676" description="Invalid frontend module path." />
<error name="INVALIDFRONTENDATTRIBUTENAME" code="677" description="Invalid frontend attribute name." />
<error name="DUPLICATEFRONTENDATTRIBUTENAME" code="678" description="Duplicate frontend attribute name." />
<error name="INVALIDCOLUMNRANGE" code="679" description="Invalid column range." />
<error name="INVALIDROWRANGE" code="680" description="Invalid row range." />
<error name="CONFIGURATIONLISTNAMEMISSING" code="681" description="Configuration list name missing" />
<error name="CONFIGURATIONLISTBUTTONNAMEMISSING" code="682" description="Configuration list button name missing" />

</errors>

Expand Down
255 changes: 162 additions & 93 deletions ACT/LibMCData.xml

Large diffs are not rendered by default.

297 changes: 224 additions & 73 deletions ACT/LibMCEnv.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Artifacts/clientdist/_githash_client.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
de4928052636939a11b8e223e2f440da41fb23e6
864af701b933b1d4bae3e21bac376e640f076aa3
Binary file modified Artifacts/clientdist/clientpackage.zip
Binary file not shown.
Binary file modified Artifacts/clientdist/clientsourcepackage.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Maintainers are responsible for responding to pull requests and issues, as well

We currently have three maintainers:
- Alexander Oster [email protected]
- Martin Wassmann martin.wassmann@autodesk.com
- Martin Wassmann martin.weismann@autodesk.com
- Philipp Neumann [email protected]

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.
1 change: 1 addition & 0 deletions Client/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

uiOnTimer() {
if (this.Application) {
this.Application.updateModules ();
this.Application.updateContentItems ();
}
},
Expand Down
75 changes: 73 additions & 2 deletions Client/src/common/AMCApplication.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,75 @@

}

}

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;

Check notice on line 498 in Client/src/common/AMCApplication.js

View check run for this annotation

Autodesk Chorus / security/gitleaks

http-header-authorization

HTTP Header Authorization: possible secret committed to source code

// 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");
Expand Down Expand Up @@ -745,6 +811,11 @@
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 ();

Expand Down
10 changes: 10 additions & 0 deletions Client/src/common/AMCPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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, {}, () => {});
}
}

}
17 changes: 15 additions & 2 deletions Client/src/modules/AMCModule_Content.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"



Expand All @@ -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 = [];


Expand Down Expand Up @@ -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);
Expand All @@ -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);
}

}

8 changes: 6 additions & 2 deletions Client/src/modules/AMCModule_Content.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

<ContentItem_ButtonGroup :key="moduleitem.uuid" v-if="(moduleitem.type=='buttongroup')" :moduleitem="moduleitem" :Application="Application" />

<ContentItem_Form :key="moduleitem.uuid" v-if="(moduleitem.type=='form')" :moduleitem="moduleitem" :Application="Application" />
<ContentItem_Form :key="moduleitem.uuid" v-if="(moduleitem.type=='form')" :moduleitem="moduleitem" :Application="Application" :visible="moduleitem.visible"/>

<ContentItem_ConfigurationList :key="moduleitem.uuid" v-if="(moduleitem.type=='configurationlist')" :moduleitem="moduleitem" :Application="Application" />

</template>
</div>
Expand All @@ -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 {
Expand All @@ -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
}

};
Expand Down
140 changes: 140 additions & 0 deletions Client/src/modules/AMCModule_ContentItem_ConfigurationList.js
Original file line number Diff line number Diff line change
@@ -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);
}

}


}
Loading
Loading