-
Notifications
You must be signed in to change notification settings - Fork 120
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
Rough User Interface for Creating and Listing Webhooks #52
Conversation
@jessm12 please look at this ..... I know it all needs squashing and bringing up to date etc etc... but would be good to have a look over for glaring issues right now. I'm still working on the tests and also have this list of toDos (minimum) ....
|
formatCellContent(id, value) { | ||
// Render the git repo as a clickable link | ||
if (id.endsWith(":repository")) { | ||
return <a href={value} target="_blank">{value}</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the Link
router component with to
instead of href
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think though am not 100% certain that react's Link is for internal navigation only?? Not going to waste time investigating heavily at this point in time - would also need to work out how to open in new window.
key: 'namespace', | ||
header: 'Namespace', | ||
} | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these keys and headers necessary when the header and key are the same, could you use just a list of header names?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The header and key are subtly different ... there is capitalisation in the Header and in one case spacing ... "Git Repository" ..... the 'key' value is matched in the setting up of initialRows .... so im currently inclined to keep it as it is.
@@ -0,0 +1,185 @@ | |||
.webhook-create { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of comments about styling, where possible rem
is probably preferable over px
, when it's 0 this can be just on its own. Also, there are some carbon preset colours that could be useful if there are colours we like available
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some modifications made
align-items: center; | ||
display: flex; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be able to reduce some duplication of styles here, for example the only difference between these two is the visibility
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@extend added to numerous elements
}; | ||
} | ||
|
||
async fetchNamespaces() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these fetch/get methods be extracted into a different file to be used by the component? I think that could make the code easier to read and would reduce the amount of code in this one file, though I do see they are altering state so might not be an option currently
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather any refactor was done later ... we likely need to look at whether we could/should introduce any redux usage which might further alter things
webhooks-extension/src/WebhookApp.js
Outdated
super(props); | ||
this.state = { | ||
// Used to show webhook created notification on table display | ||
showNotification: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ShowNotification
is a general variable, can it be more specific so it doesn't require comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changing to ShowNotificationOnTable
this.fetchPipelines(itemText.selectedItem); | ||
} | ||
this.fetchSecrets(itemText.selectedItem); | ||
this.fetchServiceAccounts(itemText.selectedItem); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should you be handling the rerender loop here as you are with the fetchPipelines
?
|
||
handleChangeServiceAcct = (itemText, value) => { | ||
this.setState({serviceAccount: itemText.selectedItem }); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to bring these three methods into one method by just substituting the state name, gitsecret etc, also value is not used here
0aaaac4
to
036ada5
Compare
An intial user interface for creating and listing webhooks, this includes the ability to click a link to take you to the git repo. A delete button is provided but the implementation will follow under a separate PR. Tests are also included.
/lgtm /meow dream |
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/approve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/meow boxes
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: a-roberts, dibbles, jessm12, vdemeester The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Changes
User interface for the webhooks extension - admittedly this is quite rough but better to start with something and fix it up.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide
for more details.