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

Commit

Permalink
Merge pull request #151 from zalando-nakadi/default-owning-app-remove
Browse files Browse the repository at this point in the history
Change default owning application for event type, query create to an empty value
  • Loading branch information
antban authored Sep 9, 2021
2 parents 33d0cf4 + 5a7b1d5 commit 4e29869
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
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

0 comments on commit 4e29869

Please sign in to comment.