Skip to content

Commit

Permalink
[AXON-117] Fix 'Create issue webview' stuck on the loader (#130)
Browse files Browse the repository at this point in the history
* Fix 'Create issue webview' stuck on the loader
* added changelog
  • Loading branch information
marcomura authored Feb 19, 2025
1 parent a90428d commit 6156d53
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## What's new in 3.4.7

### Bug Fixes

- Fixed 'Create Jira issue' page getting stuck on the loader when the first Jira server is unreachable.

## What's new in 3.4.6

### Features
Expand Down
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 6156d53

Please sign in to comment.