@@ -23,7 +23,7 @@ import { workspaceSelectors } from '../../../../redux/selectors';
2323import { getTranslateByScope } from '../../../../services' ;
2424import { DEFAULT_WORKSPACE_NAME , iconColors } from '../../../../constants' ;
2525import { HUB_API_URL } from '../../../../api/constants' ;
26- import { useHubToken } from '../../../hooks/auth' ;
26+ import { useHubToken , useHubUser } from '../../../hooks/auth' ;
2727import { PluginsLayout } from '../shared/Layout' ;
2828import { getTagOptions } from '../api' ;
2929import { debounce } from 'lodash' ;
@@ -44,7 +44,7 @@ const CreatePlugin: React.FC = () => {
4444 const history = useHistory ( ) ;
4545 const { failureToast } = useToaster ( ) ;
4646 const [ creatingPlugin , setCreatingPlugin ] = useState ( false ) ;
47-
47+ const hubUser = useHubUser ( ) ;
4848 const [ packageName , setPackageName ] = useState ( '' ) ;
4949 const [ versionNumber , setVersionNumber ] = useState ( '' ) ;
5050 const [ packageNameStatus , setPackageNameStatus ] = useState ( {
@@ -149,9 +149,21 @@ const CreatePlugin: React.FC = () => {
149149
150150 { /* package name and repository URL */ }
151151 < Box marginVertical = "xl" >
152- < Box marginBottom = "lg" >
152+ < Box
153+ marginBottom = "lg"
154+ style = { {
155+ display : 'flex' ,
156+ alignItems : 'end' ,
157+ gap : '1rem' ,
158+ } }
159+ >
160+ { hubUser && (
161+ < Paragraph style = { { paddingBottom : '1rem' } } >
162+ { hubUser . username } /
163+ </ Paragraph >
164+ ) }
153165 < ValidatedTextField
154- label = "Package Name"
166+ label = "Package Name * "
155167 value = { packageName }
156168 onChange = { ( p : string ) => {
157169 if ( ! / ^ [ a - z A - Z ] \w * $ / . test ( p ) ) {
@@ -170,31 +182,31 @@ const CreatePlugin: React.FC = () => {
170182 />
171183 </ Box >
172184
173- { /* version number */ }
185+ { /* repository URL */ }
174186 < Box marginBottom = "lg" >
175187 < ValidatedTextField
176- label = "Version Number (optional) "
177- value = { versionNumber }
178- onChange = { setVersionNumber }
188+ label = "Repository URL * "
189+ value = { repositoryUrl }
190+ onChange = { setRepositoryUrl }
179191 status = { { status : 'editing' } }
180- placeholder = "Version number"
181192 />
182193 </ Box >
183194
184- { /* repository URL */ }
195+ { /* version number */ }
185196 < Box marginBottom = "lg" >
186197 < ValidatedTextField
187- label = "Repository URL "
188- value = { repositoryUrl }
189- onChange = { setRepositoryUrl }
198+ label = "Version Number (optional) "
199+ value = { versionNumber }
200+ onChange = { setVersionNumber }
190201 status = { { status : 'editing' } }
202+ placeholder = "Version number"
191203 />
192204 </ Box >
193205
194206 { /* repository subdirectory */ }
195207 < Box marginBottom = "lg" >
196208 < InputWithLabel
197- label = "Subdirectory of repository"
209+ label = "Subdirectory of repository (optional) "
198210 InputComponent = {
199211 < TextInput
200212 value = { repositorySubdirectory }
@@ -207,7 +219,7 @@ const CreatePlugin: React.FC = () => {
207219 { /* repository branch */ }
208220 < Box marginBottom = "lg" >
209221 < InputWithLabel
210- label = "Branch of repository"
222+ label = "Branch of repository (optional) "
211223 InputComponent = {
212224 < TextInput
213225 value = { repositoryBranch }
@@ -230,7 +242,7 @@ const CreatePlugin: React.FC = () => {
230242 { /* commit hash */ }
231243 < Box marginBottom = "lg" >
232244 < InputWithLabel
233- label = "Commit hash"
245+ label = "Commit hash (optional) "
234246 InputComponent = {
235247 < TextInput
236248 value = { commitHash }
@@ -242,7 +254,7 @@ const CreatePlugin: React.FC = () => {
242254
243255 { /* Logo URL */ }
244256 < ValidatedTextField
245- label = "Logo URL"
257+ label = "Logo URL (optional) "
246258 value = { logoUrl }
247259 onChange = { setLogoUrl }
248260 status = { { status : 'editing' } }
@@ -254,7 +266,7 @@ const CreatePlugin: React.FC = () => {
254266 onChangeText = { setTagText }
255267 tags = { tags }
256268 onChangeTags = { setTags }
257- label = "Add tags"
269+ label = "Add tags (optional) "
258270 placeholder = "Ex. Artificial Intelligence"
259271 getTagOptions = { debouncedGetTagOptions }
260272 />
@@ -282,15 +294,16 @@ const CreatePlugin: React.FC = () => {
282294 href = "https://hub.zenml.io/tou"
283295 >
284296 Terms of use
285- </ a >
297+ </ a > { ' ' }
298+ *
286299 </ p >
287300 }
288301 value = { checkGuidelines }
289302 setValue = { setCheckGuidelines }
290303 />
291304 </ Box >
292305 < CheckboxInput
293- label = "I agree to publicly publish my plugin on the ZenML Hub under the Apache license."
306+ label = "I agree to publicly publish my plugin on the ZenML Hub under the Apache license. * "
294307 value = { checkPublish }
295308 setValue = { setCheckPublish }
296309 />
0 commit comments