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

feat: add ability to delete specific tag #391

Closed
wants to merge 5 commits into from

Conversation

eviishondell
Copy link

What type of PR is this?

Which issue does this PR fix:

What does this PR do / Why do we need it:

If an issue # is not available please add repro steps and logs from IPAMD/CNI showing the issue:

Testing done on this change:

Automation added to e2e:

Will this break upgrades or downgrades. Has updating a running cluster been tested?:

Does this change require updates to the CNI daemonset config files to work?:

Does this PR introduce any user-facing change?:


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

codecov bot commented Nov 15, 2023

Codecov Report

Attention: 33 lines in your changes are missing coverage. Please review.

Comparison is base (b41fb2f) 86.73% compared to head (6ce53fe) 84.46%.
Report is 2 commits behind head on main.

Files Patch % Lines
src/components/Shared/TagCard.jsx 5.00% 19 Missing ⚠️
src/components/Repo/RepoDetails.jsx 21.42% 11 Missing ⚠️
src/setupProxy.js 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #391      +/-   ##
==========================================
- Coverage   86.73%   84.46%   -2.27%     
==========================================
  Files          53       54       +1     
  Lines        1553     1590      +37     
  Branches      406      415       +9     
==========================================
- Hits         1347     1343       -4     
- Misses        193      235      +42     
+ Partials       13       12       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please don't add or change packages unless they are required for the implementation

Copy link
Author

Choose a reason for hiding this comment

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

just reverted it back, didn't realize i changed it sorry!!

@@ -242,7 +242,29 @@ function RepoDetails() {
: `Timestamp N/A`;
return lastDate;
};

const handleDeleteRepo = () => {
const confirmed = window.confirm('Are you sure you want to delete this repo?');
Copy link
Collaborator

Choose a reason for hiding this comment

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

We implemend dialogs using MUI's dialog component, not the native window API, check FilterDialog used in the ExplorePage for example.

const handleDeleteRepo = () => {
const confirmed = window.confirm('Are you sure you want to delete this repo?');
if (confirmed) {
const apiUrl = `http://localhost:3000/v2/${name}/manifests/`;
Copy link
Collaborator

Choose a reason for hiding this comment

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

We declare our endpoints inside the api.js file. and send requests using axios not fetch. Check the api.js file and usage of api thought the project for examples.
Also, the backend host is declared in the hosts.js file, don't hardcode it inside code

.then((response) => {
if (response.status === 202) {
// Repo deleted successfully
console.log('Repo deleted successfully');
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't leave console logs inside code after finishing implementation

<IconButton
color="primary"
style={{ marginLeft: 'auto' }}
onClick={() => {
Copy link
Collaborator

@raulkele raulkele Nov 15, 2023

Choose a reason for hiding this comment

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

In general, if your function is longer than 1 line, you want to declare it outside the JSX. Also, same thing about using the window.confirm api

console.log('Button clicked and confirmed!');
console.log(props);
console.log('REPONAME: ', repoName);
const apiUrl = `http://localhost:3000/v2/${repoName}/manifests/${tag}`;
Copy link
Collaborator

Choose a reason for hiding this comment

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

api.js for backend requests

@@ -1,6 +1,6 @@
const hostConfig = {
auto: true,
default: 'http://localhost:5000'
auto: false,
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't push this, keep only on local

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure what this is but it definitely shouldn't be here

@raulkele
Copy link
Collaborator

Also, you need to squash your commits so you only have 1

@andaaron
Copy link
Contributor

Superseded by #401

@andaaron andaaron closed this Dec 17, 2023
@rchincha
Copy link
Contributor

@eviishondell Thanks for your PR.

@eviishondell
Copy link
Author

@eviishondell Thanks for your PR.

No problem!

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.

4 participants