Skip to content

Commit

Permalink
merged development
Browse files Browse the repository at this point in the history
  • Loading branch information
mariana-furyk committed Nov 21, 2023
2 parents 525cb3c + bbf1f23 commit 5b02f78
Show file tree
Hide file tree
Showing 75 changed files with 784 additions and 428 deletions.
6 changes: 3 additions & 3 deletions src/actions/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,12 @@ const functionsActions = {
payload: err
}),
fetchFunctions:
(project, filters, withoutLoader = false) =>
(project, filters, setLargeRequestErrorMessage) =>
dispatch => {
dispatch(functionsActions.fetchFunctionsBegin(withoutLoader))
dispatch(functionsActions.fetchFunctionsBegin())

return functionsApi
.getFunctions(project, filters)
.getFunctions(project, filters, null, setLargeRequestErrorMessage)
.then(({ data }) => {
dispatch(functionsActions.fetchFunctionsSuccess(data.funcs))

Expand Down
8 changes: 4 additions & 4 deletions src/actions/jobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ const jobsActions = {
type: EDIT_JOB_FAILURE,
payload: error
}),
fetchAllJobRuns: (project, filters, jobName, cancelToken) => dispatch => {
fetchAllJobRuns: (project, filters, jobName, setLargeRequestErrorMessage) => dispatch => {
dispatch(jobsActions.fetchAllJobRunsBegin())

return jobsApi
.getAllJobRuns(project, jobName, filters, cancelToken)
.getAllJobRuns(project, jobName, filters, setLargeRequestErrorMessage)
.then(({ data }) => {
dispatch(jobsActions.fetchAllJobRunsSuccess(data.runs || []))

Expand Down Expand Up @@ -257,12 +257,12 @@ const jobsActions = {
fetchJobLogsSuccess: () => ({
type: FETCH_JOB_LOGS_SUCCESS
}),
fetchJobs: (project, filters, scheduled) => dispatch => {
fetchJobs: (project, filters, scheduled, setLargeRequestErrorMessage) => dispatch => {
const getJobs = scheduled ? jobsApi.getScheduledJobs : jobsApi.getJobs

dispatch(jobsActions.fetchJobsBegin())

return getJobs(project, filters)
return getJobs(project, filters, setLargeRequestErrorMessage)
.then(({ data }) => {
const newJobs = scheduled
? (data || {}).schedules
Expand Down
4 changes: 2 additions & 2 deletions src/actions/workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ const workflowActions = {
type: FETCH_WORKFLOW_FAILURE,
payload: error
}),
fetchWorkflows: (project, filter) => dispatch => {
fetchWorkflows: (project, filter, setLargeRequestErrorMessage) => dispatch => {
dispatch(workflowActions.fetchWorkflowsBegin())

return workflowApi
.getWorkflows(project, filter)
.getWorkflows(project, filter, setLargeRequestErrorMessage)
.then(response =>
dispatch(workflowActions.fetchWorkflowsSuccess(parseWorkflows(response.data.runs)))
)
Expand Down
55 changes: 40 additions & 15 deletions src/api/artifacts-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ const fetchArtifacts = (project, filters, config = {}) => {
const artifactsApi = {
addTag: (project, tag, data) => mainHttpClient.put(`/projects/${project}/tags/${tag}`, data),
buildFunction: data => mainHttpClient.post('/build/function', data),
deleteArtifact: (project, key, tag) => {
deleteArtifact: (project, key, tag, uid) => {
const config = {
params: {
key,
tag
}
}

return mainHttpClient.delete(`/projects/${project}/artifacts`, config)
return mainHttpClient.delete(`/projects/${project}/artifacts/${uid}`, config)
},
deleteTag: (project, tag, data) =>
mainHttpClient.delete(`/projects/${project}/tags/${tag}`, { data }),
Expand Down Expand Up @@ -107,8 +107,16 @@ const artifactsApi = {
}
)
},
getDataSets: (project, filters, config) => {
return fetchArtifacts(project, filters, { ...config, params: { category: DATASET_TYPE } })
getDataSets: (project, filters, config, setLargeRequestErrorMessage) => {
const newConfig = {
...config,
params: { category: DATASET_TYPE },
ui: {
setLargeRequestErrorMessage
}
}

return fetchArtifacts(project, filters, newConfig)
},
getFile: (project, file, iter, tag) => {
return fetchArtifacts(
Expand All @@ -124,10 +132,15 @@ const artifactsApi = {
}
)
},
getFiles: (project, filters) => {
return fetchArtifacts(project, filters, {
params: { category: ARTIFACT_OTHER_TYPE, format: 'full' }
})
getFiles: (project, filters, setLargeRequestErrorMessage) => {
const config = {
params: { category: ARTIFACT_OTHER_TYPE, format: 'full' },
ui: {
setLargeRequestErrorMessage
}
}

return fetchArtifacts(project, filters, config)
},
getModel: (project, model, iter, tag) => {
return fetchArtifacts(
Expand All @@ -143,17 +156,29 @@ const artifactsApi = {
}
)
},
getModelEndpoints: (project, filters, params = {}) => {
getModelEndpoints: (project, filters, params = {}, setLargeRequestErrorMessage) => {
const config = {
params,
ui: {
setLargeRequestErrorMessage
}
}

if (filters?.labels) {
params.label = filters.labels?.split(',')
config.params.label = filters.labels?.split(',')
}

return mainHttpClient.get(`/projects/${project}/model-endpoints`, {
params
})
return mainHttpClient.get(`/projects/${project}/model-endpoints`, config)
},
getModels: (project, filters) => {
return fetchArtifacts(project, filters, { params: { category: MODEL_TYPE, format: 'full' } })
getModels: (project, filters, setLargeRequestErrorMessage) => {
const config = {
params: { category: MODEL_TYPE, format: 'full' },
ui: {
setLargeRequestErrorMessage
}
}

return fetchArtifacts(project, filters, config)
},
registerArtifact: (project, data) =>
mainHttpClient.post(
Expand Down
15 changes: 10 additions & 5 deletions src/api/functions-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,23 @@ const functionsApi = {
deleteSelectedFunction: (func, project) =>
mainHttpClient.delete(`/projects/${project}/functions/${func}`),
deployFunction: data => mainHttpClient.post('/build/function', data),
getFunctions: (project, filters, hash) => {
const params = {}
getFunctions: (project, filters, hash, setLargeRequestErrorMessage) => {
const config = {
params: {},
ui: {
setLargeRequestErrorMessage
}
}

if (filters?.name) {
params.name = `~${filters.name}`
config.params.name = `~${filters.name}`
}

if (hash) {
params.hash_key = hash
config.params.hash_key = hash
}

return mainHttpClient.get(`/projects/${project}/functions`, { params })
return mainHttpClient.get(`/projects/${project}/functions`, config)
},
getFunction: (project, functionName, hash, tag) => {
const params = {}
Expand Down
47 changes: 28 additions & 19 deletions src/api/jobs-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,23 @@ const jobsApi = {
`/projects/${project}/schedules/${postData.scheduled_object.task.metadata.name}`,
postData
),
getJobs: (project, filters, isAllJobs) => {
const params = {
project,
...generateRequestParams(filters)
getJobs: (project, filters, setLargeRequestErrorMessage, isAllJobs) => {
const config = {
params: {
project,
...generateRequestParams(filters)
},
ui: {
setLargeRequestErrorMessage
}
}

if (!isAllJobs) {
params['partition-by'] = 'name'
params['partition-sort-by'] = 'updated'
config.params['partition-by'] = 'name'
config.params['partition-sort-by'] = 'updated'
}

return mainHttpClient.get('/runs', { params })
return mainHttpClient.get('/runs', config)
},
getSpecificJobs: (project, filters, jobList) => {
const params = {
Expand All @@ -97,19 +102,18 @@ const jobsApi = {

return mainHttpClient.get(`/runs?${jobListQuery}`, { params })
},
getAllJobRuns: (project, jobName, filters, cancelToken) => {
getAllJobRuns: (project, jobName, filters, setLargeRequestErrorMessage) => {
const config = {
params: {
project,
name: jobName,
...generateRequestParams(filters)
},
ui: {
setLargeRequestErrorMessage
}
}

if (cancelToken) {
config.cancelToken = cancelToken
}

return mainHttpClient.get('/runs', config)
},
getJob: (project, jobId, iter) => {
Expand All @@ -125,24 +129,29 @@ const jobsApi = {
fetch(`${mainBaseUrl}/log/${project}/${id}`, {
method: 'get'
}),
getScheduledJobs: (project, filters) => {
const params = {
include_last_run: 'yes'
getScheduledJobs: (project, filters, setLargeRequestErrorMessage) => {
const config = {
params: {
include_last_run: 'yes'
},
ui: {
setLargeRequestErrorMessage
}
}

if (filters?.owner) {
params.owner = filters.owner
config.params.owner = filters.owner
}

if (filters?.name) {
params.name = `~${filters.name}`
config.params.name = `~${filters.name}`
}

if (filters?.labels) {
params.labels = filters.labels?.split(',')
config.params.labels = filters.labels?.split(',')
}

return mainHttpClient.get(`/projects/${project}/schedules`, { params })
return mainHttpClient.get(`/projects/${project}/schedules`, config)
},
removeScheduledJob: (project, scheduleName) =>
mainHttpClient.delete(`/projects/${project}/schedules/${scheduleName}`),
Expand Down
3 changes: 2 additions & 1 deletion src/api/projects-iguazio-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ const projectsIguazioApi = {
return iguazioHttpClient.post('/async_transactions', data)
},
getScrubbedUsers: config => iguazioHttpClient.get('/scrubbed_users', config),
getScrubbedUserGroups: config => iguazioHttpClient.get('/scrubbed_user_groups', config)
getScrubbedUserGroups: config => iguazioHttpClient.get('/scrubbed_user_groups', config),
getActiveUser: () => iguazioHttpClient.get('/self')
}

export default projectsIguazioApi
15 changes: 10 additions & 5 deletions src/api/workflow-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,26 @@ const generateQueryParams = filter => {
}
}

return `?filter=${encodeURI(JSON.stringify(queryParams))}`
return JSON.stringify(queryParams)
}

const workflowsApi = {
getWorkflow: (project, workflowId) => {
return mainHttpClient.get(`/projects/${project}/pipelines/${workflowId}`)
},
getWorkflows: (project, filter) => {
let queryParams = ''
getWorkflows: (project, filter, setLargeRequestErrorMessage) => {
const config = {
params: {},
ui: {
setLargeRequestErrorMessage
}
}

if (filter?.groupBy === GROUP_BY_WORKFLOW) {
queryParams = generateQueryParams(filter)
config.params.filter = generateQueryParams(filter)
}

return mainHttpClient.get(`/projects/${project}/pipelines` + queryParams)
return mainHttpClient.get(`/projects/${project}/pipelines`, config)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/common/Breadcrumbs/Breadcrumbs.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const Breadcrumbs = ({ onClick, projectStore, fetchProjectsNames }) => {
searchValue
? projectListRef.current.scrollTo({ top: 0, left: 0, behavior: 'smooth' })
: setTimeout(() => {
selectedOptionEl.scrollIntoView(
selectedOptionEl?.scrollIntoView(
{
behavior: 'smooth',
block: 'center'
Expand Down
2 changes: 1 addition & 1 deletion src/common/Breadcrumbs/breadcrumbs.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const generateProjectScreens = params => [
label: 'Quick actions',
id: PROJECT_QUICK_ACTIONS_PAGE
},
{ label: 'Feature Store', id: 'feature-store' },
{ label: 'Feature store', id: 'feature-store' },
{ label: 'Datasets', id: 'datasets' },
{ label: 'Artifacts', id: 'files' },
{ label: 'Models', id: 'models' },
Expand Down
13 changes: 10 additions & 3 deletions src/common/Input/input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -134,24 +134,31 @@
background-color: transparent;
pointer-events: none;

label {
display: flex;
align-items: center;
}

&-mandatory {
color: $amaranth;
margin-left: 2px;

&_disabled {
color: $spunPearl;
}
}

&.active-label {
top: 9px;
top: 8px;
height: auto;
font-weight: 700;
font-size: 10px;
line-height: 12px;
pointer-events: auto;

.input__label-mandatory:not(.input__label-mandatory_disabled) {
color: $topaz;
.input__label-mandatory,
.input__label-mandatory_disabled {
font-size: 13px;
}
}

Expand Down
Loading

0 comments on commit 5b02f78

Please sign in to comment.