Skip to content

Commit 891224c

Browse files
feature: 增加skipci 预览
1 parent e6c6231 commit 891224c

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/main/java/com/fulinlin/ui/setting/TemplateEditPanel.form

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
<border type="none"/>
137137
<children/>
138138
</grid>
139-
<grid id="f209d" layout-manager="GridLayoutManager" row-count="1" column-count="6" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
139+
<grid id="f209d" layout-manager="GridLayoutManager" row-count="1" column-count="7" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
140140
<margin top="0" left="0" bottom="0" right="700"/>
141141
<constraints>
142142
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
@@ -198,6 +198,15 @@
198198
<text value="scope"/>
199199
</properties>
200200
</component>
201+
<component id="c62e3" class="javax.swing.JCheckBox" binding="skipCiCheckBox" default-binding="true">
202+
<constraints>
203+
<grid row="0" column="6" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
204+
</constraints>
205+
<properties>
206+
<selected value="true"/>
207+
<text value="skip ci"/>
208+
</properties>
209+
</component>
201210
</children>
202211
</grid>
203212
</children>

src/main/java/com/fulinlin/ui/setting/TemplateEditPanel.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public class TemplateEditPanel {
4848
private JCheckBox bodyCheckBox;
4949
private JCheckBox changesCheckBox;
5050
private JCheckBox closedCheckBox;
51+
private JCheckBox skipCiCheckBox;
5152

5253

5354
public TemplateEditPanel(GitCommitMessageHelperSettings settings) {
@@ -113,7 +114,7 @@ public void documentChanged(@NotNull DocumentEvent event) {
113114
bodyCheckBox.addChangeListener(e -> showPreview());
114115
changesCheckBox.addChangeListener(e -> showPreview());
115116
closedCheckBox.addChangeListener(e -> showPreview());
116-
117+
skipCiCheckBox.addChangeListener(e -> showPreview());
117118
// Init typeEditPanel
118119
aliasTable = new AliasTable();
119120
typeEditPanel.add(
@@ -165,6 +166,9 @@ private void showPreview() {
165166
if (closedCheckBox.isSelected()) {
166167
commitTemplate.setCloses("<closes>");
167168
}
169+
if (skipCiCheckBox.isSelected()) {
170+
commitTemplate.setSkipCi("<skipCi>");
171+
}
168172
ApplicationManager.getApplication().runWriteAction(() -> {
169173
String previewTemplate = templateEditor.getDocument().getText().replaceAll("\\n", "");
170174
previewEditor.getDocument().setText(VelocityUtils.convert(previewTemplate, commitTemplate));

0 commit comments

Comments
 (0)