Make submit buttons green and add forms (#1302)

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Anbraten <anton@ju60.de>
This commit is contained in:
Lukas 2022-10-22 08:56:23 +02:00 committed by GitHub
parent 186aee61cf
commit a441281bf9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 50 additions and 45 deletions

View file

@ -1,48 +1,50 @@
<template>
<Popup :open="open" @close="$emit('close')">
<Panel v-if="!loading">
<span class="text-xl text-color">{{ $t('repo.manual_pipeline.title') }}</span>
<InputField :label="$t('repo.manual_pipeline.select_branch')">
<SelectField
v-model="payload.branch"
:options="branches"
required
class="dark:bg-dark-gray-700 bg-transparent text-color border-gray-200 dark:border-dark-400"
/>
</InputField>
<InputField :label="$t('repo.manual_pipeline.variables.title')">
<span class="text-sm text-color-alt mb-2">{{ $t('repo.manual_pipeline.variables.desc') }}</span>
<div class="flex flex-col gap-2">
<div v-for="(value, name) in payload.variables" :key="name" class="flex gap-4">
<TextField :model-value="name" disabled />
<TextField :model-value="value" disabled />
<div class="w-34 flex-shrink-0">
<Button type="submit" class="ml-auto" @click="deleteVar(name)">
<i-la-times />
</Button>
<form @submit.prevent="triggerManualPipeline">
<span class="text-xl text-color">{{ $t('repo.manual_pipeline.title') }}</span>
<InputField :label="$t('repo.manual_pipeline.select_branch')">
<SelectField
v-model="payload.branch"
:options="branches"
required
class="dark:bg-dark-gray-700 bg-transparent text-color border-gray-200 dark:border-dark-400"
/>
</InputField>
<InputField :label="$t('repo.manual_pipeline.variables.title')">
<span class="text-sm text-color-alt mb-2">{{ $t('repo.manual_pipeline.variables.desc') }}</span>
<div class="flex flex-col gap-2">
<div v-for="(value, name) in payload.variables" :key="name" class="flex gap-4">
<TextField :model-value="name" disabled />
<TextField :model-value="value" disabled />
<div class="w-34 flex-shrink-0">
<Button color="red" class="ml-auto" @click="deleteVar(name)">
<i-la-times />
</Button>
</div>
</div>
<form class="flex gap-4" @submit.prevent="addPipelineVariable">
<TextField
v-model="newPipelineVariable.name"
:placeholder="$t('repo.manual_pipeline.variables.name')"
required
/>
<TextField
v-model="newPipelineVariable.value"
:placeholder="$t('repo.manual_pipeline.variables.value')"
required
/>
<Button
class="w-34 flex-shrink-0"
start-icon="plus"
type="submit"
:text="$t('repo.manual_pipeline.variables.add')"
/>
</form>
</div>
<form class="flex gap-4" @submit.prevent="addPipelineVariable">
<TextField
v-model="newPipelineVariable.name"
:placeholder="$t('repo.manual_pipeline.variables.name')"
required
/>
<TextField
v-model="newPipelineVariable.value"
:placeholder="$t('repo.manual_pipeline.variables.value')"
required
/>
<Button
class="w-34 flex-shrink-0"
start-icon="plus"
type="submit"
:text="$t('repo.manual_pipeline.variables.add')"
/>
</form>
</div>
</InputField>
<Button type="submit" :text="$t('repo.manual_pipeline.trigger')" @click="triggerManualPipeline" />
</InputField>
<Button type="submit" :text="$t('repo.manual_pipeline.trigger')" />
</form>
</Panel>
</Popup>
</template>
@ -51,6 +53,7 @@
import { onMounted, ref } from 'vue';
import { useRouter } from 'vue-router';
import Button from '~/components/atomic/Button.vue';
import InputField from '~/components/form/InputField.vue';
import SelectField from '~/components/form/SelectField.vue';
import TextField from '~/components/form/TextField.vue';

View file

@ -80,6 +80,7 @@
<Button
type="submit"
color="green"
:is-loading="isSaving"
:text="isEditingCron ? $t('repo.settings.crons.save') : $t('repo.settings.crons.add')"
/>

View file

@ -4,7 +4,7 @@
<h1 class="text-xl ml-2 text-color">{{ $t('repo.settings.general.general') }}</h1>
</div>
<div v-if="repoSettings" class="flex flex-col">
<form v-if="repoSettings" class="flex flex-col" @submit.prevent="saveRepoSettings">
<InputField
docs-url="docs/usage/project-settings#pipeline-path"
:label="$t('repo.settings.general.pipeline_path.path')"
@ -72,13 +72,13 @@
</InputField>
<Button
type="submit"
class="mr-auto"
color="green"
:is-loading="isSaving"
:text="$t('repo.settings.general.save')"
@click="saveRepoSettings"
/>
</div>
</form>
</Panel>
</template>

View file

@ -67,6 +67,7 @@
<Button
type="submit"
color="green"
:is-loading="isSaving"
:text="isEditingRegistry ? $t('repo.settings.registries.save') : $t('repo.settings.registries.add')"
/>

View file

@ -23,8 +23,9 @@
</InputField>
<Button
:is-loading="isSaving"
type="submit"
color="green"
:is-loading="isSaving"
:text="isEditingSecret ? $t(i18nPrefix + 'save') : $t(i18nPrefix + 'add')"
/>
</form>

View file

@ -37,7 +37,6 @@
<Button
v-if="repoPermissions.push"
type="submit"
:text="$t('repo.manual_pipeline.trigger')"
class="ml-auto"
@click="showManualPipelinePopup = true"