Skip to content
Snippets Groups Projects
Commit cebd6839 authored by Johanna Szepanski's avatar Johanna Szepanski
Browse files

Merge branch 'CE-2647-ui-improvements-git-selector' into 'develop'

CE-2647: UI improvements git selector

See merge request !456
parents 3a697929 1ddc68ef
No related branches found
No related tags found
2 merge requests!497CE-2790: Prepare for 4.0.0,!456CE-2647: UI improvements git selector
Pipeline #185773 waiting for manual action
...@@ -18,10 +18,10 @@ repos: ...@@ -18,10 +18,10 @@ repos:
- id: eslint - id: eslint
entry: eslint --fix entry: eslint --fix
additional_dependencies: additional_dependencies:
- eslint - eslint@^8.55.0
- eslint-config-react-app - eslint-config-react-app@^7.0.1
- eslint-config-prettier - eslint-config-prettier@^9.1.0
- eslint-plugin-import - eslint-plugin-import@^2.29.0
- eslint-plugin-react - eslint-plugin-react@^7.33.2
- eslint-plugin-cypress - eslint-plugin-cypress@^2.15.1
- eslint-formatter-gitlab - eslint-formatter-gitlab@^4.0.0
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"@ahooksjs/use-url-state": "^3.5.0", "@ahooksjs/use-url-state": "^3.5.0",
"@emotion/react": "^11.11.1", "@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0", "@emotion/styled": "^11.11.0",
"@ess-ics/ce-ui-common": "^4.11.0", "@ess-ics/ce-ui-common": "^5.0.0",
"@fontsource/roboto": "^4.1.0", "@fontsource/roboto": "^4.1.0",
"@mui/icons-material": "^5.14.1", "@mui/icons-material": "^5.14.1",
"@mui/material": "^5.14.1", "@mui/material": "^5.14.1",
...@@ -3023,9 +3023,9 @@ ...@@ -3023,9 +3023,9 @@
} }
}, },
"node_modules/@ess-ics/ce-ui-common": { "node_modules/@ess-ics/ce-ui-common": {
"version": "4.11.0", "version": "5.0.0",
"resolved": "https://artifactory.esss.lu.se/artifactory/api/npm/ics-npm/@ess-ics/ce-ui-common/-/ce-ui-common-4.11.0.tgz", "resolved": "https://artifactory.esss.lu.se/artifactory/api/npm/ics-npm/@ess-ics/ce-ui-common/-/ce-ui-common-5.0.0.tgz",
"integrity": "sha1-fzwY1y6ZV+LEtULgSFcwjR8qKrQ=", "integrity": "sha1-8kLUz3Zl9TA3sYsL34k0ydGS3PY=",
"dependencies": { "dependencies": {
"@fontsource/titillium-web": "^4.5.9", "@fontsource/titillium-web": "^4.5.9",
"@mui/x-data-grid-pro": "^6.5.0", "@mui/x-data-grid-pro": "^6.5.0",
...@@ -38829,9 +38829,9 @@ ...@@ -38829,9 +38829,9 @@
"dev": true "dev": true
}, },
"@ess-ics/ce-ui-common": { "@ess-ics/ce-ui-common": {
"version": "4.11.0", "version": "5.0.0",
"resolved": "https://artifactory.esss.lu.se/artifactory/api/npm/ics-npm/@ess-ics/ce-ui-common/-/ce-ui-common-4.11.0.tgz", "resolved": "https://artifactory.esss.lu.se/artifactory/api/npm/ics-npm/@ess-ics/ce-ui-common/-/ce-ui-common-5.0.0.tgz",
"integrity": "sha1-fzwY1y6ZV+LEtULgSFcwjR8qKrQ=", "integrity": "sha1-8kLUz3Zl9TA3sYsL34k0ydGS3PY=",
"requires": { "requires": {
"@fontsource/titillium-web": "^4.5.9", "@fontsource/titillium-web": "^4.5.9",
"@mui/x-data-grid-pro": "^6.5.0", "@mui/x-data-grid-pro": "^6.5.0",
...@@ -66,8 +66,7 @@ export function IOCDeployDialog({ ...@@ -66,8 +66,7 @@ export function IOCDeployDialog({
const [host, setHost] = useState(deployIocFormDefaults); const [host, setHost] = useState(deployIocFormDefaults);
const [query, onHostKeyUp] = useTypingTimer({ interval: 500 }); const [query, onHostKeyUp] = useTypingTimer({ interval: 500 });
const [gitRepo, setGitRepo] = useState(deployIocFormDefaults.git || ""); const [gitRepo, setGitRepo] = useState(deployIocFormDefaults.git || "");
const [revision, setRevision] = useState(deployIocFormDefaults.version || ""); const [revision, setRevision] = useState(deployIocFormDefaults);
const [revisionQuery, onRevisionQueryChange] = useState("");
const gitProjectId = deployIocFormDefaults.gitProjectId; const gitProjectId = deployIocFormDefaults.gitProjectId;
const handleClose = () => { const handleClose = () => {
...@@ -79,8 +78,8 @@ export function IOCDeployDialog({ ...@@ -79,8 +78,8 @@ export function IOCDeployDialog({
}, [query, getHosts]); }, [query, getHosts]);
useEffect(() => { useEffect(() => {
getTagOrCommitId(gitProjectId, revisionQuery, false, "CONTAINS"); getTagOrCommitId(gitProjectId, "", false, "CONTAINS");
}, [revisionQuery, gitProjectId, getTagOrCommitId]); }, [gitProjectId, getTagOrCommitId]);
const onSubmit = (event) => { const onSubmit = (event) => {
event.preventDefault(); event.preventDefault();
...@@ -95,7 +94,7 @@ export function IOCDeployDialog({ ...@@ -95,7 +94,7 @@ export function IOCDeployDialog({
{ {
requestBody: { requestBody: {
sourceUrl: git, sourceUrl: git,
sourceVersion: revision, sourceVersion: revision.reference,
hostCSEntryId: host hostCSEntryId: host
? Number(host.csEntryHost.id) ? Number(host.csEntryHost.id)
: deployIocFormDefaults.csEntryHost : deployIocFormDefaults.csEntryHost
...@@ -143,28 +142,18 @@ export function IOCDeployDialog({ ...@@ -143,28 +142,18 @@ export function IOCDeployDialog({
label="Revision" label="Revision"
options={tagOrCommitId} options={tagOrCommitId}
loading={loadingTagsAndCommitIds} loading={loadingTagsAndCommitIds}
defaultValue={ disabled={!gitRepo || gitRepo.trim() === ""}
deployIocFormDefaults.version autocompleteProps={{
? { autoSelect: false,
reference: deployIocFormDefaults.version, defaultValue: tagOrCommitId.find(
shortReference: deployIocFormDefaults.shortVersion (tagOrCommit) =>
? deployIocFormDefaults.shortVersion tagOrCommit.reference === deployIocFormDefaults.reference
: deployIocFormDefaults.version )
} }}
: null onGitQueryValueSelect={(_, value) => {
} setRevision(value);
onGitQueryValueSelect={(value) => {
setRevision(value?.reference);
resetError(); resetError();
getTagOrCommitId(
gitProjectId,
value?.reference,
false,
"CONTAINS"
);
}} }}
onGitQueryStringChange={onRevisionQueryChange}
disabled={!gitRepo || gitRepo.trim() === ""}
textFieldProps={{ textFieldProps={{
helperText: tagOrCommitIdError helperText: tagOrCommitIdError
? `Error: ${tagOrCommitId?.message}` ? `Error: ${tagOrCommitId?.message}`
......
...@@ -146,8 +146,8 @@ export function IOCManage({ ...@@ -146,8 +146,8 @@ export function IOCManage({
}; };
if (ioc.activeDeployment) { if (ioc.activeDeployment) {
deployIocFormDefaults.version = ioc.activeDeployment.sourceVersion; deployIocFormDefaults.reference = ioc.activeDeployment.sourceVersion;
deployIocFormDefaults.shortVersion = deployIocFormDefaults.short_reference =
ioc.activeDeployment.sourceVersionShort; ioc.activeDeployment.sourceVersionShort;
deployIocFormDefaults.csEntryHost = { deployIocFormDefaults.csEntryHost = {
fqdn: ioc.activeDeployment.host.fqdn, fqdn: ioc.activeDeployment.host.fqdn,
...@@ -228,7 +228,7 @@ export function IOCManage({ ...@@ -228,7 +228,7 @@ export function IOCManage({
open={deployDialogOpen} open={deployDialogOpen}
setOpen={setDeployDialogOpen} setOpen={setDeployDialogOpen}
submitCallback={closeDeployModal} submitCallback={closeDeployModal}
defaultHost={deployIocFormDefaults} deployIocFormDefaults={deployIocFormDefaults}
iocId={ioc.id} iocId={ioc.id}
hasActiveDeployment={Boolean(ioc.activeDeployment)} hasActiveDeployment={Boolean(ioc.activeDeployment)}
buttonDisabled={buttonDisabled} buttonDisabled={buttonDisabled}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment