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

Rough User Interface for Creating and Listing Webhooks #52

Merged
merged 1 commit into from
Jun 13, 2019

Conversation

dibbles
Copy link
Member

@dibbles dibbles commented Jun 5, 2019

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.

@tekton-robot tekton-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jun 5, 2019
@dibbles
Copy link
Member Author

dibbles commented Jun 5, 2019

@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) ....

  • Architecture decision, should namespace menu on left affect the web hook display table
  • Spinner on table load should be table skeleton
  • Carbon guidelines / Accessibility etc
  • Change validation to be on click of create, use red boxes (Webhook)
    • Validate display name chars (steal from main dashboard)
    • Validate URL entry (steal from main dashboard)
    • Validate docker registry field ?
  • Change validation to be on click of create, use red boxes (Access Token)
  • Fix password area (couple of characters behind eye)
  • Tab navigation around panels
  • Better add button or just Icon
  • Namespace should not be query parameter on POST
  • Close button on notifications

@a-roberts a-roberts requested review from jessm12 and removed request for akihikokuroda and vtereso June 5, 2019 14:09
formatCellContent(id, value) {
// Render the git repo as a clickable link
if (id.endsWith(":repository")) {
return <a href={value} target="_blank">{value}</a>
Copy link
Member

@jessm12 jessm12 Jun 6, 2019

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

Copy link
Member Author

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',
}
];
Copy link
Member

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?

Copy link
Member Author

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 {

Copy link
Member

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

Copy link
Member Author

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;
}

Copy link
Member

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

Copy link
Member Author

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() {
Copy link
Member

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

Copy link
Member Author

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

super(props);
this.state = {
// Used to show webhook created notification on table display
showNotification: false,
Copy link
Member

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

Copy link
Member Author

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);
Copy link
Member

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 });
}
Copy link
Member

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

@dibbles dibbles force-pushed the ui2 branch 4 times, most recently from 0aaaac4 to 036ada5 Compare June 13, 2019 09:19
@dibbles dibbles changed the title DO NOT MERGE Work In Progress - Rough User Interface Rough User Interface for Creating and Listing Webhooks Jun 13, 2019
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.
@jessm12
Copy link
Member

jessm12 commented Jun 13, 2019

/lgtm
/approve

/meow dream

@tekton-robot
Copy link

@jessm12: cat image

In response to this:

/lgtm
/approve

/meow dream

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.

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 13, 2019
@a-roberts
Copy link
Member

/approve

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

/meow boxes

@tekton-robot
Copy link

@vdemeester: cat image

In response to this:

/meow boxes

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.

@tekton-robot
Copy link

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 13, 2019
@tekton-robot tekton-robot merged commit a149f04 into tektoncd:master Jun 13, 2019
@dibbles dibbles deleted the ui2 branch June 28, 2019 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants