diff --git a/client/pom.xml b/client/pom.xml index c34bbc989c..68791d0734 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -204,6 +204,9 @@ java.class.externalClassExposedInAPI + + java.method.numberOfParametersChanged + diff --git a/console2/src/api/service/console/user/index.ts b/console2/src/api/service/console/user/index.ts index 8df52b4979..319171ea79 100644 --- a/console2/src/api/service/console/user/index.ts +++ b/console2/src/api/service/console/user/index.ts @@ -2,7 +2,7 @@ * ***** * Concord * ----- - * Copyright (C) 2017 - 2018 Walmart Inc. + * Copyright (C) 2023 - 2018 Walmart Inc. * ----- * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,30 +18,34 @@ * ===== */ -import { ConcordKey, fetchJson, queryParams } from '../../../common'; -import { ProcessEntry, ProcessStatus } from '../../../process'; - -export interface ProjectProcesses { - projectName: ConcordKey; - running: number; -} +import {ConcordId, ConcordKey, fetchJson, queryParams} from '../../../common'; +import { ProcessEntry } from '../../../process'; export interface UserActivity { - processStats: { - status: ProcessStatus; - count: number; - }; - orgProcesses?: { - orgName: ConcordKey; - processes: ProjectProcesses[]; - }; processes: ProcessEntry[]; } +export interface ProcessCardEntry { + id: ConcordId; + orgName: ConcordKey; + projectName: ConcordKey; + repoName: ConcordKey; + entryPoint: string; + name: string; + description?: string; + icon?: string; + isCustomForm: boolean; +} + export const getActivity = ( - maxProjectsPerOrg: number, maxOwnProcesses: number ): Promise => fetchJson( - `/api/service/console/user/activity?${queryParams({ maxProjectsPerOrg, maxOwnProcesses })}` + `/api/v2/service/console/user/activity?${queryParams({ maxOwnProcesses })}` ); + +export const listProcessCards = ( +): Promise => + fetchJson( + `/api/v1/processcard` + ); \ No newline at end of file diff --git a/console2/src/components/molecules/UserProcessByOrgCards/index.tsx b/console2/src/components/molecules/UserProcessByOrgCards/index.tsx deleted file mode 100644 index c277228333..0000000000 --- a/console2/src/components/molecules/UserProcessByOrgCards/index.tsx +++ /dev/null @@ -1,104 +0,0 @@ -/*- - * ***** - * Concord - * ----- - * Copyright (C) 2017 - 2018 Walmart Inc. - * ----- - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ===== - */ - -import * as React from 'react'; -import { ConcordKey, queryParams } from '../../../api/common'; -import { Link } from 'react-router-dom'; -import { ProjectProcesses } from '../../../api/service/console/user'; -import { RedirectButton } from '../../organisms'; -import { ProcessStatus } from '../../../api/process'; - -export const MAX_CARD_ITEMS = 5; - -export interface OrgProjects { - orgName: ConcordKey; - projects: ProjectProcesses[]; -} - -interface Props { - items?: OrgProjects[]; -} - -const renderProject = (orgName: ConcordKey, project: ProjectProcesses) => { - return ( -
-
{project.running}
-
- - {project.projectName} - -
-
- ); -}; - -const renderCard = (orgName: ConcordKey, projects: ProjectProcesses[]) => { - return ( -
-
-
- - {orgName} - -
-
-
-
- {projects.slice(0, MAX_CARD_ITEMS).map((p) => renderProject(orgName, p))} -
-
- {projects.length > MAX_CARD_ITEMS && ( - - )} -
- ); -}; - -class UserProcessByOrgCards extends React.PureComponent { - render() { - const { items } = this.props; - if (items === undefined) { - return 'Loading'; - } - - if (items.length === 0) { - return 'No processes found.'; - } - - return ( -
{items.map((i) => renderCard(i.orgName, i.projects))}
- ); - } -} - -export default UserProcessByOrgCards; diff --git a/console2/src/components/molecules/UserProcessStats/index.tsx b/console2/src/components/molecules/UserProcessStats/index.tsx deleted file mode 100644 index 3015ad37b6..0000000000 --- a/console2/src/components/molecules/UserProcessStats/index.tsx +++ /dev/null @@ -1,62 +0,0 @@ -/*- - * ***** - * Concord - * ----- - * Copyright (C) 2017 - 2018 Walmart Inc. - * ----- - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ===== - */ - -import * as React from 'react'; -import { Link } from 'react-router-dom'; -import { getStatusSemanticColor, ProcessStatus } from '../../../api/process'; -import { queryParams } from '../../../api/common'; -import { useContext } from 'react'; -import { UserSessionContext } from '../../../session'; - -export interface StatusCount { - status: ProcessStatus; - count: number; -} - -interface Props { - items: StatusCount[]; -} - -const renderItem = (initiator: string, status: ProcessStatus, count: number) => { - return ( -
0 ? getStatusSemanticColor(status) : 'grey')} - key={status}> -
{count > 0 ? count : 0}
-
- {count > 0 ? ( - {status} - ) : ( - status - )} -
-
- ); -}; - -export default ({ items }: Props) => { - const { userInfo } = useContext(UserSessionContext); - - return ( -
- {items.map((v) => renderItem(userInfo!.username, v.status, v.count))} -
- ); -}; diff --git a/console2/src/components/molecules/index.tsx b/console2/src/components/molecules/index.tsx index e57d93e639..2b786d38de 100644 --- a/console2/src/components/molecules/index.tsx +++ b/console2/src/components/molecules/index.tsx @@ -63,8 +63,6 @@ export { default as SingleOperationPopup } from './SingleOperationPopup'; export { default as TeamAccessDropdown } from './TeamAccessDropdown'; export { default as TeamAccessList } from './TeamAccessList'; export { default as TeamRoleDropdown } from './TeamRoleDropdown'; -export { default as UserProcessByOrgCards } from './UserProcessByOrgCards'; -export { default as UserProcessStats } from './UserProcessStats'; export { default as WithCopyToClipboard } from './WithCopyToClipboard'; // https://github.com/facebook/create-react-app/issues/6054 diff --git a/console2/src/components/organisms/UserProcessActivity/index.tsx b/console2/src/components/organisms/UserProcessActivity/index.tsx index 058e8e1730..d6a4679a91 100644 --- a/console2/src/components/organisms/UserProcessActivity/index.tsx +++ b/console2/src/components/organisms/UserProcessActivity/index.tsx @@ -20,19 +20,13 @@ import * as React from 'react'; -import { ConcordKey } from '../../../api/common'; -import { UserProcessStats, UserProcessByOrgCards } from '../../molecules'; import { getActivity as apiGetActivity, - ProjectProcesses, - UserActivity + listProcessCards as apiListProcessCards, ProcessCardEntry } from '../../../api/service/console/user'; -import { Header } from 'semantic-ui-react'; -import { MAX_CARD_ITEMS, OrgProjects } from '../../molecules/UserProcessByOrgCards'; +import { Button, Card, CardGroup, Header, Icon, Image, Modal } from 'semantic-ui-react'; import { ProcessList } from '../../molecules/index'; -import { StatusCount } from '../../molecules/UserProcessStats'; -import { ProcessEntry, ProcessStatus } from '../../../api/process'; -import { comparators } from '../../../utils'; +import { ProcessEntry } from '../../../api/process'; import { CREATED_AT_COLUMN, INITIATOR_COLUMN, @@ -45,6 +39,8 @@ import { useCallback, useEffect, useState } from 'react'; import { useApi } from '../../../hooks/useApi'; import { LoadingDispatch } from '../../../App'; import RequestErrorActivity from '../RequestErrorActivity'; +import {Link} from "react-router-dom"; +import './styles.css'; export interface ExternalProps { forceRefresh: any; @@ -52,33 +48,81 @@ export interface ExternalProps { const MAX_OWN_PROCESSES = 10; -const DEFAULT_STATS: StatusCount[] = [ - { status: ProcessStatus.ENQUEUED, count: -1 }, - { status: ProcessStatus.RUNNING, count: -1 }, - { status: ProcessStatus.SUSPENDED, count: -1 }, - { status: ProcessStatus.FINISHED, count: -1 }, - { status: ProcessStatus.FAILED, count: -1 } -]; - -const statusOrder = [ - ProcessStatus.RUNNING, - ProcessStatus.SUSPENDED, - ProcessStatus.FINISHED, - ProcessStatus.FAILED -]; +const renderCard = (card: ProcessCardEntry) => { + return ( + + + {card.icon && } + {card.name} + + + Project: {card.projectName} + + + {card.description} + + + +
+ {card.isCustomForm && + Start process}> + +
+