Skip to content

Conversation

saumeya
Copy link
Contributor

@saumeya saumeya commented Oct 18, 2021

closes #7214 , this PR is dependent on merging of argo-ui PR PR-160 to add abbreviation prop to autocomplete
STEPS TO RUN (these steps are not needed anymore! )

  1. checkout to this branch in argo-ui - https://github.com/saumeya/argo-ui/tree/autocomplete-abbreviations
  2. Install yalc for linking - npm i -g yalc
  3. Run cd argo-ui , yalc publish this will create the link to the updates argo-ui dependency
  4. To update the npm dependency to local argo-ui link in argo-cd cd argo-cd/ui , yalc add argo-ui
  5. Now compile and run cd argo-cd , make start
    filter-resource

Signed-off-by: saumeya saumeyakatyal@gmail.com

Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).

@saumeya saumeya requested a review from rbreeze October 21, 2021 09:15
@sbose78
Copy link
Contributor

sbose78 commented Oct 21, 2021

What's the best way to try this out?

@saumeya
Copy link
Contributor Author

saumeya commented Oct 26, 2021

What's the best way to try this out?

It is dependent on this - argoproj/argo-ui#160, but i'll add steps for running this.

@saumeya saumeya requested a review from reginapizza October 27, 2021 09:05
Copy link
Member

@rbreeze rbreeze left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@reginapizza
Copy link
Contributor

LGTM except I think you have some type errors that the UI check is yelling at you for in filter.tsx:

TS2322: Type '{ placeholder: string; items: string[]; abbreviations: { [key: string]: string; }; value: string; onChange: (e: ChangeEvent<HTMLInputElement>) => void; onItemClick: (val: string) => void; style: { ...; }; inputStyle: { ...; }; }' is not assignable to type 'IntrinsicAttributes & InputHTMLAttributes<HTMLInputElement> & { items: string[]; inputStyle?: CSSProperties; onItemClick?: (item: string) => void; icon?: string; inputref?: MutableRefObject<...>; }'.
  
Property 'abbreviations' does not exist on type 'IntrinsicAttributes & InputHTMLAttributes<HTMLInputElement> & { items: string[]; inputStyle?: CSSProperties; onItemClick?: (item: string) => void; icon?: string; inputref?: MutableRefObject<...>; }'.

@saumeya saumeya force-pushed the add-abbreviations-autocomplete branch from a1853c2 to 04f4647 Compare October 27, 2021 20:48
@saumeya
Copy link
Contributor Author

saumeya commented Oct 27, 2021

LGTM except I think you have some type errors that the UI check is yelling at you for in filter.tsx:

TS2322: Type '{ placeholder: string; items: string[]; abbreviations: { [key: string]: string; }; value: string; onChange: (e: ChangeEvent<HTMLInputElement>) => void; onItemClick: (val: string) => void; style: { ...; }; inputStyle: { ...; }; }' is not assignable to type 'IntrinsicAttributes & InputHTMLAttributes<HTMLInputElement> & { items: string[]; inputStyle?: CSSProperties; onItemClick?: (item: string) => void; icon?: string; inputref?: MutableRefObject<...>; }'.
  
Property 'abbreviations' does not exist on type 'IntrinsicAttributes & InputHTMLAttributes<HTMLInputElement> & { items: string[]; inputStyle?: CSSProperties; onItemClick?: (item: string) => void; icon?: string; inputref?: MutableRefObject<...>; }'.

yes linking it with the latest argo-ui will resolve that

Signed-off-by: saumeya <saumeyakatyal@gmail.com>
Copy link
Contributor

@reginapizza reginapizza left a comment

Choose a reason for hiding this comment

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

Gotchya, okay LGTM then!

Signed-off-by: saumeya <saumeyakatyal@gmail.com>
@saumeya saumeya force-pushed the add-abbreviations-autocomplete branch from 04f4647 to 2937e81 Compare October 27, 2021 20:58
@codecov
Copy link

codecov bot commented Oct 27, 2021

Codecov Report

Merging #7466 (332e21f) into master (7ced59f) will decrease coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7466      +/-   ##
==========================================
- Coverage   41.40%   41.39%   -0.01%     
==========================================
  Files         161      161              
  Lines       21622    21687      +65     
==========================================
+ Hits         8952     8977      +25     
- Misses      11408    11445      +37     
- Partials     1262     1265       +3     
Impacted Files Coverage Δ
util/db/repository.go 38.46% <0.00%> (-1.54%) ⬇️
util/helm/cmd.go 28.65% <0.00%> (-1.23%) ⬇️
pkg/apis/application/v1alpha1/types.go 57.33% <0.00%> (-0.18%) ⬇️
cmd/argocd/commands/app.go 0.53% <0.00%> (-0.01%) ⬇️
util/db/db.go 84.61% <0.00%> (ø)
util/helm/helm.go 60.81% <0.00%> (ø)
util/helm/helmver.go 80.00% <0.00%> (ø)
util/settings/settings.go 46.83% <0.00%> (ø)
cmd/argocd/commands/account.go 0.00% <0.00%> (ø)
controller/metrics/metrics.go 80.00% <0.00%> (+0.13%) ⬆️
... and 6 more

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 7ced59f...332e21f. Read the comment docs.

@wtam2018
Copy link
Contributor

@alexmt
LGTM

@@ -837,6 +837,37 @@ export const ResourceKinds = [
'Volume'
];

export const ResourceKindShortnames: {[key: string]: string} = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We already have shortnames for most of k8s resources in resource.ts:

export const resources = new Map<string, string>([
['ClusterRole', 'c-role'],
['ConfigMap', 'cm'],
['ClusterRoleBinding', 'crb'],
['CustomResourceDefinition', 'crd'],
['CronJob', 'cronjob'],
['Deployment', 'deploy'],

Your list introduces some additional kinds. Can you please merge additional kinds into existing list and use it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, i'll have to create a new PR for argo-ui as well because this will change the prop type.

Signed-off-by: saumeya <saumeyakatyal@gmail.com>
@saumeya
Copy link
Contributor Author

saumeya commented Nov 1, 2021

Dependent on merging of argoproj/argo-ui#163

Signed-off-by: saumeya <saumeyakatyal@gmail.com>
@saumeya saumeya requested a review from alexmt November 2, 2021 11:57
Copy link
Collaborator

@alexmt alexmt left a comment

Choose a reason for hiding this comment

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

LGTM

@alexmt alexmt merged commit c2b3e74 into argoproj:master Nov 2, 2021
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.

Filters should favor matching on short names
6 participants