MS: User Tasks with Space and User Data Access#730
Conversation
…ery time a user task is opened to ensure that the the data of the current worker is always correctly inserted
…s/proceed into ms/user-task-data-access
…ons for organization and user data
|
✅ Successfully created Preview Deployment. |
| varPath = varPath.split('.').slice(1).join('.'); | ||
| } else { | ||
| throw new Error(`Unable to get data for global variable (@global.${varPath}).`); | ||
| return; |
There was a problem hiding this comment.
Wouldn't throwing an error be a better approach instead of simply returning?
|
|
||
| const startInstance = async (versionId: string, variables: { [key: string]: any } = {}) => { | ||
| if (engines?.length) | ||
| if (engines?.length) { |
There was a problem hiding this comment.
I think it prevents attempting to start an instance when no engines are available.
So the question is: should this throw an error instead of silently returning undefined? Alternatively, if we are confident that an engine will always be available, we might even remove the if check.
I mean the if check seems unnecessary here. isn't it?
| } else if (segments[0] === '@worker' || !segments[0].startsWith('@')) { | ||
| ({ userId } = await getCurrentUser()); | ||
| } else if (segments[0] !== '@organization') { | ||
| console.error(`Invalid selector for global data access in user task html. (${segments[0]})`); |
There was a problem hiding this comment.
Why don't we throw an error here instead of logging?
|
|
||
| if (isErrorResponse(result)) { | ||
| console.error( | ||
| 'Ecountered error while trying to get global variable for user task rendering:', |
There was a problem hiding this comment.
same question as above. also the error string has minor typo: Ecountered
Zayn-Javed
left a comment
There was a problem hiding this comment.
very well. please have a look at these minor things.
Summary
Added handling of global data from a space in the MS in User Tasks in the MS task list.
Details