Skip to content
This repository has been archived by the owner on Jan 7, 2022. It is now read-only.

Change default owning application for event type, query create to an empty value #151

Merged
merged 4 commits into from
Sep 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions client/Pages/EventTypeCreate/Models.elm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Pages.EventTypeCreate.Models exposing (Field(..), Model, Operation(..), defaultApplication, defaultRetentionDays, defaultSchema, defaultSql, defaultValues, initialModel, loadValues)
module Pages.EventTypeCreate.Models exposing (Field(..), Model, Operation(..), defaultRetentionDays, defaultSchema, defaultSql, defaultValues, initialModel, loadValues)

import Config exposing (appPreffix)
import Constants exposing (emptyString)
Expand Down Expand Up @@ -86,15 +86,10 @@ defaultRetentionDays =
1


defaultApplication : String
defaultApplication =
appPreffix ++ "nakadi-ui-elm"


defaultValues : ValuesDict
defaultValues =
[ ( FieldName, emptyString )
, ( FieldOwningApplication, defaultApplication )
, ( FieldOwningApplication, "" )
, ( FieldCategory, categories.business )
, ( FieldPartitionStrategy, partitionStrategies.random )
, ( FieldPartitionsNumber, "1" )
Expand Down
9 changes: 2 additions & 7 deletions client/Pages/SubscriptionCreate/Models.elm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Pages.SubscriptionCreate.Models exposing (Field(..), Model, Operation(..), allReadFrom, cloneValues, copyValues, defaultApplication, defaultValues, initialModel, readFrom)
module Pages.SubscriptionCreate.Models exposing (Field(..), Model, Operation(..), allReadFrom, cloneValues, copyValues, defaultValues, initialModel, readFrom)

import Config exposing (appPreffix)
import Constants exposing (emptyString)
Expand Down Expand Up @@ -76,15 +76,10 @@ allReadFrom =
]


defaultApplication : String
defaultApplication =
appPreffix ++ "nakadi-ui-elm"


defaultValues : ValuesDict
defaultValues =
[ ( FieldConsumerGroup, emptyString )
, ( FieldOwningApplication, defaultApplication )
, ( FieldOwningApplication, emptyString )
, ( FieldReadFrom, readFrom.end )
, ( FieldEventTypes, emptyString )
]
Expand Down
6 changes: 5 additions & 1 deletion tests/end2end/createEtForm.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ describe('Create Event type form', function() {
})
.selectByValue("#eventTypeCreateFormFieldAudience", 'component-internal')
.isEnabled('button=Create Event Type').then(function(enabled) {
expect(enabled).toBeTruthy('Submit btn should be enabled if name is set')
expect(enabled).toBeFalsy('Submit btn should be disabled if owning application is not set')
})
.setValue('#eventTypeCreateFormFieldOwningApplication', 'stups_nakadi-ui-elm')
.isEnabled('button=Create Event Type').then(function(enabled) {
expect(enabled).toBeTruthy('Submit btn should be enabled if name and owning app are set')
})
.click('button=Create Event Type')
.waitForVisible(`span*=${eventTypeName}`, 10000)
Expand Down
1 change: 1 addition & 0 deletions tests/end2end/createSubscriptionForm.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ describe('Create Subscription form', function() {
})
.setValue('#subscriptionCreateFormFieldConsumerGroup', 'test-group')
.setValue('#subscriptionCreateFormFieldEventTypes', eventTypeName)
.setValue('#subscriptionCreateFormFieldOwningApplication', 'stups_nakadi-ui-elm')
.isEnabled('button=Create Subscription').then(function(enabled) {
expect(enabled).toBeTruthy('Submit btn should be enabled if name is set')
})
Expand Down