mirror of
https://github.com/stablyai/orca.git
synced 2026-11-02 18:17:36 +00:00
fix(jira): show linked workspaces in Has Workspace by matching the Jira login, not its label (#29201)
* fix(jira): match workspace links by site identity, not account label Jira links saved the account email as accountLabel while the Tasks page source used the site display name, so sameSource() rejected every link and the "Has Workspace" view stayed empty (STA-10654, #29055). Jira connection identity is hostId + providerIdentity.siteId (per login per site), so link matching, cmd-J workspace lookup and duplicate-link detection now compare siteId for Jira and treat accountLabel as display-only. All Jira label producers share getJiraAccountLabel so labels stay consistent. * refactor(jira): simplify Has Workspace link matching after review Match Jira workspace links by host only in sameSource, since siteId checks downstream already separate logins; give getJiraAccountLabel a plain structural parameter; make the other-login test use a reachable state.
This commit is contained in:
@@ -142,6 +142,21 @@ export function areTaskSourceContextsEqual(
|
||||
)
|
||||
}
|
||||
|
||||
/** Jira identity is siteId (site + login); its label is display-only. Callers match providers first. */
|
||||
export function haveConflictingTaskSourceAccounts(
|
||||
a: Pick<TaskSourceContext, 'provider' | 'providerIdentity' | 'accountLabel'>,
|
||||
b: Pick<TaskSourceContext, 'provider' | 'providerIdentity' | 'accountLabel'>
|
||||
): boolean {
|
||||
if (a.provider === 'jira') {
|
||||
const left = a.providerIdentity?.provider === 'jira' ? a.providerIdentity.siteId : null
|
||||
const right = b.providerIdentity?.provider === 'jira' ? b.providerIdentity.siteId : null
|
||||
return Boolean(left && right && left !== right)
|
||||
}
|
||||
const left = a.accountLabel?.trim()
|
||||
const right = b.accountLabel?.trim()
|
||||
return Boolean(left && right && left !== right)
|
||||
}
|
||||
|
||||
export function getTaskSourceRuntimeSettings(
|
||||
context: Pick<TaskSourceContext, 'hostId'> | null | undefined
|
||||
): Pick<GlobalSettings, 'activeRuntimeEnvironmentId'> {
|
||||
|
||||
Reference in New Issue
Block a user