Skip to content

Commit

Permalink
Fix 'Create issue webview' stuck on the loader
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomura committed Feb 18, 2025
1 parent 9fe90a5 commit 0e7ce90
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
5 changes: 1 addition & 4 deletions src/webviews/components/issue/CreateIssuePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,7 @@ export default class CreateIssuePage extends AbstractIssueEditorPage<Emit, Accep
}

public render() {
if (
!this.state.fieldValues['issuetype'] ||
(this.state.fieldValues['issuetype'].id === '' && !this.state.isErrorBannerOpen && this.state.isOnline)
) {
if (!this.state.fieldValues['issuetype']?.id && !this.state.isErrorBannerOpen && this.state.isOnline) {
this.postMessage({ action: 'refresh' });
return <AtlLoader />;
}
Expand Down
21 changes: 10 additions & 11 deletions src/webviews/createIssueWebview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
isScreensForSite,
isSetIssueType,
} from '../ipc/issueActions';
import { WebViewID } from '../lib/ipc/models/common';
import { CreateMetaTransformerResult, FieldValues, IssueTypeUI, ValueType } from '@atlassianlabs/jira-pi-meta-models';
import { DetailedSiteInfo, Product, ProductJira, emptySiteInfo } from '../atlclients/authInfo';
import { IssueType, Project, emptyIssueType } from '@atlassianlabs/jira-pi-common-models';
Expand Down Expand Up @@ -74,7 +75,7 @@ export class CreateIssueWebview
return 'Create Jira Issue';
}
public get id(): string {
return 'atlascodeCreateIssueScreen';
return WebViewID.CreateJiraIssueWebview;
}

public get siteOrUndefined(): DetailedSiteInfo | undefined {
Expand Down Expand Up @@ -266,16 +267,14 @@ export class CreateIssueWebview
};
}

if (this._screenData) {
const createData: CreateIssueData = this._screenData.issueTypeUIs[
this._selectedIssueTypeId
] as CreateIssueData;
createData.type = 'update';
createData.transformerProblems = Container.config.jira.showCreateIssueProblems
? this._screenData.problems
: {};
this.postMessage(createData);
}
const createData: CreateIssueData = this._screenData.issueTypeUIs[
this._selectedIssueTypeId
] as CreateIssueData;
createData.type = 'update';
createData.transformerProblems = Container.config.jira.showCreateIssueProblems
? this._screenData.problems
: {};
this.postMessage(createData);
} catch (e) {
const err = new Error(`error updating issue fields: ${e}`);
Logger.error(err);
Expand Down

0 comments on commit 0e7ce90

Please sign in to comment.