Kevin Jump
02/28/2024, 6:37 PMts
const addServerModalContext = this._modalContext?.open(USYNC_PUBLISHSER_ADD_SERVER_MODAL, {
data: {
serverName: name,
serverUrl: url}
});
then in that modal I don't seem to be able to consume the workspace context ?
ts
this.consumeContext(USYNC_PUBLISHER_DASHBOARD_CONTEXT_TOKEN, (_context) => {
console.log('add server, consumed context');
this._context = _context;
});
(so it never logs)
the consume context does work in the workspace view, so i know i "can" consume the context
so ,
1. are workspace context's scoped, and because i am opening a modal, i am no longer in the workspace ?
2. have i done something wrong, should i be able to get to the context in the modal ?
if its 1. ..
can i scope my modal into the workspace ? or do i have to make a global context, for things i want in it and the other workspace ?Kevin Jump
02/28/2024, 6:39 PMWarren Buckley
02/28/2024, 6:53 PMWarren Buckley
02/28/2024, 6:57 PMWarren Buckley
02/28/2024, 6:57 PMKevin Jump
02/28/2024, 7:01 PMWarren Buckley
02/28/2024, 7:02 PMKevin Jump
02/28/2024, 7:07 PMWarren Buckley
02/28/2024, 7:14 PMNiels Lyngsø
02/28/2024, 7:15 PMWarren Buckley
02/28/2024, 7:19 PMNiels Lyngsø
02/28/2024, 7:20 PMNiels Lyngsø
02/28/2024, 7:23 PMoriginTarget
of the arguments your sending to ModalManagerContext.open(alias/token, args);
like this:
modalManagerContext.open('my-modal-alias-or-token', {originTarget: this})
// 'this' because I assume you are in a web-component and this is therefor an element.
But this really sucks that you have to remember, so I'm not far from changing that into this:
modalManagerContext.open(this, 'my-modal-alias-or-token', {other not required args...})Kevin Jump
02/28/2024, 7:28 PMNiels Lyngsø
02/28/2024, 7:29 PMNiels Lyngsø
02/28/2024, 7:30 PMA hub and casual space for you to interact with fellow community members and learn more about Umbraco!
Powered by