Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: Add the ability to create LVM Logical Volume from Metalk8s UI #3410

Merged
merged 6 commits into from
Jun 3, 2021

Conversation

ChengYanJin
Copy link
Contributor

@ChengYanJin ChengYanJin commented Jun 2, 2021

Component: UI

Context: Add the ability to create LVM Logical Volume from the UI

Summary:
For the batch creation, we only implement the most simple case, in which we can only specify the Name between the volumes.
image

Add interaction test for this kind of volume.

Next step:
We should display a message/notification when the volume is failed to create, for example, the Volume Group doesn't exist.
More generally speaking, we will organise a design workshop with @Cuervino and maybe @JBWatenbergScality @MonPote to decide how to display the message when a failure popup.

Acceptance criteria:


Closes: #3244

@ChengYanJin ChengYanJin requested a review from a team as a code owner June 2, 2021 09:48
@ChengYanJin ChengYanJin force-pushed the improvement/add-lvmvolume-creation-support branch from 7fffb91 to 7d77a8a Compare June 2, 2021 09:58
@ChengYanJin ChengYanJin force-pushed the improvement/add-intergration-test-of-create-volume-error-scenario branch from 341a2f7 to 37c898b Compare June 2, 2021 12:17
@ChengYanJin ChengYanJin force-pushed the improvement/add-lvmvolume-creation-support branch from 3711237 to 95a7986 Compare June 2, 2021 12:18
@@ -711,7 +732,7 @@ const CreateVolume = (props) => {
/>
</SizeUnitFieldSelectContainer>
</SizeFieldContainer>
) : (
) : values.type === RAW_BLOCK_DEVICE ? (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that there is more than 2 options I suggest to refactor this to a switch case

Comment on lines 759 to 800
<>
<SizeFieldContainer>
<Input
name="sizeInput"
type="number"
min="1"
value={values.sizeInput}
onChange={handleChange('sizeInput')}
label={`${intl.translate('volume_size')}*`}
error={touched.sizeInput && errors.sizeInput}
onBlur={handleOnBlur}
/>
<SizeUnitFieldSelectContainer>
<Input
clearable={false}
type="select"
options={optionsSizeUnits}
noOptionsMessage={() =>
intl.translate('no_results')
}
name="selectedUnit"
onChange={handleSelectChange('selectedUnit')}
value={getSelectedObjectItem(
optionsSizeUnits,
values?.selectedUnit,
)}
error={
touched.selectedUnit && errors.selectedUnit
}
onBlur={handleOnBlur}
/>
</SizeUnitFieldSelectContainer>
</SizeFieldContainer>
<Input
name="vgName"
value={values.vgName}
onChange={handleChange('vgName')}
label={`Volume Group Name*`}
error={touched.vgName && errors.vgName}
onBlur={handleOnBlur}
/>
</>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can extract the fields to a component ? It would then make sense to validate those additional fields in that component and just add an onChange handler prop to that component that just addup the fields value to the submitted object.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @JBWatenbergScality
I am not sure of the benefit to extract these fields. For me, it would add some complexity than keep everything centralized. ( but I am open to discuss).

However, I see a reusable combined field sizeInputCombinedField which is used in both SPARSE_LOOP_DEVICE and LVM_LOGICAL_VOLUME
8cd3fda

Base automatically changed from improvement/add-intergration-test-of-create-volume-error-scenario to development/2.10 June 2, 2021 15:57
@bert-e
Copy link
Contributor

bert-e commented Jun 2, 2021

Hello chengyanjin,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Status report is not available.

@bert-e
Copy link
Contributor

bert-e commented Jun 2, 2021

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

@bert-e
Copy link
Contributor

bert-e commented Jun 3, 2021

Conflict

There is a conflict between your branch improvement/add-lvmvolume-creation-support and the
destination branch development/2.10.

Please resolve the conflict on the feature branch (improvement/add-lvmvolume-creation-support).

 $ git fetch
 $ git checkout origin/improvement/add-lvmvolume-creation-support
 $ git merge origin/development/2.10
 $ # <intense conflict resolution>
 $ git commit
 $ git push origin HEAD:improvement/add-lvmvolume-creation-support

@ChengYanJin ChengYanJin force-pushed the improvement/add-lvmvolume-creation-support branch 2 times, most recently from 04adea5 to 9e0ba21 Compare June 3, 2021 12:46
@bert-e
Copy link
Contributor

bert-e commented Jun 3, 2021

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

@ChengYanJin
Copy link
Contributor Author

/approve

@bert-e
Copy link
Contributor

bert-e commented Jun 3, 2021

In the queue

The changeset has received all authorizations and has been added to the
relevant queue(s). The queue(s) will be merged in the target development
branch(es) as soon as builds have passed.

The changeset will be merged in:

  • ✔️ development/2.10

The following branches will NOT be impacted:

  • development/2.0
  • development/2.1
  • development/2.2
  • development/2.3
  • development/2.4
  • development/2.5
  • development/2.6
  • development/2.7
  • development/2.8
  • development/2.9

There is no action required on your side. You will be notified here once
the changeset has been merged. In the unlikely event that the changeset
fails permanently on the queue, a member of the admin team will
contact you to help resolve the matter.

IMPORTANT

Please do not attempt to modify this pull request.

  • Any commit you add on the source branch will trigger a new cycle after the
    current queue is merged.
  • Any commit you add on one of the integration branches will be lost.

If you need this pull request to be removed from the queue, please contact a
member of the admin team now.

The following options are set: approve

@bert-e
Copy link
Contributor

bert-e commented Jun 3, 2021

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/2.10

The following branches have NOT changed:

  • development/2.0
  • development/2.1
  • development/2.2
  • development/2.3
  • development/2.4
  • development/2.5
  • development/2.6
  • development/2.7
  • development/2.8
  • development/2.9

Please check the status of the associated issue None.

Goodbye chengyanjin.

@bert-e bert-e merged commit 320521c into development/2.10 Jun 3, 2021
@bert-e bert-e deleted the improvement/add-lvmvolume-creation-support branch June 3, 2021 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI: Support LVMLogicalVolume volume in the metalk8s-ui
3 participants