Skip to content

Commit

Permalink
feat: Rename Extraction to Jobs and remove unused menu items (#856)
Browse files Browse the repository at this point in the history
  • Loading branch information
aazaliyaa authored May 27, 2024
1 parent 4530344 commit 31d6044
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 32 deletions.
6 changes: 3 additions & 3 deletions web/src/app-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
Text
} from '@epam/loveship';
import { useHistory } from 'react-router-dom';
import capitalize from 'lodash/capitalize';
import startCase from 'lodash/startCase';
import { CurrentUser } from 'shared/contexts/current-user';
import { FlexSpacer } from '@epam/uui-components';
import { cloneDeep } from 'lodash';
Expand Down Expand Up @@ -60,7 +60,7 @@ export const AppHeader = () => {
case isSimple:
return '/my documents';
case isAnnotator:
return '/dashboard';
return '/my tasks';
default:
return '/documents';
}
Expand All @@ -84,7 +84,7 @@ export const AppHeader = () => {
}}
key={item}
collapseToMore
caption={capitalize(item)}
caption={startCase(item)}
priority={0}
estimatedWidth={145}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ const EditJobSettings: FC<EditJobSettingsProps> = ({
const tabs = [
{
id: 'ExtractionJob',
caption: 'Extraction',
caption: 'Job',
isDisabled:
initialType === 'ExtractionWithAnnotationJob' || initialType === 'AnnotationJob'
},
{
id: 'ExtractionWithAnnotationJob',
caption: 'Extraction and annotation'
caption: 'Human in the Loop'
}
];
if (showNoExtractionTab) {
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/job/pipeline-picker/pipeline-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const PipelinePicker: FC<AutomaticJobProps> = ({ lens, pipelineManagers = [] })
</LabeledInput>
<LabeledInput
cx={`${styles.pipeline} m-t-15`}
label="ML Pipeline"
label="Pipeline"
{...lens.prop('pipeline').toProps()}
>
<div className="flex align-vert-center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import { useCategories } from '../../api/hooks/categories';
import styles from './categories-table-connector.module.scss';
import { ModalWithDisabledClickOutsideAndCross } from '../categories-modal-connector/categories-modal-connector';
import { TaskValidationValues } from '../categories-modal-connector/types';
import { ML_MENU_ITEMS } from '../../shared/contexts/current-user';
import { MultiSwitchMenu } from '../../shared/components/multi-switch-menu/MultiSwitchMenu';
import { useHistory } from 'react-router-dom';

type CategoriesTableConnectorProps = {};
Expand Down Expand Up @@ -74,8 +72,7 @@ export const CategoriesTableConnector: FC<CategoriesTableConnectorProps> = () =>

return (
<Panel cx={`${styles['container']} flex-col`}>
<div className={`${styles['title']} flex justify-between align-vert-center`}>
<MultiSwitchMenu items={ML_MENU_ITEMS} currentPath={history.location.pathname} />
<div className={`${styles['title']} flex justify-end align-vert-center`}>
<Button
onClick={() =>
uuiModals.show((props) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ export const JobsTableConnector: FC<JobsTableConnectorProps> = ({
return (
<Panel cx={`${styles['container']} flex-col`}>
<div className={`${styles['title']} flex justify-between align-vert-center`}>
<BreadcrumbNavigation breadcrumbs={[{ name: 'Extractions' }]} />
<Button onClick={onAddJob} caption="Add Extraction" />
<BreadcrumbNavigation breadcrumbs={[{ name: 'Jobs' }]} />
<Button onClick={onAddJob} caption="New Job" />
</div>

<Panel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.container {
flex: 1 1;
margin: 0 0 24px 24px;
margin: 24px 0 24px 24px;
padding-right: 24px;
overflow: auto;
}
Expand Down
7 changes: 0 additions & 7 deletions web/src/connectors/reports-connector/reports-connector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import React, { FC, useCallback, useEffect, useState } from 'react';
import { useUsers } from 'api/hooks/users';
import { Report, SortingDirection } from 'api/typings';
import { useHistory } from 'react-router-dom';
import { MultiSwitchMenu } from 'shared/components/multi-switch-menu/MultiSwitchMenu';
import { ML_MENU_ITEMS } from 'shared/contexts/current-user';
import RetrieveReportsList from 'components/reports/retrieve-reports-list';
import { renderWizardButtons } from 'shared/components/wizard/wizard/wizard';
import { useDownloadTaskReport } from 'api/hooks/tasks';
Expand Down Expand Up @@ -135,11 +133,6 @@ export const ReportsConnector: FC<{}> = () => {

return (
<Panel cx={`${styles['container']} flex-col`}>
<div
className={`${styles['title']} flex justify-between align-vert-center ${styles.title}`}
>
<MultiSwitchMenu items={ML_MENU_ITEMS} currentPath={history.location.pathname} />
</div>
<a href={url} download={name} className="hidden" ref={ref} />
<div className={styles['form-group']}>
<Form<Report>
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/document/document-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export function DocumentPage({
const crumbs = [];

if (historyState?.previousPage === PREVIOUS_PAGE_JOB) {
crumbs.push({ name: 'Extractions', url: JOBS_PAGE });
crumbs.push({ name: 'Jobs', url: JOBS_PAGE });
crumbs.push({
name: historyState.previousPageName || '',
url: historyState.previousPageUrl
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/jobs/edit-job-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const EditJobPage = () => {
setStepIndex(stepIndex - 1);
};

const finishButtonCaption = jobId ? 'Save Edits' : 'Add Extraction';
const finishButtonCaption = jobId ? 'Save Edits' : 'New Job';
const isDisabled = !!jobId;

const tabs = [
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/task/task-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const TaskPageContent: FC<TTaskPageContent> = ({
const { previousPage, previousPageName, previousPageUrl } = history.location.state ?? {};

if (previousPage === PREVIOUS_PAGE_JOB) {
crumbs.push({ name: 'Extractions', url: JOBS_PAGE });
crumbs.push({ name: 'Jobs', url: JOBS_PAGE });
crumbs.push({
name: previousPageName ?? '',
url: previousPageUrl
Expand Down
4 changes: 2 additions & 2 deletions web/src/shared/components/job/job-detail-view-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export const JobDetailViewHeader: React.FC<JobDetailViewHeaderProps> = ({
<BreadcrumbNavigation
breadcrumbs={
name
? [{ name: 'Extractions', url: JOBS_PAGE }, { name: name }]
: [{ name: 'Extractions', url: JOBS_PAGE }]
? [{ name: 'Jobs', url: JOBS_PAGE }, { name: name }]
: [{ name: 'Jobs', url: JOBS_PAGE }]
}
/>
</FlexRow>
Expand Down
4 changes: 2 additions & 2 deletions web/src/shared/constants/general.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const JOBS_PAGE = '/extractions';
export const JOBS_PAGE = '/jobs';
export const DOCUMENTS_PAGE = '/documents';
export const DASHBOARD_PAGE = '/dashboard';
export const DASHBOARD_PAGE = '/my tasks';
export const MODELS_PAGE = '/models';
export const PIPELINES_PAGE = '/pipelines';
export const ANNOTATION_PAGE = '/annotation/tasks';
Expand Down
7 changes: 2 additions & 5 deletions web/src/shared/contexts/current-user.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,10 @@ export const UserContextProvider: FC<{ currentUser: User | null }> = ({
const menu: (string | SubMenu)[] = [];
switch (true) {
case isEngineer:
menu.push('documents', 'extractions', 'dashboard', {
caption: 'ML Management',
items: ML_MENU_ITEMS
});
menu.push('documents', 'jobs', 'my tasks', 'categories', 'reports');
break;
case isAnnotator:
menu.push('dashboard');
menu.push('my tasks');
break;
case isSimple:
menu.push('my documents');
Expand Down

0 comments on commit 31d6044

Please sign in to comment.