I would imagine you wanted to write `when == "ready"` instead of `!requiresAddonGlobal(model)` ?
As `requiresAddonGlobal(model)` will be always false as we first checked it in the first condition.
Wouldn't it be better to throw rather than returning a non-existing type?

Otherwise, getAttachEventType will be a more explicit name, and either use if/else/switch or at the very least indent string (`"sdk-panel-..."`) so that we easily see different returned values.