@@ -3,6 +3,7 @@ import { Modal, Form, Input, Select, Switch, Button, Alert, Tooltip } from 'antd
3
3
import { useSelector } from 'react-redux' ;
4
4
import { selectMasterEnvironment , selectHasMasterEnvironment } from 'redux/selectors/enterpriseSelectors' ;
5
5
import { Environment } from '../types/environment.types' ;
6
+ import { trans } from 'i18n' ;
6
7
7
8
const { Option } = Select ;
8
9
@@ -81,22 +82,22 @@ const EditEnvironmentModal: React.FC<EditEnvironmentModalProps> = ({
81
82
82
83
return (
83
84
< Modal
84
- title = "Edit Environment"
85
+ title = { trans ( "enterprise.environments.modal.editEnvironment" ) }
85
86
open = { visible }
86
87
onCancel = { onClose }
87
88
maskClosable = { true }
88
89
destroyOnHidden = { true }
89
90
footer = { [
90
91
< Button key = "back" onClick = { onClose } >
91
- Cancel
92
+ { trans ( "enterprise.environments.modal.cancel" ) }
92
93
</ Button > ,
93
94
< Button
94
95
key = "submit"
95
96
type = "primary"
96
97
loading = { loading || submitLoading }
97
98
onClick = { handleSubmit }
98
99
>
99
- Save Changes
100
+ { trans ( "enterprise.environments.modal.saveChanges" ) }
100
101
</ Button >
101
102
] }
102
103
>
@@ -107,72 +108,72 @@ const EditEnvironmentModal: React.FC<EditEnvironmentModalProps> = ({
107
108
>
108
109
< Form . Item
109
110
name = "environmentName"
110
- label = "Environment Name"
111
- rules = { [ { required : true , message : 'Please enter a name' } ] }
111
+ label = { trans ( "enterprise.environments.modal.environmentName" ) }
112
+ rules = { [ { required : true , message : trans ( "enterprise.environments.modal.pleaseEnterName" ) } ] }
112
113
>
113
- < Input placeholder = "Enter environment name" />
114
+ < Input placeholder = { trans ( "enterprise.environments.modal.enterEnvironmentName" ) } />
114
115
</ Form . Item >
115
116
116
117
< Form . Item
117
118
name = "environmentDescription"
118
- label = "Description"
119
+ label = { trans ( "enterprise.environments.modal.description" ) }
119
120
>
120
121
< Input . TextArea
121
- placeholder = "Enter description"
122
+ placeholder = { trans ( "enterprise.environments.modal.enterDescription" ) }
122
123
rows = { 3 }
123
124
/>
124
125
</ Form . Item >
125
126
126
127
< Form . Item
127
128
name = "environmentType"
128
- label = "Stage"
129
- rules = { [ { required : true , message : 'Please select a stage' } ] }
129
+ label = { trans ( "enterprise.environments.modal.stage" ) }
130
+ rules = { [ { required : true , message : trans ( "enterprise.environments.modal.pleaseSelectStage" ) } ] }
130
131
>
131
- < Select placeholder = "Select stage" >
132
- < Option value = "DEV" > Development (DEV) </ Option >
133
- < Option value = "TEST" > Testing (TEST) </ Option >
134
- < Option value = "PREPROD" > Pre-Production (PREPROD) </ Option >
135
- < Option value = "PROD" > Production (PROD) </ Option >
132
+ < Select placeholder = { trans ( "enterprise.environments.modal.selectStage" ) } >
133
+ < Option value = "DEV" > { trans ( "enterprise.environments.modal.development" ) } </ Option >
134
+ < Option value = "TEST" > { trans ( "enterprise.environments.modal.testing" ) } </ Option >
135
+ < Option value = "PREPROD" > { trans ( "enterprise.environments.modal.preProduction" ) } </ Option >
136
+ < Option value = "PROD" > { trans ( "enterprise.environments.modal.production" ) } </ Option >
136
137
</ Select >
137
138
</ Form . Item >
138
139
139
140
< Form . Item
140
141
name = "environmentFrontendUrl"
141
- label = "Frontend URL"
142
+ label = { trans ( "enterprise.environments.modal.frontendUrl" ) }
142
143
>
143
144
< Input placeholder = "https://example.com" />
144
145
</ Form . Item >
145
146
146
147
< Form . Item
147
148
name = "environmentApiServiceUrl"
148
- label = "API Service URL"
149
+ label = { trans ( "enterprise.environments.modal.apiServiceUrl" ) }
149
150
>
150
151
< Input placeholder = "https://api.example.com" />
151
152
</ Form . Item >
152
153
153
154
< Form . Item
154
155
name = "environmentNodeServiceUrl"
155
- label = "Node Service URL"
156
+ label = { trans ( "enterprise.environments.modal.nodeServiceUrl" ) }
156
157
>
157
158
< Input placeholder = "https://node.example.com" />
158
159
</ Form . Item >
159
160
160
161
< Form . Item
161
162
name = "environmentApikey"
162
- label = "API Key"
163
+ label = { trans ( "enterprise.environments.modal.apiKey" ) }
163
164
>
164
165
< Input . TextArea
165
- placeholder = "Enter API key"
166
+ placeholder = { trans ( "enterprise.environments.modal.enterApiKey" ) }
166
167
rows = { 2 }
167
168
/>
168
169
</ Form . Item >
169
170
170
- < Form . Item label = "Master Environment" >
171
+ < Form . Item label = { trans ( "enterprise.environments.modal.masterEnvironment" ) } >
171
172
< div style = { { display : 'flex' , alignItems : 'center' , gap : '12px' } } >
172
173
< Tooltip
173
174
title = {
174
175
hasOtherMaster && ! isMaster
175
- ? ` ${ masterEnvironment ?. environmentName } is already the Master environment`
176
+ ? trans ( "enterprise.environments.modal.alreadyMasterEnvironment" , { name : masterEnvironment ?. environmentName } )
176
177
: ''
177
178
}
178
179
>
@@ -185,15 +186,15 @@ const EditEnvironmentModal: React.FC<EditEnvironmentModalProps> = ({
185
186
</ Tooltip >
186
187
{ isMaster && (
187
188
< span style = { { color : '#faad14' , fontSize : '12px' } } >
188
- Currently Master
189
+ { trans ( "enterprise.environments.modal.currentlyMaster" ) }
189
190
</ span >
190
191
) }
191
192
</ div >
192
193
</ Form . Item >
193
194
194
195
< Alert
195
- message = "Configuration Requirements"
196
- description = "Ensure that the API Service URL is configured and correct, the API key is valid, and for license verification make sure you have both the license and plugin properly installed."
196
+ message = { trans ( "enterprise.environments.modal.configurationRequirements" ) }
197
+ description = { trans ( "enterprise.environments.modal.configurationRequirementsDesc" ) }
197
198
type = "warning"
198
199
showIcon
199
200
style = { { marginTop : '16px' } }
0 commit comments