Skip to content

Commit

Permalink
update valid env var pattern (#3175)
Browse files Browse the repository at this point in the history
  • Loading branch information
christianvogt authored Sep 10, 2024
1 parent 1785e82 commit 1f59036
Show file tree
Hide file tree
Showing 18 changed files with 122 additions and 105 deletions.
72 changes: 36 additions & 36 deletions frontend/src/__mocks__/mockConnectionType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ const mockFields: ConnectionTypeField[] = [
type: 'short-text',
name: 'Short text 1',
description: 'Test short text',
envVar: 'short-text-1',
envVar: 'short_text_1',
required: false,
properties: {},
},
{
type: 'short-text',
name: 'Short text 2',
description: 'Test short text with default value',
envVar: 'short-text-2',
envVar: 'short_text_2',
required: true,
properties: {
defaultValue: 'This is the default value',
Expand All @@ -95,7 +95,7 @@ const mockFields: ConnectionTypeField[] = [
type: 'short-text',
name: 'Short text 3',
description: 'Test short text with default value and read only',
envVar: 'short-text-3',
envVar: 'short_text_3',
required: false,
properties: {
defaultValue: 'This is the default value and is read only',
Expand All @@ -106,7 +106,7 @@ const mockFields: ConnectionTypeField[] = [
type: 'short-text',
name: 'Short text 4',
description: 'Test short text with no default value and read only',
envVar: 'short-text-4',
envVar: 'short_text_4',
required: false,
properties: {
defaultReadOnly: true,
Expand All @@ -122,15 +122,15 @@ const mockFields: ConnectionTypeField[] = [
type: 'text',
name: 'Text 1',
description: 'Test text',
envVar: 'text-1',
envVar: 'text_1',
required: false,
properties: {},
},
{
type: 'text',
name: 'Text 2',
description: 'Test text with default value',
envVar: 'text-2',
envVar: 'text_2',
required: true,
properties: {
defaultValue: 'This is the default value\nOne\nTwo\nThree\nFour',
Expand All @@ -141,7 +141,7 @@ const mockFields: ConnectionTypeField[] = [
type: 'text',
name: 'Text 3',
description: 'Test text with default value and read only',
envVar: 'text-3',
envVar: 'text_3',
required: false,
properties: {
defaultValue: 'This is the default value\nOne\nTwo\nThree\nFour',
Expand All @@ -152,7 +152,7 @@ const mockFields: ConnectionTypeField[] = [
type: 'text',
name: 'Text 4',
description: 'Test text with no default value and read only',
envVar: 'text-4',
envVar: 'text_4',
required: false,
properties: {
defaultReadOnly: true,
Expand All @@ -168,15 +168,15 @@ const mockFields: ConnectionTypeField[] = [
type: 'hidden',
name: 'Hidden 1',
description: 'Test hidden',
envVar: 'hidden-1',
envVar: 'hidden_1',
required: false,
properties: {},
},
{
type: 'hidden',
name: 'Hidden 2',
description: 'Test hidden with default value',
envVar: 'hidden-2',
envVar: 'hidden_2',
required: true,
properties: {
defaultValue: 'This is the default value',
Expand All @@ -187,7 +187,7 @@ const mockFields: ConnectionTypeField[] = [
type: 'hidden',
name: 'Hidden 3',
description: 'Test hidden with default value and read only',
envVar: 'hidden-3',
envVar: 'hidden_3',
required: false,
properties: {
defaultValue: 'This is the default value',
Expand All @@ -198,7 +198,7 @@ const mockFields: ConnectionTypeField[] = [
type: 'hidden',
name: 'Hidden 4',
description: 'Test hidden with no default value and read only',
envVar: 'hidden-4',
envVar: 'hidden_4',
required: false,
properties: {
defaultReadOnly: true,
Expand All @@ -214,15 +214,15 @@ const mockFields: ConnectionTypeField[] = [
type: 'uri',
name: 'URI 1',
description: 'Test URI',
envVar: 'uri-1',
envVar: 'uri_1',
required: false,
properties: {},
},
{
type: 'uri',
name: 'URI 2',
description: 'Test URI with default value',
envVar: 'uri-2',
envVar: 'uri_2',
required: true,
properties: {
defaultValue: 'https://www.redhat.com',
Expand All @@ -233,7 +233,7 @@ const mockFields: ConnectionTypeField[] = [
type: 'uri',
name: 'URI 3',
description: 'Test URI with default value and read only',
envVar: 'uri-3',
envVar: 'uri_3',
required: false,
properties: {
defaultValue: 'https://www.redhat.com',
Expand All @@ -244,7 +244,7 @@ const mockFields: ConnectionTypeField[] = [
type: 'uri',
name: 'URI 4',
description: 'Test URI with no default value and read only',
envVar: 'uri-4',
envVar: 'uri_4',
required: false,
properties: {
defaultReadOnly: true,
Expand All @@ -260,15 +260,15 @@ const mockFields: ConnectionTypeField[] = [
type: 'file',
name: 'File 1',
description: 'Test file',
envVar: 'file-1',
envVar: 'file_1',
required: false,
properties: {},
},
{
type: 'file',
name: 'File 2',
description: 'Test file with default value',
envVar: 'file-2',
envVar: 'file_2',
required: true,
properties: {
defaultValue: 'This is the default value',
Expand All @@ -279,7 +279,7 @@ const mockFields: ConnectionTypeField[] = [
type: 'file',
name: 'File 3',
description: 'Test file with default value and read only',
envVar: 'file-3',
envVar: 'file_3',
required: false,
properties: {
defaultValue: 'This is the default value',
Expand All @@ -290,7 +290,7 @@ const mockFields: ConnectionTypeField[] = [
type: 'file',
name: 'File 4',
description: 'Test file with no default value and read only',
envVar: 'file-4',
envVar: 'file_4',
required: false,
properties: {
defaultReadOnly: true,
Expand All @@ -306,15 +306,15 @@ const mockFields: ConnectionTypeField[] = [
type: 'boolean',
name: 'Boolean 1',
description: 'Test boolean',
envVar: 'boolean-1',
envVar: 'boolean_1',
required: false,
properties: {},
},
{
type: 'boolean',
name: 'Boolean 2',
description: 'Test boolean with default value',
envVar: 'boolean-2',
envVar: 'boolean_2',
required: true,
properties: {
label: 'Input label',
Expand All @@ -326,7 +326,7 @@ const mockFields: ConnectionTypeField[] = [
type: 'boolean',
name: 'Boolean 3',
description: 'Test boolean with default value and read only',
envVar: 'boolean-3',
envVar: 'boolean_3',
required: false,
properties: {
label: 'Input label',
Expand All @@ -338,7 +338,7 @@ const mockFields: ConnectionTypeField[] = [
type: 'boolean',
name: 'Boolean 4',
description: 'Test boolean with no default value and read only',
envVar: 'boolean-4',
envVar: 'boolean_4',
required: false,
properties: {
label: 'Input label',
Expand All @@ -355,15 +355,15 @@ const mockFields: ConnectionTypeField[] = [
type: 'numeric',
name: 'Numeric 1',
description: 'Test numeric',
envVar: 'numeric-1',
envVar: 'numeric_1',
required: false,
properties: {},
},
{
type: 'numeric',
name: 'Numeric 2',
description: 'Test numeric with default value',
envVar: 'numeric-2',
envVar: 'numeric_2',
required: true,
properties: {
defaultValue: 2,
Expand All @@ -374,7 +374,7 @@ const mockFields: ConnectionTypeField[] = [
type: 'numeric',
name: 'Numeric 3',
description: 'Test numeric with default value and read only',
envVar: 'numeric-3',
envVar: 'numeric_3',
required: false,
properties: {
defaultValue: 2,
Expand All @@ -385,7 +385,7 @@ const mockFields: ConnectionTypeField[] = [
type: 'numeric',
name: 'Numeric 4',
description: 'Test numeric with no default value and read only',
envVar: 'numeric-4',
envVar: 'numeric_4',
required: false,
properties: {
defaultReadOnly: true,
Expand All @@ -401,7 +401,7 @@ const mockFields: ConnectionTypeField[] = [
type: 'dropdown',
name: 'Dropdown single 1',
description: 'Test dropdown single variant',
envVar: 'dropdown-single-1',
envVar: 'dropdown_single_1',
required: false,
properties: {
variant: 'single',
Expand All @@ -417,7 +417,7 @@ const mockFields: ConnectionTypeField[] = [
type: 'dropdown',
name: 'Dropdown single 2',
description: 'Test dropdown single variant with default value',
envVar: 'dropdown-2',
envVar: 'dropdown_2',
required: true,
properties: {
variant: 'single',
Expand All @@ -435,7 +435,7 @@ const mockFields: ConnectionTypeField[] = [
type: 'dropdown',
name: 'Dropdown single 3',
description: 'Test dropdown single variant with default value and read only',
envVar: 'dropdown-3',
envVar: 'dropdown_3',
required: true,
properties: {
variant: 'single',
Expand All @@ -453,7 +453,7 @@ const mockFields: ConnectionTypeField[] = [
type: 'dropdown',
name: 'Dropdown single 4',
description: 'Test dropdown single variant with no default value and read only',
envVar: 'dropdown-4',
envVar: 'dropdown_4',
required: true,
properties: {
variant: 'single',
Expand All @@ -476,7 +476,7 @@ const mockFields: ConnectionTypeField[] = [
type: 'dropdown',
name: 'Dropdown multi 1',
description: 'Test dropdown multi variant',
envVar: 'dropdown-multi-1',
envVar: 'dropdown_multi_1',
required: false,
properties: {
variant: 'multi',
Expand All @@ -492,7 +492,7 @@ const mockFields: ConnectionTypeField[] = [
type: 'dropdown',
name: 'Dropdown multi 2',
description: 'Test dropdown multi variant with default values',
envVar: 'dropdown-multi-2',
envVar: 'dropdown_multi_2',
required: false,
properties: {
variant: 'multi',
Expand All @@ -510,7 +510,7 @@ const mockFields: ConnectionTypeField[] = [
type: 'dropdown',
name: 'Dropdown multi 3',
description: 'Test dropdown multi variant with default values and read only',
envVar: 'dropdown-multi-3',
envVar: 'dropdown_multi_3',
required: false,
properties: {
variant: 'multi',
Expand All @@ -528,7 +528,7 @@ const mockFields: ConnectionTypeField[] = [
type: 'dropdown',
name: 'Dropdown multi 4',
description: 'Test dropdown multi variant with no default values and read only',
envVar: 'dropdown-multi-4',
envVar: 'dropdown_multi_4',
required: false,
properties: {
variant: 'multi',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,14 @@ describe('edit', () => {
{
type: 'short-text',
name: 'field1',
envVar: 'short-text-1',
envVar: 'short_text_1',
required: false,
properties: {},
},
{
type: 'short-text',
name: 'field2',
envVar: 'short-text-2',
envVar: 'short_text_2',
required: true,
properties: {},
},
Expand Down Expand Up @@ -216,7 +216,7 @@ describe('edit', () => {
{
type: 'short-text',
name: 'field1',
envVar: 'short-text-1',
envVar: 'short_text_1',
properties: {},
},
{
Expand All @@ -226,7 +226,7 @@ describe('edit', () => {
{
type: 'short-text',
name: 'field2',
envVar: 'short-text-2',
envVar: 'short_text_2',
properties: {},
},
{
Expand All @@ -236,7 +236,7 @@ describe('edit', () => {
{
type: 'short-text',
name: 'field3',
envVar: 'short-text-3',
envVar: 'short_text_3',
properties: {},
},
],
Expand Down
Loading

0 comments on commit 1f59036

Please sign in to comment.