Skip to content

Commit e22383d

Browse files
Added patch and tag version
Signed-off-by: Steve Springett <steve@springett.us>
1 parent 290122c commit e22383d

File tree

1 file changed

+56
-4
lines changed

1 file changed

+56
-4
lines changed

src/components/FormPanel.vue

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,39 @@
7171
</button>
7272
</div>
7373
</div>
74+
75+
<div class="form-group">
76+
<label for="patch">Patch</label>
77+
<div class="input-refresh-wrapper">
78+
<select v-model="form.patch" id="patch">
79+
<option :value="true">True</option>
80+
<option :value="false">False</option>
81+
</select>
82+
</div>
83+
</div>
84+
85+
<div class="form-group">
86+
<label for="tagId">TAG VERSION</label>
87+
<div class="input-refresh-wrapper">
88+
<input
89+
type="number"
90+
id="tagId"
91+
v-model="form.tagVersion"
92+
required
93+
readonly
94+
@input="validateField('tagId')"
95+
:class="{'invalid-input': !form.tagId}"
96+
>
97+
<button type="button" @click="decrementTagVersion" class="refresh-button">
98+
<i class="fas fa-minus" style="color:#26c1c9"></i>
99+
</button>
100+
<button type="button" @click="incrementTagVersion" class="refresh-button">
101+
<i class="fas fa-plus" style="color:#26c1c9"></i>
102+
</button>
103+
</div>
104+
</div>
105+
106+
74107
</template>
75108
</vue-collapsible-panel>
76109
<vue-collapsible-panel :expanded="false">
@@ -134,6 +167,8 @@ export default {
134167
regId: 'example.com',
135168
tagCreatorName: '',
136169
tagRegId: '',
170+
tagVersion: 0,
171+
patch: false
137172
},
138173
isRegIdValid: true,
139174
isTagRegIdValid: true,
@@ -208,9 +243,25 @@ export default {
208243
qualifiers.tag_creator_regid = this.form.tagRegId;
209244
}
210245
246+
if (this.form.patch === true) {
247+
qualifiers.patch = this.form.patch;
248+
}
249+
250+
if (this.form.tagVersion > 0) {
251+
qualifiers.tag_version = this.form.tagVersion;
252+
}
253+
211254
const purl = new PackageURL('swid', namespace, this.form.name, this.form.version, qualifiers, null);
212255
this.packageUrl = purl.toString();
213-
}
256+
},
257+
incrementTagVersion() {
258+
this.form.tagVersion += 1;
259+
},
260+
decrementTagVersion() {
261+
if (this.form.tagVersion > 0) {
262+
this.form.tagVersion -= 1;
263+
}
264+
},
214265
},
215266
};
216267
</script>
@@ -244,7 +295,7 @@ export default {
244295
color: #A9C7DF;
245296
}
246297
.form-group input,
247-
.form-group textarea {
298+
.form-group textarea, select {
248299
width: 100%;
249300
padding: 10px;
250301
background-color: #222C3C;
@@ -254,15 +305,16 @@ export default {
254305
transition: border-color 0.3s ease-in-out;
255306
}
256307
.form-group input:focus,
257-
.form-group textarea:focus {
308+
.form-group textarea:focus,
309+
.form-group select:focus {
258310
border-color: #0093EE;
259311
outline: none;
260312
}
261313
.input-refresh-wrapper {
262314
display: flex;
263315
align-items: center;
264316
}
265-
.input-refresh-wrapper input {
317+
.input-refresh-wrapper input, .input-refresh-wrapper select {
266318
flex-grow: 1;
267319
}
268320
.input-refresh-wrapper button {

0 commit comments

Comments
 (0)