Skip to content
Snippets Groups Projects

Add custom headers form to streaming audit events

3 files
+ 484
23
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -10,7 +10,7 @@ import {
@@ -10,7 +10,7 @@ import {
GlTableLite,
GlTableLite,
} from '@gitlab/ui';
} from '@gitlab/ui';
import { cloneDeep } from 'lodash';
import { cloneDeep } from 'lodash';
import createFlash from '~/flash';
import { createAlert } from '~/flash';
import { thWidthPercent } from '~/lib/utils/table_utility';
import { thWidthPercent } from '~/lib/utils/table_utility';
import externalAuditEventDestinationCreate from '../../graphql/create_external_destination.mutation.graphql';
import externalAuditEventDestinationCreate from '../../graphql/create_external_destination.mutation.graphql';
import {
import {
@@ -70,15 +70,17 @@ export default {
@@ -70,15 +70,17 @@ export default {
const { errors } = data.externalAuditEventDestinationCreate;
const { errors } = data.externalAuditEventDestinationCreate;
if (errors.length > 0) {
if (errors.length > 0) {
createFlash({
createAlert({
message: errors[0],
message: errors[0],
});
});
} else {
} else {
this.$emit('added');
this.$emit('added');
}
}
} catch (e) {
} catch (e) {
createFlash({
createAlert({
message: CREATING_ERROR,
message: CREATING_ERROR,
 
captureError: true,
 
error: e,
});
});
} finally {
} finally {
this.loading = false;
this.loading = false;
@@ -189,6 +191,7 @@ export default {
@@ -189,6 +191,7 @@ export default {
<gl-form-input
<gl-form-input
v-model="destinationUrl"
v-model="destinationUrl"
:placeholder="$options.i18n.DESTINATION_URL_PLACEHOLDER"
:placeholder="$options.i18n.DESTINATION_URL_PLACEHOLDER"
 
data-testid="destination-url"
/>
/>
</gl-form-group>
</gl-form-group>
@@ -241,7 +244,11 @@ export default {
@@ -241,7 +244,11 @@ export default {
<gl-button category="tertiary" icon="remove" @click="removeCustomHeader(index)" />
<gl-button category="tertiary" icon="remove" @click="removeCustomHeader(index)" />
</template>
</template>
</gl-table-lite>
</gl-table-lite>
<p v-if="hasMaxCustomHeaders" class="gl-mt-5 gl-mb-0 gl-text-gray-500">
<p
 
v-if="hasMaxCustomHeaders"
 
class="gl-mt-5 gl-mb-0 gl-text-gray-500"
 
data-testid="maximum-custom-headers"
 
>
<gl-sprintf :message="$options.i18n.MAXIMUM_HEADERS_TEXT">
<gl-sprintf :message="$options.i18n.MAXIMUM_HEADERS_TEXT">
<template #number>
<template #number>
{{ $options.MAX_CUSTOM_HEADERS }}
{{ $options.MAX_CUSTOM_HEADERS }}
Loading