Skip to content
This repository was archived by the owner on Jan 11, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
473199d
Update forge.bim.issues.report.js
Agkdesign Nov 6, 2019
9d34829
Update forge.bim.issues.report.js
Agkdesign Nov 6, 2019
182fede
Update forge.bim.issues.report.js
Agkdesign Nov 6, 2019
2daaf8f
Update forge.bim.issues.report.js
Agkdesign Nov 6, 2019
30052eb
Update forge.bim.issues.report.js
Agkdesign Nov 11, 2019
1b0cf6c
Update forge.bim.issues.report.js
Agkdesign Nov 11, 2019
be5b049
Update bim.issues.endpoint.report.js
Agkdesign Nov 11, 2019
df4d502
Update bim.issues.endpoint.report.js
Agkdesign Nov 11, 2019
81ebae4
Update forge.bim.issues.report.js
Agkdesign Nov 11, 2019
18c939f
Update bim.issues.endpoint.report.js
Agkdesign Nov 11, 2019
2a40815
Update bim.issues.endpoint.report.js
Agkdesign Nov 11, 2019
922f37f
Update bim.issues.endpoint.report.js
Agkdesign Nov 11, 2019
fa6534a
Update bim.issues.endpoint.report.js
Agkdesign Nov 11, 2019
13e3208
Add files via upload
Agkdesign Nov 11, 2019
f7cb048
Add files via upload
Agkdesign Nov 11, 2019
871257f
Add files via upload
Agkdesign Nov 11, 2019
f2e7feb
Add files via upload
Agkdesign Nov 11, 2019
e58990f
Add files via upload
Agkdesign Nov 11, 2019
6aa572c
Update forge.bim.issues.report.js
Agkdesign Nov 11, 2019
afbc31b
Update forge.bim.issues.report.js
Agkdesign Nov 11, 2019
50404b2
Update forge.bim.issues.report.js
Agkdesign Nov 11, 2019
e81f72e
Add files via upload
Agkdesign Nov 11, 2019
5562334
Update forge.bim.issues.report.js
Agkdesign Nov 11, 2019
51d92ff
Update index.html
Agkdesign Nov 11, 2019
0610960
Update bim.database.js
Agkdesign Nov 12, 2019
89b7017
Add files via upload
Agkdesign Nov 12, 2019
fb429e6
Add files via upload
Agkdesign Nov 12, 2019
ce647d4
Add files via upload
Agkdesign Nov 12, 2019
8f05a3c
Add files via upload
Agkdesign Nov 12, 2019
6a13b2c
Add files via upload
Agkdesign Nov 12, 2019
57dee55
Add files via upload
Agkdesign Nov 12, 2019
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
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"forge-apis": "0.4.1",
"formidable": "^1.2.1",
"isomorphic-fetch": "^2.2.1",
"lodash": "^4.17.11",
"lodash": ">4.17.13",
"moment": "2.19.3",
"octicons": "^8.0.0",
"popper.js": "^1.14.3",
Expand Down
22 changes: 22 additions & 0 deletions server/bim.database.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ module.exports = {
bimDatabase[hubId].projects[projectId].photoFolderId = null;
bimDatabase[hubId].projects[projectId].fieldRootcauses = null;
bimDatabase[hubId].projects[projectId].fieldIssueTypes = null;
bimDatabase[hubId].projects[projectId].companies = null;
bimDatabase[hubId].projects[projectId].roles = null;
}
},
refreshProjectInfo:function(hubId,projectId,v){
Expand All @@ -68,6 +70,10 @@ module.exports = {
bimDatabase[hubId].projects[projectId].fieldIssueTypes = v.fieldIssueTypes;
if(v.projectName)
bimDatabase[hubId].projects[projectId].projectName = v.projectName;
if(v.companies)
bimDatabase[hubId].projects[projectId].companies = v.companies;
if(v.roles)
bimDatabase[hubId].projects[projectId].roles = v.roles;
}
},
getProjectRootContents:function(hubId,projectId){
Expand Down Expand Up @@ -126,6 +132,22 @@ module.exports = {
}
}
},
getCompaniesByContainer:function(containerId){
for(var hubId in bimDatabase){
for(var projectId in bimDatabase[hubId].projects){
if(bimDatabase[hubId].projects[projectId].issuesContainerId == containerId)
return bimDatabase[hubId].projects[projectId].companies;
}
}
},
getRolesByContainer:function(containerId){
for(var hubId in bimDatabase){
for(var projectId in bimDatabase[hubId].projects){
if(bimDatabase[hubId].projects[projectId].issuesContainerId == containerId)
return bimDatabase[hubId].projects[projectId].roles;
}
}
},
refreshDumpIssue:function(containerId,_json,isDoc){
if(containerId in bimDatabase)
isDoc?bimDatabase[containerId].doc_all_issue_json = _json:
Expand Down
201 changes: 103 additions & 98 deletions server/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
// UNINTERRUPTED OR ERROR FREE.
/////////////////////////////////////////////////////////////////////

'use strict';
'use strict';

module.exports = {

// this this callback URL when creating your client ID and secret
//set enviroment variables or hard-code here

callbackURL: process.env.FORGE_CALLBACK_URL ||
'<your web host url>/api/forge/callback/oauth',
callbackURL: process.env.FORGE_CALLBACK_URL ||
'<your web host url>/api/forge/callback/oauth',

// set enviroment variables or hard-code here
//apply your Forge client credential
Expand All @@ -34,131 +34,136 @@ module.exports = {
client_secret: process.env.FORGE_CLIENT_SECRET || '<your Forge client secret>'
},


//input your website url such as
//http://mywebsite.com/webhook/itemAdded
webhookCallBackURL: process.env.FORGE_WEBHOOK_URL + '/webhook/itemAdded' ||
'<your web host url>/webhook/itemAdded',
webhookCallBackURL: process.env.FORGE_WEBHOOK_URL + '/webhook/itemAdded' ||
'<your web host url>/webhook/itemAdded',

//input your own link for posting message to your own Slack channel
//check the Slack help:
//https://api.slack.com/tutorials/slack-apps-hello-world
slackPostMessageURL:process.env.SLACK_POST_MESSAGE_URL || '<your link of Slack post message>',
slackPostMessageURL: process.env.SLACK_POST_MESSAGE_URL || '<your link of Slack post message>',

scope: {
// scope for user 3-legged token
scopeUserServer: ['data:read', 'data:write', 'data:create'],
//scope for account Project ,Design Automation,2-legged token
scopeAdmin: ['data:read',
'data:write',
'data:create',
'data:search',
'account:read',
'code:all'],
'data:write',
'data:create',
'data:search',
'account:read',
'code:all'],
//scope for load forge viewer only, 3-legged token
scopeUserClient: ['viewables:read']
},

//some endpoints have not been packaged with Forge SDK
//most endpoints of Issue API use the same kind of header

//some endpoints have not been packaged with Forge SDK
//most endpoints of Issue API use the same kind of header

hqv1: {
userprofile_useratme: 'https://developer.api.autodesk.com/userprofile/v1/users/@me'

hqv1: {
userprofile_useratme: 'https://developer.api.autodesk.com/userprofile/v1/users/@me',
getCompanies: function (account_id, project_id) {
return 'https://developer.api.autodesk.com/hq/v1/accounts/' + account_id + '/projects/' + project_id + '/companies'
},
//Issue API v1
fieldissuev1: {

basedUrl: 'https://developer.api.autodesk.com/issues/v1/containers/',
httpHeaders: function (access_token) {
return {
Authorization: 'Bearer ' + access_token,
'Content-Type': 'application/vnd.api+json'
}
},
getIssues: function (containerId, filter = '') {
return this.basedUrl + containerId + '/quality-issues' + filter;
},
getComments: function (containerId, issueId) {
return this.basedUrl + containerId + '/quality-issues/' + issueId + '/comments';
},
getAttachments: function (containerId, issueId) {
return this.basedUrl + containerId + '/quality-issues/' + issueId + '/attachments'
},
getOneIssue: function (containerId, issueId) {
return this.basedUrl + containerId + '/quality-issues/' + issueId;
},
createComments: function(containerId) {
return this.basedUrl + containerId + '/comments';
},
createAttachments: function (containerId) {
return this.basedUrl + containerId + '/attachments';;
},
getFieldIssueType:function(containerId){
return this.basedUrl + containerId + '/issue-types';;
},
getFieldRootCause:function(containerId){
return this.basedUrl + containerId + '/root-causes';;
getRoles: function (account_id, project_id) {
return 'https://developer.api.autodesk.com/hq/v2/accounts/' + account_id + '/projects/' + project_id + '/industry_roles'
}
},
//Issue API v1
fieldissuev1: {

basedUrl: 'https://developer.api.autodesk.com/issues/v1/containers/',
httpHeaders: function (access_token) {
return {
Authorization: 'Bearer ' + access_token,
'Content-Type': 'application/vnd.api+json'
}
},

//when v2 is released, will replace with those new endpoints.
fieldissuev2: {
//
getIssues: function (containerId, filter = '') {
return this.basedUrl + containerId + '/quality-issues' + filter;
},
getComments: function (containerId, issueId) {
return this.basedUrl + containerId + '/quality-issues/' + issueId + '/comments';
},
getAttachments: function (containerId, issueId) {
return this.basedUrl + containerId + '/quality-issues/' + issueId + '/attachments'
},
getOneIssue: function (containerId, issueId) {
return this.basedUrl + containerId + '/quality-issues/' + issueId;
},
createComments: function (containerId) {
return this.basedUrl + containerId + '/comments';
},
createAttachments: function (containerId) {
return this.basedUrl + containerId + '/attachments';;
},
getFieldIssueType: function (containerId) {
return this.basedUrl + containerId + '/ng-issue-types?include=subtypes'
},
getFieldRootCause: function (containerId) {
return this.basedUrl + containerId + '/root-causes';;
}
},

//Design Automation V2
dav2:{

createWorkItem:function(){
return 'https://developer.api.autodesk.com/autocad.io/us-east/v2/WorkItems'
}
//when v2 is released, will replace with those new endpoints.
fieldissuev2: {
//
},

//Design Automation V2
dav2: {

createWorkItem: function () {
return 'https://developer.api.autodesk.com/autocad.io/us-east/v2/WorkItems'
}
},
//Design Automation V3
dav3: {

createWorkItem: function () {
return 'https://developer.api.autodesk.com/da/us-east/v3/workitems'
},
//Design Automation V3
dav3:{

createWorkItem:function(){
return 'https://developer.api.autodesk.com/da/us-east/v3/workitems'
},
getWorkItemStatus:function(id){
return 'https://developer.api.autodesk.com/da/us-east/v3/workitems/'+id
},
dwgToPDFActName:'<your activiy name of v3 DA>'
getWorkItemStatus: function (id) {
return 'https://developer.api.autodesk.com/da/us-east/v3/workitems/' + id
},
webhook:{
httpHeaders: function (access_token) {
return {
Authorization: 'Bearer ' + access_token,
'Content-Type': 'application/json'
}
},
getWebhook:function(system,event){
return 'https://developer.api.autodesk.com/webhooks/v1/systems/'+
dwgToPDFActName: '<your activiy name of v3 DA>'
},
webhook: {
httpHeaders: function (access_token) {
return {
Authorization: 'Bearer ' + access_token,
'Content-Type': 'application/json'
}
},
getWebhook: function (system, event) {
return 'https://developer.api.autodesk.com/webhooks/v1/systems/' +
system +
'/events/'+
event+
'/hooks';
},
createWebhook:function(system,event){
return 'https://developer.api.autodesk.com/webhooks/v1/systems/'+
'/events/' +
event +
'/hooks';
},
createWebhook: function (system, event) {
return 'https://developer.api.autodesk.com/webhooks/v1/systems/' +
system +
'/events/'+
event+
'/hooks';
},
patchWebhook:function(system,event,hookId){
return 'https://developer.api.autodesk.com/webhooks/v1/systems/'+
'/events/' +
event +
'/hooks';
},
patchWebhook: function (system, event, hookId) {
return 'https://developer.api.autodesk.com/webhooks/v1/systems/' +
system +
'/events/'+
event+
'/hooks/'+
hookId;
},
deleteWebHook:function(){
'/events/' +
event +
'/hooks/' +
hookId;
},
deleteWebHook: function () {

}
}

}

};
5 changes: 4 additions & 1 deletion server/endpoints/bim.issues.endpoint.csv.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ router.get('/issuecsv/startjob',jsonParser, function (req, res) {
if(!input.isDocIssue){
header.push({id: 'rootcause', title: 'Root Cause'})
header.push({id: 'issuetype', title: 'Issue Type'}),
header.push({id: 'subissuetype', title: 'Sub Issue Type'}),
header.push({id: 'associateChecklist', title: 'Associated to checklist?'})
//check custom fields
if(input.withCustomFields && input.allIssues[0].attributes.custom_attributes){
Expand All @@ -167,6 +168,7 @@ router.get('/issuecsv/startjob',jsonParser, function (req, res) {
location:eachIssue.attributes.location_description,
status:eachIssue.attributes.status,
assigned_to: utility.checkAssignTo(input.hubId,
input.containerId,
eachIssue.attributes.assigned_to_type,
eachIssue.attributes.assigned_to),
assignee_type:eachIssue.attributes.assigned_to_type,
Expand All @@ -188,7 +190,8 @@ router.get('/issuecsv/startjob',jsonParser, function (req, res) {

if(!input.isDocIssue){
thisRecord.rootcause = eachIssue.attributes.root_cause;
thisRecord.issuetype = utility.findIssueType(input.containerId,eachIssue.attributes.issue_type);
thisRecord.issuetype = utility.findIssueType(input.containerId,eachIssue.attributes.ng_issue_type_id);
thisRecord.subissuetype = utility.findSubIssueType(input.containerId,eachIssue.attributes.ng_issue_subtype_id);
thisRecord.associateChecklist = 'NO';
if(input.withCustomFields && eachIssue.attributes.custom_attributes){
var customFields = eachIssue.attributes.custom_attributes;
Expand Down
9 changes: 8 additions & 1 deletion server/endpoints/bim.issues.endpoint.report.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,10 @@ function dumpDocsIssueReports(isDocIssue,hubId,containerId,
if(!isDocIssue)
{
issueByRootcause(eachIssue.attributes.root_cause,issue_stats_json);
issueByType(eachIssue.attributes.issue_type,
issueByType(eachIssue.attributes.ng_issue_type_id,
containerId,issue_stats_json);
issueBySubType(eachIssue.attributes.ng_issue_subtype_id,
containerId,issue_stats_json);
}

});
Expand Down Expand Up @@ -225,4 +227,9 @@ function issueByType(type,containerId,issue_stats_json){
issue_stats_json.type[typeStr] = 1;
}

function issueBySubType(type,containerId,issue_stats_json){
var typeStr = utility.findSubIssueType(containerId,type)
//TODO
}

module.exports = router
18 changes: 15 additions & 3 deletions server/endpoints/dm.endpoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,17 @@ function getAllProjectContent(projects,userServerToken) {
bimDatabase.refreshProjectInfo(hubId,projectId,
{rootFolderContents:result.contents})

return hubsServices.getProjectCompanies(subInput);
})
.then(function (result) {
console.log('refreshing companies of one project')
bimDatabase.refreshProjectInfo(hubId,projectId,{companies:result.companies })
return hubsServices.getProjectRoles(subInput);
})
.then(function (result) {
console.log('refreshing roles of one project')
bimDatabase.refreshProjectInfo(hubId,projectId,{roles:result.roles })

subInput.oAuth = subInput.userServerToken.oAuth;
subInput.credentials = subInput.userServerToken.credentials;
return bimIssuesServicesRead.getFieldIssueTypes(subInput);
Expand All @@ -213,9 +224,10 @@ function getAllProjectContent(projects,userServerToken) {
})
.then(function (result) {
console.log('refreshing field root causes of one project')
bimDatabase.refreshProjectInfo(hubId,projectId,{fieldIssueTypes:result.fieldRootcauses })
console.log('one project dump succeeded!');
})
bimDatabase.refreshProjectInfo(hubId,projectId,{fieldRootcauses:result.fieldRootcauses })
console.log('one project dump succeeded!');

})
.catch(function (error) {
console.log('one project dump failed!');
});
Expand Down
Loading