Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Refactors Labels Component to Shared TKG Labels #2515

Merged
merged 4 commits into from
Jun 6, 2022
Merged

Refactors Labels Component to Shared TKG Labels #2515

merged 4 commits into from
Jun 6, 2022

Conversation

mpanchajanya
Copy link
Contributor

@mpanchajanya mpanchajanya commented May 28, 2022

What this PR does / why we need it

Which issue(s) this PR fixes

Fixes #

Describe testing done for PR

Release note

1) new FormUtils.addDynamicControl method
2) usage of FormArray for labels
3) Usage of Reactive Form Validations from Rxweb
4) tkg-labels shared component

PR Checklist

  • Squash the commits into one or a small number of logical commits
  • Use good commit messages
  • Ensure PR contains terms all contributors can understand and links all contributors can access

Additional information

Special notes for your reviewer

@github-actions
Copy link

Hi @mpanchajanya! And thank you for opening your first Pull Request. Someone will review it soon. Thank you for committing to making Tanzu Framework better.

import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import {NgModule} from '@angular/core';
Copy link
Contributor

Choose a reason for hiding this comment

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

please update your IDE settings to revert removal of the spaces between {} and []

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

/packages/**/.imgpkg
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we don't generally add IDE-specific files to the repo (you can add them locally).
IFF we do decide to do so, I would suggest just ignoring the .idea directory, rather than all these specific files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved .idea files to my local global .gitignore

import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import {NgModule} from '@angular/core';
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: we're trying to keep imports alphabetized (within the three sections of Angular, 3rd party, app)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

}

protected storeUserData() {
this.storeUserDataFromMapping(this.supplyStepMapping());
this.storeDefaultDisplayOrder(this.supplyStepMapping());
}

private supplyStepMapping(): StepMapping {
return this.stepMapping ?? MetadataStepMapping;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure it makes sense to return the default MetadataStepMapping if this.stepMapping is null/undefined. Is this.stepMapping === null/undefined a legitimate state?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

refactored

};
}

export interface TKGLabel<K = string, V = string> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a case where we would use TKGLabel for a type other than string?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

refactored to use string

<clr-tooltip>
<clr-icon a11yTooltipTrigger aria-live="assertive" shape="info-circle" size="22"></clr-icon>
<clr-tooltip-content *clrIfOpen clrPosition="top-right" clrSize="lg">
<span>
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: odd indentation here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed the indentation

this.labelsFormArray.valueChanges
.pipe(takeUntil(this.stopSubscriptions$), distinctUntilChanged())
.subscribe(() => {
setTimeout(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious about this setTimeout(): is it necessary, and if so, do we know why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was using it for testing. removed now

@@ -47,4 +47,11 @@ hack/providers-sync-tools/**/build
# Build artifacts related to packages
Copy link
Contributor

Choose a reason for hiding this comment

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

probably best to just revert any changes to this file. I'm not sure why it got updated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved .idea files to my local global .gitignore

@mpanchajanya mpanchajanya marked this pull request as ready for review June 2, 2022 19:56
@mpanchajanya mpanchajanya requested review from a team as code owners June 2, 2022 19:56
@vuil
Copy link
Contributor

vuil commented Jun 3, 2022

welcome @mpanchajanya !
nit: please provide a more describe PR title

@mpanchajanya mpanchajanya changed the title TKG Labels Refactors Labels Component to Shared TKG Labels Jun 3, 2022
# Conflicts:
#	pkg/v1/tkg/web/package-lock.json
@github-actions
Copy link

github-actions bot commented Jun 3, 2022

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/2515/20220603183555/clustergen.diff.txt
Author/reviewers:
Please review to verify that the effects on the generated cluster configurations are exactly what the PR intended, and give a thumbs-up if so.

@codecov
Copy link

codecov bot commented Jun 3, 2022

Codecov Report

Merging #2515 (9f324f9) into main (4494221) will increase coverage by 0.07%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #2515      +/-   ##
==========================================
+ Coverage   42.32%   42.39%   +0.07%     
==========================================
  Files         398      398              
  Lines       39693    39704      +11     
==========================================
+ Hits        16799    16834      +35     
+ Misses      21308    21287      -21     
+ Partials     1586     1583       -3     
Impacted Files Coverage Δ
pkg/v1/tkg/tkgpackageclient/package_update.go 83.57% <0.00%> (-1.43%) ⬇️
addons/controllers/clusterbootstrap_controller.go 69.20% <0.00%> (+0.98%) ⬆️
...ons/controllers/packageinstallstatus_controller.go 82.79% <0.00%> (+2.15%) ⬆️
...kr/webhook/cluster/tkr-resolver/cluster/cluster.go 69.60% <0.00%> (+6.91%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4494221...9f324f9. Read the comment docs.

Copy link
Contributor

@miclettej miclettej left a comment

Choose a reason for hiding this comment

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

Very nice!

@miclettej miclettej added ok-to-merge PRs should be labelled with this before merging area/ui Specific UI issue/enhancement labels Jun 6, 2022
@github-actions
Copy link

github-actions bot commented Jun 6, 2022

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/2515/20220606160000/clustergen.diff.txt
Author/reviewers:
Please review to verify that the effects on the generated cluster configurations are exactly what the PR intended, and give a thumbs-up if so.

@miclettej miclettej merged commit e723ae6 into vmware-tanzu:main Jun 6, 2022
ankeesler pushed a commit to ankeesler/tanzu-framework that referenced this pull request Jun 14, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
area/ui Specific UI issue/enhancement cla-not-required ok-to-merge PRs should be labelled with this before merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants