@@ -59,7 +59,7 @@ import com.vaticle.typedb.studio.service.Service
59
59
import com.vaticle.typedb.studio.service.common.util.Label
60
60
import com.vaticle.typedb.studio.service.common.util.Property
61
61
import 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
63
63
import com.vaticle.typedb.studio.service.common.util.Sentence
64
64
import com.vaticle.typedb.studio.service.connection.DriverState.Status.CONNECTED
65
65
import com.vaticle.typedb.studio.service.connection.DriverState.Status.CONNECTING
@@ -78,8 +78,8 @@ object ServerDialog {
78
78
private class ConnectServerForm : Form .State () {
79
79
var server: Property .Server by mutableStateOf(appData.server ? : Property .Server .TYPEDB_CORE )
80
80
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) }
83
83
}
84
84
var username: String by mutableStateOf(appData.username ? : " " )
85
85
var password: String by mutableStateOf(" " )
@@ -89,22 +89,22 @@ object ServerDialog {
89
89
override fun cancel () = Service .driver.connectServerDialog.close()
90
90
override fun isValid (): Boolean = when (server) {
91
91
TYPEDB_CORE -> coreAddress.isNotBlank() && addressFormatIsValid(coreAddress)
92
- TYPEDB_ENTERPRISE -> ! (enterpriseAddresses .isEmpty() || username.isBlank() || password.isBlank())
92
+ TYPEDB_CLOUD -> ! (cloudAddresses .isEmpty() || username.isBlank() || password.isBlank())
93
93
}
94
94
95
95
override fun submit () {
96
96
when (server) {
97
97
TYPEDB_CORE -> Service .driver.tryConnectToTypeDBCoreAsync(coreAddress) {
98
98
Service .driver.connectServerDialog.close()
99
99
}
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
102
102
) { Service .driver.connectServerDialog.close() }
103
103
}
104
104
password = " "
105
105
appData.server = server
106
106
appData.coreAddress = coreAddress
107
- appData.enterpriseAddresses = enterpriseAddresses
107
+ appData.cloudAddresses = cloudAddresses
108
108
appData.username = username
109
109
appData.tlsEnabled = tlsEnabled
110
110
appData.caCertificate = caCertificate
@@ -114,11 +114,11 @@ object ServerDialog {
114
114
private object AddAddressForm : Form.State() {
115
115
var value: String by mutableStateOf(" " )
116
116
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)
118
118
119
119
override fun submit () {
120
120
assert (isValid())
121
- state.enterpriseAddresses .add(value)
121
+ state.cloudAddresses .add(value)
122
122
value = " "
123
123
}
124
124
}
@@ -131,7 +131,7 @@ object ServerDialog {
131
131
@Composable
132
132
fun MayShowDialogs () {
133
133
if (Service .driver.connectServerDialog.isOpen) ConnectServer ()
134
- if (Service .driver.manageAddressesDialog.isOpen) ManageEnterpriseAddresses ()
134
+ if (Service .driver.manageAddressesDialog.isOpen) ManageCloudAddresses ()
135
135
}
136
136
137
137
@Composable
@@ -143,8 +143,8 @@ object ServerDialog {
143
143
) {
144
144
Submission (state = state, modifier = Modifier .fillMaxSize(), showButtons = false ) {
145
145
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)
148
148
UsernameFormField (state)
149
149
PasswordFormField (state)
150
150
TLSEnabledFormField (state)
@@ -196,11 +196,11 @@ object ServerDialog {
196
196
}
197
197
198
198
@Composable
199
- private fun ManageEnterpriseAddressesButton (state : ConnectServerForm , shouldFocus : Boolean ) {
199
+ private fun ManageCloudAddressesButton (state : ConnectServerForm , shouldFocus : Boolean ) {
200
200
val focusReq = if (shouldFocus) remember { FocusRequester () } else null
201
201
Field (label = Label .ADDRESSES ) {
202
202
TextButton (
203
- text = Label .MANAGE_ENTERPRISE_ADDRESSES + " (${state.enterpriseAddresses .size} )" ,
203
+ text = Label .MANAGE_CLOUD_ADDRESSES + " (${state.cloudAddresses .size} )" ,
204
204
focusReq = focusReq, leadingIcon = Form .IconArg (Icon .CONNECT_TO_TYPEDB ),
205
205
enabled = Service .driver.isDisconnected
206
206
) {
@@ -211,15 +211,15 @@ object ServerDialog {
211
211
}
212
212
213
213
@Composable
214
- private fun ManageEnterpriseAddresses () {
214
+ private fun ManageCloudAddresses () {
215
215
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 ) {
217
217
Column (Modifier .fillMaxSize()) {
218
218
Text (value = Sentence .MANAGE_ADDRESSES_MESSAGE , softWrap = true )
219
219
Spacer (Modifier .height(Dialog .DIALOG_SPACING ))
220
- EnterpriseAddressList (Modifier .fillMaxWidth().weight(1f ))
220
+ CloudAddressList (Modifier .fillMaxWidth().weight(1f ))
221
221
Spacer (Modifier .height(Dialog .DIALOG_SPACING ))
222
- AddEnterpriseAddressForm ()
222
+ AddCloudAddressForm ()
223
223
Spacer (Modifier .height(Dialog .DIALOG_SPACING * 2 ))
224
224
Row (verticalAlignment = Alignment .Bottom ) {
225
225
Spacer (modifier = Modifier .weight(1f ))
@@ -231,7 +231,7 @@ object ServerDialog {
231
231
}
232
232
233
233
@Composable
234
- private fun AddEnterpriseAddressForm () {
234
+ private fun AddCloudAddressForm () {
235
235
val focusReq = remember { FocusRequester () }
236
236
Submission (AddAddressForm , modifier = Modifier .height(Form .FIELD_HEIGHT ), showButtons = false ) {
237
237
Row {
@@ -251,15 +251,15 @@ object ServerDialog {
251
251
}
252
252
253
253
@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(),
256
256
modifier = modifier.border(1 .dp, Theme .studio.border),
257
257
buttonSide = ActionableList .Side .RIGHT ,
258
258
buttonFn = { address ->
259
259
Form .IconButtonArg (
260
260
icon = Icon .REMOVE ,
261
261
color = { Theme .studio.errorStroke },
262
- onClick = { state.enterpriseAddresses .remove(address) }
262
+ onClick = { state.cloudAddresses .remove(address) }
263
263
)
264
264
}
265
265
)
0 commit comments