@@ -59,7 +59,7 @@ import com.vaticle.typedb.studio.service.Service
5959import com.vaticle.typedb.studio.service.common.util.Label
6060import com.vaticle.typedb.studio.service.common.util.Property
6161import com.vaticle.typedb.studio.service.common.util.Property.Server.TYPEDB_CORE
62- import com.vaticle.typedb.studio.service.common.util.Property.Server.TYPEDB_ENTERPRISE
62+ import com.vaticle.typedb.studio.service.common.util.Property.Server.TYPEDB_CLOUD
6363import com.vaticle.typedb.studio.service.common.util.Sentence
6464import com.vaticle.typedb.studio.service.connection.DriverState.Status.CONNECTED
6565import com.vaticle.typedb.studio.service.connection.DriverState.Status.CONNECTING
@@ -78,8 +78,8 @@ object ServerDialog {
7878 private class ConnectServerForm : Form .State () {
7979 var server: Property .Server by mutableStateOf(appData.server ? : Property .Server .TYPEDB_CORE )
8080 var coreAddress: String by mutableStateOf(appData.coreAddress ? : " " )
81- var enterpriseAddresses : MutableList <String > = mutableStateListOf<String >().also {
82- appData.enterpriseAddresses ?.let { saved -> it.addAll(saved) }
81+ var cloudAddresses : MutableList <String > = mutableStateListOf<String >().also {
82+ appData.cloudAddresses ?.let { saved -> it.addAll(saved) }
8383 }
8484 var username: String by mutableStateOf(appData.username ? : " " )
8585 var password: String by mutableStateOf(" " )
@@ -89,22 +89,22 @@ object ServerDialog {
8989 override fun cancel () = Service .driver.connectServerDialog.close()
9090 override fun isValid (): Boolean = when (server) {
9191 TYPEDB_CORE -> coreAddress.isNotBlank() && addressFormatIsValid(coreAddress)
92- TYPEDB_ENTERPRISE -> ! (enterpriseAddresses .isEmpty() || username.isBlank() || password.isBlank())
92+ TYPEDB_CLOUD -> ! (cloudAddresses .isEmpty() || username.isBlank() || password.isBlank())
9393 }
9494
9595 override fun submit () {
9696 when (server) {
9797 TYPEDB_CORE -> Service .driver.tryConnectToTypeDBCoreAsync(coreAddress) {
9898 Service .driver.connectServerDialog.close()
9999 }
100- TYPEDB_ENTERPRISE -> Service .driver.tryConnectToTypeDBEnterpriseAsync (
101- enterpriseAddresses .toSet(), username, password, tlsEnabled, caCertificate
100+ TYPEDB_CLOUD -> Service .driver.tryConnectToTypeDBCloudAsync (
101+ cloudAddresses .toSet(), username, password, tlsEnabled, caCertificate
102102 ) { Service .driver.connectServerDialog.close() }
103103 }
104104 password = " "
105105 appData.server = server
106106 appData.coreAddress = coreAddress
107- appData.enterpriseAddresses = enterpriseAddresses
107+ appData.cloudAddresses = cloudAddresses
108108 appData.username = username
109109 appData.tlsEnabled = tlsEnabled
110110 appData.caCertificate = caCertificate
@@ -114,11 +114,11 @@ object ServerDialog {
114114 private object AddAddressForm : Form.State() {
115115 var value: String by mutableStateOf(" " )
116116 override fun cancel () = Service .driver.manageAddressesDialog.close()
117- override fun isValid () = value.isNotBlank() && addressFormatIsValid(value) && ! state.enterpriseAddresses .contains(value)
117+ override fun isValid () = value.isNotBlank() && addressFormatIsValid(value) && ! state.cloudAddresses .contains(value)
118118
119119 override fun submit () {
120120 assert (isValid())
121- state.enterpriseAddresses .add(value)
121+ state.cloudAddresses .add(value)
122122 value = " "
123123 }
124124 }
@@ -131,7 +131,7 @@ object ServerDialog {
131131 @Composable
132132 fun MayShowDialogs () {
133133 if (Service .driver.connectServerDialog.isOpen) ConnectServer ()
134- if (Service .driver.manageAddressesDialog.isOpen) ManageEnterpriseAddresses ()
134+ if (Service .driver.manageAddressesDialog.isOpen) ManageCloudAddresses ()
135135 }
136136
137137 @Composable
@@ -143,8 +143,8 @@ object ServerDialog {
143143 ) {
144144 Submission (state = state, modifier = Modifier .fillMaxSize(), showButtons = false ) {
145145 ServerFormField (state)
146- if (state.server == TYPEDB_ENTERPRISE ) {
147- ManageEnterpriseAddressesButton (state = state, shouldFocus = Service .driver.isDisconnected)
146+ if (state.server == TYPEDB_CLOUD ) {
147+ ManageCloudAddressesButton (state = state, shouldFocus = Service .driver.isDisconnected)
148148 UsernameFormField (state)
149149 PasswordFormField (state)
150150 TLSEnabledFormField (state)
@@ -196,11 +196,11 @@ object ServerDialog {
196196 }
197197
198198 @Composable
199- private fun ManageEnterpriseAddressesButton (state : ConnectServerForm , shouldFocus : Boolean ) {
199+ private fun ManageCloudAddressesButton (state : ConnectServerForm , shouldFocus : Boolean ) {
200200 val focusReq = if (shouldFocus) remember { FocusRequester () } else null
201201 Field (label = Label .ADDRESSES ) {
202202 TextButton (
203- text = Label .MANAGE_ENTERPRISE_ADDRESSES + " (${state.enterpriseAddresses .size} )" ,
203+ text = Label .MANAGE_CLOUD_ADDRESSES + " (${state.cloudAddresses .size} )" ,
204204 focusReq = focusReq, leadingIcon = Form .IconArg (Icon .CONNECT_TO_TYPEDB ),
205205 enabled = Service .driver.isDisconnected
206206 ) {
@@ -211,15 +211,15 @@ object ServerDialog {
211211 }
212212
213213 @Composable
214- private fun ManageEnterpriseAddresses () {
214+ private fun ManageCloudAddresses () {
215215 val dialogState = Service .driver.manageAddressesDialog
216- Dialog .Layout (dialogState, Label .MANAGE_ENTERPRISE_ADDRESSES , ADDRESS_MANAGER_WIDTH , ADDRESS_MANAGER_HEIGHT ) {
216+ Dialog .Layout (dialogState, Label .MANAGE_CLOUD_ADDRESSES , ADDRESS_MANAGER_WIDTH , ADDRESS_MANAGER_HEIGHT ) {
217217 Column (Modifier .fillMaxSize()) {
218218 Text (value = Sentence .MANAGE_ADDRESSES_MESSAGE , softWrap = true )
219219 Spacer (Modifier .height(Dialog .DIALOG_SPACING ))
220- EnterpriseAddressList (Modifier .fillMaxWidth().weight(1f ))
220+ CloudAddressList (Modifier .fillMaxWidth().weight(1f ))
221221 Spacer (Modifier .height(Dialog .DIALOG_SPACING ))
222- AddEnterpriseAddressForm ()
222+ AddCloudAddressForm ()
223223 Spacer (Modifier .height(Dialog .DIALOG_SPACING * 2 ))
224224 Row (verticalAlignment = Alignment .Bottom ) {
225225 Spacer (modifier = Modifier .weight(1f ))
@@ -231,7 +231,7 @@ object ServerDialog {
231231 }
232232
233233 @Composable
234- private fun AddEnterpriseAddressForm () {
234+ private fun AddCloudAddressForm () {
235235 val focusReq = remember { FocusRequester () }
236236 Submission (AddAddressForm , modifier = Modifier .height(Form .FIELD_HEIGHT ), showButtons = false ) {
237237 Row {
@@ -251,15 +251,15 @@ object ServerDialog {
251251 }
252252
253253 @Composable
254- private fun EnterpriseAddressList (modifier : Modifier ) = ActionableList .SingleButtonLayout (
255- items = state.enterpriseAddresses .toMutableList(),
254+ private fun CloudAddressList (modifier : Modifier ) = ActionableList .SingleButtonLayout (
255+ items = state.cloudAddresses .toMutableList(),
256256 modifier = modifier.border(1 .dp, Theme .studio.border),
257257 buttonSide = ActionableList .Side .RIGHT ,
258258 buttonFn = { address ->
259259 Form .IconButtonArg (
260260 icon = Icon .REMOVE ,
261261 color = { Theme .studio.errorStroke },
262- onClick = { state.enterpriseAddresses .remove(address) }
262+ onClick = { state.cloudAddresses .remove(address) }
263263 )
264264 }
265265 )
0 commit comments