Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ce-deploy-ui
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ccce
dev
ce-deploy-ui
Commits
07b1b80e
Commit
07b1b80e
authored
2 years ago
by
Imre Toth
Browse files
Options
Downloads
Patches
Plain Diff
ICSHW-9598
: Unifying git tag endpoints
parent
d460697f
No related branches found
No related tags found
3 merge requests
!270
Merging develop branch to master in order to create RC
,
!222
Fixing missing time interval parameter for logs
,
!205
ICSHW-9598: Unifying git tag endpoints
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/api/SwaggerApi.js
+3
-8
3 additions, 8 deletions
src/api/SwaggerApi.js
src/components/IOC/IOCDeployDialog.js
+5
-5
5 additions, 5 deletions
src/components/IOC/IOCDeployDialog.js
src/mocks/fixtures/ccce-api.json
+4411
-4772
4411 additions, 4772 deletions
src/mocks/fixtures/ccce-api.json
with
4419 additions
and
4785 deletions
src/api/SwaggerApi.js
+
3
−
8
View file @
07b1b80e
...
@@ -760,7 +760,8 @@ export function unpackTagAndCommitIdList(tagList) {
...
@@ -760,7 +760,8 @@ export function unpackTagAndCommitIdList(tagList) {
export
function
useTagsAndCommitIds
(
onError
)
{
export
function
useTagsAndCommitIds
(
onError
)
{
const
api
=
useContext
(
apiContext
);
const
api
=
useContext
(
apiContext
);
const
method
=
useCallAndUnpack
((
gitProjectId
,
reference
)
=>
api
.
apis
.
Git
.
listTagsAndCommitIds
({
project_id
:
gitProjectId
,
reference
:
reference
}),
unpackTagAndCommitIdList
)
const
method
=
useCallAndUnpack
((
gitProjectId
,
reference
,
includeAllReference
,
searchMethod
)
=>
api
.
apis
.
Git
.
listTagsAndCommitIds
({
project_id
:
gitProjectId
,
reference
:
reference
,
include_all_reference
:
includeAllReference
,
search_method
:
searchMethod
}),
unpackTagAndCommitIdList
)
return
useAsync
({
fcn
:
method
,
call
:
false
,
onError
:
onError
,
init
:
[]
});
return
useAsync
({
fcn
:
method
,
call
:
false
,
onError
:
onError
,
init
:
[]
});
}
}
...
@@ -886,10 +887,4 @@ export function useOwnIocsWithAlarms() {
...
@@ -886,10 +887,4 @@ export function useOwnIocsWithAlarms() {
const
method
=
useCallAndUnpack
(
api
.
apis
.
IOCs
.
listOwnIocsWithAlarms
)
const
method
=
useCallAndUnpack
(
api
.
apis
.
IOCs
.
listOwnIocsWithAlarms
)
return
useAsync
({
fcn
:
method
,
call
:
true
,
init
:
[]
});
return
useAsync
({
fcn
:
method
,
call
:
true
,
init
:
[]
});
}
}
\ No newline at end of file
export
function
useSearchTagsAndCommitsByRef
(
onError
)
{
const
api
=
useContext
(
apiContext
);
const
method
=
useCallAndUnpack
((
gitProjectId
,
reference
)
=>
api
.
apis
.
Git
.
searchTagsAndCommitsByRefName
({
project_id
:
gitProjectId
,
reference
:
reference
}),
unpackTagAndCommitIdList
)
return
useAsync
({
fcn
:
method
,
call
:
false
,
onError
:
onError
,
init
:
[]
});
}
This diff is collapsed.
Click to expand it.
src/components/IOC/IOCDeployDialog.js
+
5
−
5
View file @
07b1b80e
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
{
Button
,
TextField
,
Dialog
,
DialogActions
,
DialogContent
,
DialogTitle
,
Typography
,
makeStyles
,
Tooltip
}
from
"
@material-ui/core
"
;
import
{
Button
,
TextField
,
Dialog
,
DialogActions
,
DialogContent
,
DialogTitle
,
Typography
,
makeStyles
,
Tooltip
}
from
"
@material-ui/core
"
;
import
{
Autocomplete
,
Alert
}
from
"
@material-ui/lab
"
;
import
{
Autocomplete
,
Alert
}
from
"
@material-ui/lab
"
;
import
{
useCSEntrySearch
,
use
Search
TagsAndCommit
sByRef
}
from
"
../../api/SwaggerApi
"
;
import
{
useCSEntrySearch
,
useTagsAndCommit
Ids
}
from
"
../../api/SwaggerApi
"
;
import
{
useTypingTimer
}
from
"
../common/SearchBoxFilter/TypingTimer
"
;
import
{
useTypingTimer
}
from
"
../common/SearchBoxFilter/TypingTimer
"
;
import
{
formatDate
,
transformHostQuery
}
from
"
../common/Helper
"
;
import
{
formatDate
,
transformHostQuery
}
from
"
../common/Helper
"
;
...
@@ -23,7 +23,7 @@ export function IOCDeployDialog({ open, setOpen, submitCallback, hasActiveDeploy
...
@@ -23,7 +23,7 @@ export function IOCDeployDialog({ open, setOpen, submitCallback, hasActiveDeploy
const
[
hosts
,
getHosts
]
=
useCSEntrySearch
();
const
[
hosts
,
getHosts
]
=
useCSEntrySearch
();
const
[
host
,
setHost
]
=
useState
(
init
);
const
[
host
,
setHost
]
=
useState
(
init
);
const
[
query
,
onHostKeyUp
]
=
useTypingTimer
({
interval
:
500
});
const
[
query
,
onHostKeyUp
]
=
useTypingTimer
({
interval
:
500
});
const
[
tagOrCommitId
,
getTagOrCommitId
]
=
use
Search
TagsAndCommit
sByRef
(
onError
);
const
[
tagOrCommitId
,
getTagOrCommitId
]
=
useTagsAndCommit
Ids
(
onError
);
const
[
gitRepo
,
setGitRepo
]
=
useState
(
init
.
git
||
""
);
const
[
gitRepo
,
setGitRepo
]
=
useState
(
init
.
git
||
""
);
const
[
gitVersion
,
setGitVersion
]
=
useState
(
init
.
version
||
""
);
const
[
gitVersion
,
setGitVersion
]
=
useState
(
init
.
version
||
""
);
const
[
queryGitVersion
,
onGitVersionKeyUp
]
=
useTypingTimer
({
interval
:
500
});
const
[
queryGitVersion
,
onGitVersionKeyUp
]
=
useTypingTimer
({
interval
:
500
});
...
@@ -34,7 +34,7 @@ export function IOCDeployDialog({ open, setOpen, submitCallback, hasActiveDeploy
...
@@ -34,7 +34,7 @@ export function IOCDeployDialog({ open, setOpen, submitCallback, hasActiveDeploy
};
};
useEffect
(()
=>
getHosts
({
query
:
transformHostQuery
(
`
${
query
}
`
)}),
[
query
,
getHosts
]);
useEffect
(()
=>
getHosts
({
query
:
transformHostQuery
(
`
${
query
}
`
)}),
[
query
,
getHosts
]);
useEffect
(()
=>
getTagOrCommitId
(
gitProjectId
,
queryGitVersion
)
,
[
queryGitVersion
,
gitProjectId
,
getTagOrCommitId
]);
useEffect
(()
=>
{
getTagOrCommitId
(
gitProjectId
,
queryGitVersion
,
false
,
'
CONTAINS
'
);}
,
[
queryGitVersion
,
gitProjectId
,
getTagOrCommitId
]);
const
onSubmit
=
(
event
)
=>
{
const
onSubmit
=
(
event
)
=>
{
event
.
preventDefault
();
event
.
preventDefault
();
...
@@ -90,7 +90,7 @@ export function IOCDeployDialog({ open, setOpen, submitCallback, hasActiveDeploy
...
@@ -90,7 +90,7 @@ export function IOCDeployDialog({ open, setOpen, submitCallback, hasActiveDeploy
"
reference
"
:
init
.
version
,
"
reference
"
:
init
.
version
,
"
shortReference
"
:
init
.
shortVersion
?
init
.
shortVersion
:
init
.
version
"
shortReference
"
:
init
.
shortVersion
?
init
.
shortVersion
:
init
.
version
}
:
null
}
}
:
null
}
onFocus
=
{(
event
)
=>
{
getTagOrCommitId
(
gitProjectId
);}}
getOptionLabel
=
{(
option
)
=>
{
getOptionLabel
=
{(
option
)
=>
{
return
option
.
shortReference
;
return
option
.
shortReference
;
}}
}}
...
@@ -105,7 +105,7 @@ export function IOCDeployDialog({ open, setOpen, submitCallback, hasActiveDeploy
...
@@ -105,7 +105,7 @@ export function IOCDeployDialog({ open, setOpen, submitCallback, hasActiveDeploy
onChange
=
{(
event
,
value
,
reason
)
=>
{
onChange
=
{(
event
,
value
,
reason
)
=>
{
setGitVersion
(
value
?.
reference
);
setGitVersion
(
value
?.
reference
);
resetError
();
resetError
();
getTagOrCommitId
(
gitProjectId
,
value
?.
reference
);
getTagOrCommitId
(
gitProjectId
,
value
?.
reference
,
false
,
'
CONTAINS
'
);
}}
}}
onInputChange
=
{(
event
,
value
,
reason
)
=>
{
event
&&
onGitVersionKeyUp
(
event
.
nativeEvent
)}}
onInputChange
=
{(
event
,
value
,
reason
)
=>
{
event
&&
onGitVersionKeyUp
(
event
.
nativeEvent
)}}
disabled
=
{(
!
gitRepo
)
||
(
gitRepo
.
trim
()
===
""
)}
disabled
=
{(
!
gitRepo
)
||
(
gitRepo
.
trim
()
===
""
)}
...
...
This diff is collapsed.
Click to expand it.
src/mocks/fixtures/ccce-api.json
+
4411
−
4772
View file @
07b1b80e
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment