CreateImageWizard: alphabetize upload destinations

The upload destinations now display in alphabetical order.
This commit is contained in:
Jacob Kozol 2021-06-02 11:59:38 +02:00 committed by Sanne Raymaekers
parent ebdfbbf57d
commit 93d0fdb6fc
3 changed files with 24 additions and 24 deletions

View file

@ -241,31 +241,31 @@ class CreateImageWizard extends Component {
errors={ this.state.uploadAWSErrors } />
};
const StepUploadAzure = {
name: 'Microsoft Azure',
component: <WizardStepUploadAzure
errors={ this.state.uploadAzureErrors } />
};
const StepUploadGoogle = {
name: 'Google Cloud Platform',
component: <WizardStepUploadGoogle
errors={ this.state.uploadGoogleErrors } />
};
const StepUploadAzure = {
name: 'Microsoft Azure',
component: <WizardStepUploadAzure
errors={ this.state.uploadAzureErrors } />
};
const uploadDestinationSteps = [];
if (this.props.uploadDestinations.aws) {
uploadDestinationSteps.push(StepUploadAWS);
}
if (this.props.uploadDestinations.azure) {
uploadDestinationSteps.push(StepUploadAzure);
}
if (this.props.uploadDestinations.google) {
uploadDestinationSteps.push(StepUploadGoogle);
}
if (this.props.uploadDestinations.azure) {
uploadDestinationSteps.push(StepUploadAzure);
}
const StepTargetEnv = {
name: 'Target environment',
steps: uploadDestinationSteps

View file

@ -57,17 +57,6 @@ class WizardStepImageOutput extends Component {
isDisplayLarge />
<Tile
className="tile pf-u-mr-sm"
data-testid="upload-azure"
title="Microsoft Azure"
icon={ <img
className='provider-icon'
src={ '/apps/frontend-assets/partners-icons/microsoft-azure-short.svg' } /> }
onClick={ () => this.toggleUploadDestination('azure') }
isSelected={ this.props.uploadDestinations.azure }
isStacked
isDisplayLarge />
<Tile
className="tile"
data-testid="upload-google"
title="Google Cloud Platform"
icon={ <img
@ -77,6 +66,17 @@ class WizardStepImageOutput extends Component {
isSelected={ this.props.uploadDestinations.google }
isStacked
isDisplayLarge />
<Tile
className="tile"
data-testid="upload-azure"
title="Microsoft Azure"
icon={ <img
className='provider-icon'
src={ '/apps/frontend-assets/partners-icons/microsoft-azure-short.svg' } /> }
onClick={ () => this.toggleUploadDestination('azure') }
isSelected={ this.props.uploadDestinations.azure }
isStacked
isDisplayLarge />
</div>
</FormGroup>
</Form>

View file

@ -455,14 +455,14 @@ describe('Click through all steps', () => {
userEvent.type(screen.getByTestId('aws-account-id'), '012345678901');
next.click();
userEvent.type(screen.getByTestId('input-google-user'), 'test@test.com');
next.click();
userEvent.type(screen.getByTestId('azure-tenant-id'), 'testTenant');
userEvent.type(screen.getByTestId('azure-subscription-id'), 'testSubscriptionId');
userEvent.type(screen.getByTestId('azure-resource-group'), 'testResourceGroup');
next.click();
userEvent.type(screen.getByTestId('input-google-user'), 'test@test.com');
next.click();
// registration
screen
.getByLabelText('Embed an activation key and register systems on first boot')