Fix label rendering

This commit is contained in:
Half-Shot 2022-05-06 17:28:24 +01:00
parent 55b10b43f3
commit 5676e06234
3 changed files with 17 additions and 1 deletions

View File

@ -52,6 +52,9 @@ type AllowedEventsNames =
"merge_request.review.comments" |
`merge_request.${string}` |
"merge_request" |
"issue.created" |
"issue.closed" |
"issue" |
"tag_push" |
"push" |
"wiki" |
@ -66,6 +69,9 @@ const AllowedEvents: AllowedEventsNames[] = [
"merge_request.review",
"merge_request.review.comments",
"merge_request",
"issue.created",
"issue.closed",
"issue",
"tag_push",
"push",
"wiki",

View File

@ -0,0 +1,4 @@
.checkboxLabel {
left: auto !important;
margin: 0 !important;
}

View File

@ -5,6 +5,7 @@ import { ConnectionConfigurationProps, RoomConfig } from "./RoomConfig";
import { GitLabRepoConnectionState, GitLabRepoResponseItem, GitLabTargetFilter, GitLabRepoConnectionTarget, GitLabRepoConnectionProjectTarget, GitLabRepoConnectionInstanceTarget } from "../../../src/Connections/GitlabRepo";
import { InputField, ButtonSet, Button, ErrorPane } from "../elements";
import GitLabIcon from "../../icons/gitlab.png";
import style from "./GitlabRepoConfig.module.scss";
const EventType = "uk.half-shot.matrix-hookshot.gitlab.repository";
@ -104,7 +105,7 @@ const EventCheckbox: FunctionComponent<{
parentEvent?: string,
}> = ({ignoredHooks, onChange, eventName, parentEvent, children}) => {
return <li>
<label>
<label className={style.checkboxLabel}>
<input
disabled={parentEvent && ignoredHooks.includes(parentEvent)}
type="checkbox"
@ -162,6 +163,11 @@ const ConnectionConfiguration: FunctionComponent<ConnectionConfigurationProps<ne
<EventCheckbox ignoredHooks={ignoredHooks} parentEvent="merge_request" eventName="merge_request.merge" onChange={toggleIgnoredHook}>Merged</EventCheckbox>
<EventCheckbox ignoredHooks={ignoredHooks} parentEvent="merge_request" eventName="merge_request.review" onChange={toggleIgnoredHook}>Reviewed</EventCheckbox>
</ul>
<EventCheckbox ignoredHooks={ignoredHooks} eventName="issue" onChange={toggleIgnoredHook}>Issues</EventCheckbox>
<ul>
<EventCheckbox ignoredHooks={ignoredHooks} parentEvent="issue" eventName="issue.created" onChange={toggleIgnoredHook}>Opened</EventCheckbox>
<EventCheckbox ignoredHooks={ignoredHooks} parentEvent="issue" eventName="issue.closed" onChange={toggleIgnoredHook}>Closed</EventCheckbox>
</ul>
<EventCheckbox ignoredHooks={ignoredHooks} eventName="push" onChange={toggleIgnoredHook}>Pushes</EventCheckbox>
<EventCheckbox ignoredHooks={ignoredHooks} eventName="tag_push" onChange={toggleIgnoredHook}>Tag pushes</EventCheckbox>
<EventCheckbox ignoredHooks={ignoredHooks} eventName="wiki" onChange={toggleIgnoredHook}>Wiki page updates</EventCheckbox>