diff --git a/app/cdap/api/pipeline.js b/app/cdap/api/pipeline.js index 0fc884f60c4..ce1bd15d0ea 100644 --- a/app/cdap/api/pipeline.js +++ b/app/cdap/api/pipeline.js @@ -41,7 +41,6 @@ var pipelineV1AppContextPath = `${pipelineV1AppPath}/contexts/:context`; export const MyPipelineApi = { list: apiCreator(dataSrc, 'GET', 'REQUEST', '/namespaces/:namespace/apps'), - listScm: apiCreator(dataSrc, 'GET', 'REQUEST', '/namespaces/:namespace/sourcecontrol/apps'), publish: apiCreator(dataSrc, 'PUT', 'REQUEST', basepath), schedule: apiCreator(dataSrc, 'POST', 'REQUEST', `${schedulePath}/resume`), @@ -81,5 +80,4 @@ export const MyPipelineApi = { ), getAppVersions: apiCreator(dataSrc, 'GET', 'REQUEST', `${basepath}/versions`), - getScmSyncStatus: apiCreator(dataSrc, 'GET', 'REQUEST', `${basepath}/sourcecontrol`), }; diff --git a/app/cdap/components/FooterContext/index.ts b/app/cdap/components/FooterContext/index.ts deleted file mode 100644 index a71cc8cb24a..00000000000 --- a/app/cdap/components/FooterContext/index.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright © 2024 Cask Data, 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 { createContext, useContext, useEffect } from 'react'; - -interface IFooterContext { - show: boolean; - setShow(val?: boolean): void; -} - -export const FooterContext = createContext({ - show: true, - setShow() { - return; - }, -}); - -export function useHideFooterInPage() { - const { setShow } = useContext(FooterContext); - - useEffect(() => { - setShow(false); - - return () => setShow(true); - }, []); - - return setShow; -} diff --git a/app/cdap/components/NamespaceAdmin/SourceControlManagement/SourceControlManagementForm.tsx b/app/cdap/components/NamespaceAdmin/SourceControlManagement/SourceControlManagementForm.tsx index c195ba2b56a..795a416c8f4 100644 --- a/app/cdap/components/NamespaceAdmin/SourceControlManagement/SourceControlManagementForm.tsx +++ b/app/cdap/components/NamespaceAdmin/SourceControlManagement/SourceControlManagementForm.tsx @@ -21,14 +21,13 @@ import { ISourceControlManagementConfig } from './types'; import PrimaryContainedButton from 'components/shared/Buttons/PrimaryContainedButton'; import PrimaryOutlinedButton from 'components/shared/Buttons/PrimaryOutlinedButton'; import ButtonLoadingHoc from 'components/shared/Buttons/ButtonLoadingHoc'; -import { authKeys, githubOnlyProviders, patConfigKeys, providers, scmAuthType } from './constants'; +import { authKeys, patConfigKeys, providers, scmAuthType } from './constants'; import { defaultSourceControlManagement, sourceControlManagementFormReducer } from './reducer'; import { addOrValidateSourceControlManagementForm } from '../store/ActionCreator'; import { getCurrentNamespace } from 'services/NamespaceStore'; import { EntityTopPanel } from 'components/EntityTopPanel'; import Alert from 'components/shared/Alert'; import PropertyRow from './PropertyRow'; -import { useFeatureFlagDefaultFalse } from 'services/react/customHooks/useFeatureFlag'; const PREFIX = 'features.SourceControlManagement.configModal'; @@ -87,9 +86,6 @@ const SourceControlManagementForm = ({ onToggle, isEdit, }: ISourceControlManagementFormProps) => { - const isGitlabAndBitbucketEnabled = useFeatureFlagDefaultFalse( - 'source.control.management.gitlab.bitbucket.enabled' - ); const [formState, formStateDispatch] = useReducer( sourceControlManagementFormReducer, defaultSourceControlManagement @@ -240,9 +236,7 @@ const SourceControlManagementForm = ({ 'widget-type': 'select', 'widget-attributes': { default: providers.github, - values: Object.values( - isGitlabAndBitbucketEnabled ? providers : githubOnlyProviders - ), + values: Object.values(providers), }, }} onChange={(val) => { @@ -332,9 +326,7 @@ const SourceControlManagementForm = ({ value={formState.config?.auth?.token} property={{ name: 'token', - description: T.translate(`${PREFIX}.auth.pat.tokenHelperText`, { - provider: formState.config?.provider || providers.github, - }).toString(), + description: T.translate(`${PREFIX}.auth.pat.tokenHelperText`).toString(), label: T.translate(`${PREFIX}.auth.pat.token`).toString(), required: !isEdit, 'widget-type': 'password', diff --git a/app/cdap/components/NamespaceAdmin/SourceControlManagement/constants.ts b/app/cdap/components/NamespaceAdmin/SourceControlManagement/constants.ts index 1acdbd99855..7467cfe9f65 100644 --- a/app/cdap/components/NamespaceAdmin/SourceControlManagement/constants.ts +++ b/app/cdap/components/NamespaceAdmin/SourceControlManagement/constants.ts @@ -22,15 +22,8 @@ export const scmAuthType = [ { id: 'PAT', label: T.translate(`${PREFIX}.configModal.auth.pat.label`) }, ]; -export const githubOnlyProviders = { - github: 'GITHUB', -}; - export const providers = { - ...githubOnlyProviders, - gitlab: 'GITLAB', - bitbucket: 'BITBUCKET_SERVER', - bitbucketCloud: 'BITBUCKET_CLOUD', + github: 'GITHUB', }; export const authKeys = ['type', 'token']; diff --git a/app/cdap/components/NamespaceAdmin/SourceControlManagement/index.tsx b/app/cdap/components/NamespaceAdmin/SourceControlManagement/index.tsx index ccdeca68232..938051ae986 100644 --- a/app/cdap/components/NamespaceAdmin/SourceControlManagement/index.tsx +++ b/app/cdap/components/NamespaceAdmin/SourceControlManagement/index.tsx @@ -27,6 +27,7 @@ import TableBody from 'components/shared/Table/TableBody'; import { useSelector } from 'react-redux'; import ActionsPopover from 'components/shared/ActionsPopover'; import { UnlinkSourceControlModal } from './UnlinkSourceControlModal'; +import StyledPasswordWrapper from 'components/AbstractWidget/FormInputs/Password'; import { ISourceControlManagementConfig } from './types'; import SourceControlManagementForm from './SourceControlManagementForm'; import PrimaryTextButton from 'components/shared/Buttons/PrimaryTextButton'; diff --git a/app/cdap/components/PipelineDetails/PipelineDetailsTopPanel/PipelineDetailsDetailsActions/PipelineDetailsActionsButton/index.tsx b/app/cdap/components/PipelineDetails/PipelineDetailsTopPanel/PipelineDetailsDetailsActions/PipelineDetailsActionsButton/index.tsx index 3ec74d218d3..c2b278527d6 100644 --- a/app/cdap/components/PipelineDetails/PipelineDetailsTopPanel/PipelineDetailsDetailsActions/PipelineDetailsActionsButton/index.tsx +++ b/app/cdap/components/PipelineDetails/PipelineDetailsTopPanel/PipelineDetailsDetailsActions/PipelineDetailsActionsButton/index.tsx @@ -40,7 +40,6 @@ import styled from 'styled-components'; import { LoadingAppLevel } from 'components/shared/LoadingAppLevel'; import Alert from 'components/shared/Alert'; import { - getScmSyncStatus, pullPipeline, setPullStatus, setSourceControlMeta, @@ -318,18 +317,13 @@ class PipelineDetailsActionsButton extends Component { - setSourceControlMeta(fileHash); - getScmSyncStatus(this.props.pipelineName); - }; - public renderCommitModal = () => { return ( ); }; diff --git a/app/cdap/components/PipelineDetails/PipelineDetailsTopPanel/PipelineDetailsMetadata.tsx b/app/cdap/components/PipelineDetails/PipelineDetailsTopPanel/PipelineDetailsMetadata.tsx index e33b7554979..0fdaa4da564 100644 --- a/app/cdap/components/PipelineDetails/PipelineDetailsTopPanel/PipelineDetailsMetadata.tsx +++ b/app/cdap/components/PipelineDetails/PipelineDetailsTopPanel/PipelineDetailsMetadata.tsx @@ -14,22 +14,16 @@ * the License. */ -import React, { useEffect } from 'react'; +import React from 'react'; import { connect, Provider } from 'react-redux'; import T from 'i18n-react'; import styled from 'styled-components'; -import { green, red } from '@material-ui/core/colors'; -import CheckCircleIcon from '@material-ui/icons/CheckCircle'; -import ErrorIcon from '@material-ui/icons/Error'; - import PipelineDetailStore from 'components/PipelineDetails/store'; import Tags from 'components/shared/Tags'; import IconSVG from 'components/shared/IconSVG'; import Popover from 'components/shared/Popover'; import { GLOBALS } from 'services/global-constants'; import { Chip } from '@material-ui/core'; -import { useFeatureFlagDefaultFalse } from 'services/react/customHooks/useFeatureFlag'; -import { getScmSyncStatus } from '../store/ActionCreator'; const PREFIX = 'features.PipelineDetails.TopPanel'; const SCM_PREFIX = 'features.SourceControlManagement'; @@ -41,7 +35,6 @@ const StyledSpan = styled.span` const StyledChip = styled(Chip)` height: 20px; - margin-right: 10px; `; const mapStateToPipelineTagsProps = (state) => { @@ -59,14 +52,13 @@ const mapStateToPipelineTagsProps = (state) => { const ConnectedPipelineTags = connect(mapStateToPipelineTagsProps)(Tags); const mapStateToPipelineDetailsMetadataProps = (state) => { - const { name, artifact, version, description, sourceControlMeta, scmSyncStatus } = state; + const { name, artifact, version, description, sourceControlMeta } = state; return { name, artifactName: artifact.name, version, description, sourceControlMeta, - scmSyncStatus, }; }; @@ -78,10 +70,6 @@ interface IPipelineDetailsMetadata { sourceControlMeta: { fileHash: string; }; - scmSyncStatus?: { - isSynced?: boolean; - lastModified?: number; - }; } const PipelineDetailsMetadata = ({ @@ -90,18 +78,7 @@ const PipelineDetailsMetadata = ({ version, description, sourceControlMeta, - scmSyncStatus, }: IPipelineDetailsMetadata) => { - const scmMultiSyncEnabled = useFeatureFlagDefaultFalse( - 'source.control.management.multi.app.enabled' - ); - - useEffect(() => { - if (name && scmMultiSyncEnabled) { - getScmSyncStatus(name); - } - }, [name]); - return (
@@ -124,7 +101,7 @@ const PipelineDetailsMetadata = ({ {description} - {!scmMultiSyncEnabled && sourceControlMeta && sourceControlMeta.fileHash && ( + {sourceControlMeta && sourceControlMeta.fileHash && ( )} - {scmMultiSyncEnabled && ( - - {scmSyncStatus.isSynced ? ( - } - /> - ) : ( - } - /> - )} - } - showOn="Hover" - placement="bottom" - > - {T.translate(`${SCM_PREFIX}.table.syncStatusHelperText`)} - - - )} {T.translate(`${PREFIX}.version`, { version })}
diff --git a/app/cdap/components/PipelineDetails/store/ActionCreator.js b/app/cdap/components/PipelineDetails/store/ActionCreator.js index 22486980ee1..c4e1d2db088 100644 --- a/app/cdap/components/PipelineDetails/store/ActionCreator.js +++ b/app/cdap/components/PipelineDetails/store/ActionCreator.js @@ -21,7 +21,6 @@ import { MyPipelineApi } from 'api/pipeline'; import { SourceControlApi } from 'api/sourcecontrol'; import PipelineDetailStore, { ACTIONS } from 'components/PipelineDetails/store'; import { getHydratorUrl } from 'services/UiUtils/UrlGenerator'; -import { getCurrentNamespace } from 'services/NamespaceStore'; const init = (pipeline) => { PipelineDetailStore.dispatch({ @@ -489,19 +488,6 @@ const setSourceControlMeta = (fileHash) => { }); }; -const getScmSyncStatus = (appId) => { - const namespace = getCurrentNamespace(); - MyPipelineApi.getScmSyncStatus({ - namespace, - appId, - }).subscribe((res) => { - PipelineDetailStore.dispatch({ - type: ACTIONS.SET_SCM_SYNC_STATUS, - payload: res, - }); - }); -}; - const reset = () => { PipelineDetailStore.dispatch({ type: ACTIONS.RESET, @@ -536,7 +522,6 @@ export { getRunsForVersion, getRunDetails, getAppVersion, - getScmSyncStatus, pollRuns, pollRunsCount, getNextRunTime, diff --git a/app/cdap/components/PipelineDetails/store/index.js b/app/cdap/components/PipelineDetails/store/index.js index cd49cc06c76..49118344713 100644 --- a/app/cdap/components/PipelineDetails/store/index.js +++ b/app/cdap/components/PipelineDetails/store/index.js @@ -56,7 +56,6 @@ const ACTIONS = { SET_PULL_LOADING: 'SET_PULL_LOADING', SET_PULL_STATUS: 'SET_PULL_STATUS', SET_SOURCE_CONTROL_META: 'SET_SOURCE_CONTROL_META', - SET_SCM_SYNC_STATUS: 'SET_SCM_SYNC_STATUS', RESET: 'RESET', }; @@ -106,7 +105,6 @@ const DEFAULT_PIPELINE_DETAILS = { sourceControlMeta: null, pullLoading: false, pullStatus: null, - scmSyncStatus: {}, }; const pipelineDetails = (state = DEFAULT_PIPELINE_DETAILS, action = defaultAction) => { @@ -286,11 +284,6 @@ const pipelineDetails = (state = DEFAULT_PIPELINE_DETAILS, action = defaultActio ...state, sourceControlMeta: action.payload.sourceControlMeta, }; - case ACTIONS.SET_SCM_SYNC_STATUS: - return { - ...state, - scmSyncStatus: action.payload, - }; case ACTIONS.RESET: return DEFAULT_PIPELINE_DETAILS; default: diff --git a/app/cdap/components/ResourceCenterEntity/PullPipelineWizard.tsx b/app/cdap/components/ResourceCenterEntity/PullPipelineWizard.tsx index 0a13fabbc27..390d3c99184 100644 --- a/app/cdap/components/ResourceCenterEntity/PullPipelineWizard.tsx +++ b/app/cdap/components/ResourceCenterEntity/PullPipelineWizard.tsx @@ -80,7 +80,7 @@ export const PullPipelineWizard = ({ isOpen, error, dispatch }: IPullPipelineWiz toggle={() => dispatch({ type: 'TOGGLE_MODAL' })} > - + diff --git a/app/cdap/components/SourceControlManagement/LocalPipelineListView/PipelineTable.tsx b/app/cdap/components/SourceControlManagement/LocalPipelineListView/PipelineTable.tsx index 0366f0f1a8e..a72dd70ec37 100644 --- a/app/cdap/components/SourceControlManagement/LocalPipelineListView/PipelineTable.tsx +++ b/app/cdap/components/SourceControlManagement/LocalPipelineListView/PipelineTable.tsx @@ -15,29 +15,9 @@ */ import React from 'react'; -import { useSelector } from 'react-redux'; -import { - Checkbox, - Table, - TableBody, - TableCell, - TableRow, - TableHead, - TablePagination, - TableSortLabel, -} from '@material-ui/core'; +import { Checkbox, Table, TableBody, TableCell, TableRow, TableHead } from '@material-ui/core'; import InfoIcon from '@material-ui/icons/Info'; -import { green, red } from '@material-ui/core/colors'; -import CheckCircleIcon from '@material-ui/icons/CheckCircle'; -import ErrorIcon from '@material-ui/icons/Error'; - -import { - isLastNamespacePipelinesPage, - setSelectedPipelines, - updatePushCurrentPage, - updatePushPageSize, - updatePushSortConfig, -} from '../store/ActionCreator'; +import { setSelectedPipelines } from '../store/ActionCreator'; import { IRepositoryPipeline } from '../types'; import T from 'i18n-react'; import StatusButton from 'components/StatusButton'; @@ -49,12 +29,8 @@ import { StatusCell, StyledFixedWidthCell, StyledPopover, - SyncStatusWrapper, - RefreshTimeLabel, } from '../styles'; -import { format, TYPES as FORMAT_TYPES } from 'services/DataFormatter'; -import { invertSortOrder } from '../helpers'; -import { useFeatureFlagDefaultFalse } from 'services/react/customHooks/useFeatureFlag'; +import { timeInstantToString } from 'services/DataFormatter'; const PREFIX = 'features.SourceControlManagement.table'; @@ -64,7 +40,6 @@ interface IRepositoryPipelineTableProps { showFailedOnly: boolean; enableMultipleSelection?: boolean; disabled?: boolean; - lastOperationInfoShown?: boolean; } export const LocalPipelineTable = ({ @@ -73,16 +48,8 @@ export const LocalPipelineTable = ({ showFailedOnly, enableMultipleSelection = false, disabled = false, - lastOperationInfoShown = true, }: IRepositoryPipelineTableProps) => { - const isBackendRefreshEnabled = useFeatureFlagDefaultFalse( - 'source.control.metadata.auto.refresh.enabled' - ); - const isSelected = (name: string) => selectedPipelines.indexOf(name) !== -1; - const { pageSize, sortBy, sortOrder, currentPage, lastRefreshTime } = useSelector( - ({ push }) => push - ); const handleSelectAllClick = (event: React.ChangeEvent) => { if (disabled) { @@ -131,35 +98,9 @@ export const LocalPipelineTable = ({ setSelectedPipelines(newSelected); }; - const handlePageSizeChange = (event: React.ChangeEvent) => { - const { value } = event.target; - updatePushPageSize(parseInt(value, 10)); - }; - - const handlePageChange = (event: React.MouseEvent | null, page: number) => { - updatePushCurrentPage(page); - }; - - const handleSortByName = (event: React.MouseEvent) => { - const newSortOrder = sortBy === 'NAME' ? invertSortOrder(sortOrder) : 'ASC'; - updatePushSortConfig('NAME', newSortOrder); - }; - - const handleSortBySyncDate = (event: React.MouseEvent) => { - const newSortOrder = sortBy === 'LAST_SYNCED_AT' ? invertSortOrder(sortOrder) : 'ASC'; - updatePushSortConfig('LAST_SYNCED_AT', newSortOrder); - }; - return ( - - {isBackendRefreshEnabled && lastRefreshTime && ( - - {T.translate(`${PREFIX}.lastRefreshedAtLabel`, { - datetime: format(lastRefreshTime, FORMAT_TYPES.TIMESTAMP_MILLIS), - })} - - )} - + +
@@ -176,42 +117,16 @@ export const LocalPipelineTable = ({ )} - - {enableMultipleSelection ? ( - - {T.translate(`${PREFIX}.pipelineName`)} - - ) : ( - T.translate(`${PREFIX}.pipelineName`) - )} - - {enableMultipleSelection ? ( - <> - - - {T.translate(`${PREFIX}.lastSyncDate`)} - - - {T.translate(`${PREFIX}.syncStatus`)} - - ) : ( - -
- {T.translate(`${PREFIX}.gitStatus`)} - } showOn="Hover"> - {T.translate(`${PREFIX}.gitStatusHelperText`)} - -
-
- )} + {T.translate(`${PREFIX}.pipelineName`)} + {T.translate(`${PREFIX}.lastSyncDate`)} + +
+ {T.translate(`${PREFIX}.gitStatus`)} + } showOn="Hover"> + {T.translate(`${PREFIX}.gitStatusHelperText`)} + +
+
@@ -254,53 +169,15 @@ export const LocalPipelineTable = ({ )} {pipeline.name} - {enableMultipleSelection ? ( - <> - - {format(pipeline.lastSyncDate, FORMAT_TYPES.TIMESTAMP_MILLIS)} - - - {pipeline.syncStatus ? ( - - - {T.translate(`${PREFIX}.gitSyncStatusSynced`)} - - ) : ( - - - {T.translate(`${PREFIX}.gitSyncStatusUnsynced`)} - - )} - - - ) : ( - - {pipeline.fileHash ? T.translate(`${PREFIX}.connected`) : '--'} - - )} + {timeInstantToString(pipeline.lastSyncDate)} + + {pipeline.fileHash ? T.translate(`${PREFIX}.connected`) : '--'} + ); })}
- {enableMultipleSelection && ( - - T.translate(`${PREFIX}.serverSidePaginationLabel`, { - from, - to: Math.min(to, currentPage * pageSize + localPipelines.length), - }) - } - nextIconButtonProps={{ disabled: isLastNamespacePipelinesPage() }} - /> - )}
); }; diff --git a/app/cdap/components/SourceControlManagement/LocalPipelineListView/index.tsx b/app/cdap/components/SourceControlManagement/LocalPipelineListView/index.tsx index 7cb45d2771a..1e0593b5aab 100644 --- a/app/cdap/components/SourceControlManagement/LocalPipelineListView/index.tsx +++ b/app/cdap/components/SourceControlManagement/LocalPipelineListView/index.tsx @@ -20,10 +20,8 @@ import { useSelector } from 'react-redux'; import { getCurrentNamespace } from 'services/NamespaceStore'; import { countPushFailedPipelines, - dismissOperationAlert, fetchLatestOperation, getNamespacePipelineList, - getNamespacePipelineListV2, pushMultipleSelectedPipelines, pushSelectedPipelines, reset, @@ -33,7 +31,6 @@ import { setNameFilter, toggleCommitModal, toggleShowFailedOnly, - updatePushSyncStatusFilter, } from '../store/ActionCreator'; import { SearchBox } from '../SearchBox'; import LoadingSVGCentered from 'components/shared/LoadingSVGCentered'; @@ -43,17 +40,11 @@ import cloneDeep from 'lodash/cloneDeep'; import PrimaryTextButton from 'components/shared/Buttons/PrimaryTextButton'; import { LocalPipelineTable } from './PipelineTable'; import { useOnUnmount } from 'services/react/customHooks/useOnUnmount'; -import { - FailStatusDiv, - FiltersAndStatusWrapper, - PipelineListContainer, - StyledSelectionStatusDiv, -} from '../styles'; +import { FailStatusDiv, PipelineListContainer, StyledSelectionStatusDiv } from '../styles'; import { IListResponse, IOperationMetaResponse, IOperationRun } from '../types'; import { useFeatureFlagDefaultFalse } from 'services/react/customHooks/useFeatureFlag'; import { parseOperationResource } from '../helpers'; import { OperationAlert } from '../OperationAlert'; -import { SyncStatusFilters } from '../SyncStatusFilters'; const PREFIX = 'features.SourceControlManagement.push'; @@ -62,14 +53,13 @@ export const LocalPipelineListView = () => { ready, localPipelines, nameFilter, - syncStatusFilter, selectedPipelines, commitModalOpen, loadingMessage, showFailedOnly, } = useSelector(({ push }) => push); - const { running: isAnOperationRunning, operation, showLastOperationInfo } = useSelector( + const { running: isAnOperationRunning, operation } = useSelector( ({ operationRun }) => operationRun ); @@ -80,11 +70,7 @@ export const LocalPipelineListView = () => { useEffect(() => { if (!ready) { - if (multiPushEnabled) { - getNamespacePipelineListV2(getCurrentNamespace()); - } else { - getNamespacePipelineList(getCurrentNamespace(), nameFilter); - } + getNamespacePipelineList(getCurrentNamespace(), nameFilter); } }, [ready]); @@ -96,23 +82,6 @@ export const LocalPipelineListView = () => { useOnUnmount(() => reset()); - const getSelectedPipelinesCountLabel = () => { - if (multiPushEnabled) { - if (selectedPipelines.length === 1) { - return T.translate(`${PREFIX}.singularPipelineSelected`); - } - - return T.translate(`${PREFIX}.pipelinesSelected`, { - selected: selectedPipelines.length, - }); - } - - return T.translate(`${PREFIX}.pipelinesSelectedWithTotal`, { - selected: selectedPipelines.length, - total: localPipelines.length, - }); - }; - const onPushSubmit = (commitMessage: string) => { resetPushStatus(); const pushedPipelines = cloneDeep(localPipelines); @@ -176,7 +145,6 @@ export const LocalPipelineListView = () => { showFailedOnly={showFailedOnly} enableMultipleSelection={multiPushEnabled} disabled={isAnOperationRunning} - lastOperationInfoShown={showLastOperationInfo} /> { return ( - {operation && multiPushEnabled && showLastOperationInfo && ( - - )} - - {selectedPipelines.length > 0 && ( - -
{getSelectedPipelinesCountLabel()}
- {!multiPushEnabled && pushFailedCount > 0 && ( - <> - - {pushFailedCount === 1 - ? T.translate(`${PREFIX}.pipelinePushedFail`) - : T.translate(`${PREFIX}.pipelinesPushedFail`, { - count: pushFailedCount.toString(), - })} - - - {showFailedOnly - ? T.translate('commons.showAll') - : T.translate('commons.showFailed')} - - - )} - {multiPushEnabled && pushFailedCount > 0 && ( - {T.translate(`${PREFIX}.pipelinesPushedFailMulti`)} - )} -
- )} - {multiPushEnabled && ( - - )} -
+ {operation && multiPushEnabled && } + {selectedPipelines.length > 0 && ( + +
+ {T.translate(`${PREFIX}.pipelinesSelected`, { + selected: selectedPipelines.length, + total: localPipelines.length, + })} +
+ {!multiPushEnabled && pushFailedCount > 0 && ( + <> + + {pushFailedCount === 1 + ? T.translate(`${PREFIX}.pipelinePushedFail`) + : T.translate(`${PREFIX}.pipelinesPushedFail`, { + count: pushFailedCount.toString(), + })} + + + {showFailedOnly + ? T.translate('commons.showAll') + : T.translate('commons.showFailed')} + + + )} + {multiPushEnabled && pushFailedCount > 0 && ( + {T.translate(`${PREFIX}.pipelinesPushedFailMulti`)} + )} +
+ )} {ready ? LocalPipelineTableComp() : } { +export const OperationAlert = ({ operation }: IOperationBannerProps) => { const [viewErrorExpanded, setViewErrorExpanded] = useState(false); const getOperationAction = () => { @@ -92,22 +87,11 @@ export const OperationAlert = ({ operation, onClose }: IOperationBannerProps) => > {viewErrorExpanded ? : } - {onClose && ( - - )} ); } - return ( - onClose && ( - - ) - ); + return undefined; }; const renderOperationTime = () => { diff --git a/app/cdap/components/SourceControlManagement/RemotePipelineListView/RemotePipelineTable.tsx b/app/cdap/components/SourceControlManagement/RemotePipelineListView/RemotePipelineTable.tsx index 7ca46cd0412..dca38c86905 100644 --- a/app/cdap/components/SourceControlManagement/RemotePipelineListView/RemotePipelineTable.tsx +++ b/app/cdap/components/SourceControlManagement/RemotePipelineListView/RemotePipelineTable.tsx @@ -15,42 +15,13 @@ */ import React from 'react'; -import { useSelector } from 'react-redux'; import T from 'i18n-react'; - -import { - Checkbox, - Table, - TableBody, - TableCell, - TableHead, - TablePagination, - TableRow, -} from '@material-ui/core'; -import TableSortLabel from '@material-ui/core/TableSortLabel'; -import { green, red } from '@material-ui/core/colors'; -import CheckCircleIcon from '@material-ui/icons/CheckCircle'; -import ErrorIcon from '@material-ui/icons/Error'; +import { Checkbox, Table, TableBody, TableCell, TableRow, TableHead } from '@material-ui/core'; +import { setSelectedRemotePipelines } from '../store/ActionCreator'; +import { IRepositoryPipeline } from '../types'; import StatusButton from 'components/StatusButton'; import { SUPPORT } from 'components/StatusButton/constants'; -import { TYPES as FORMAT_TYPES, format } from 'services/DataFormatter'; -import { invertSortOrder } from '../helpers'; -import { - isLastRemotePipelinesPage, - setSelectedRemotePipelines, - updatePullCurrentPage, - updatePullPageSize, - updatePullSortConfig, -} from '../store/ActionCreator'; -import { - RefreshTimeLabel, - StyledTableCell, - StyledTableRow, - SyncStatusWrapper, - TableBox, -} from '../styles'; -import { IRepositoryPipeline } from '../types'; -import { useFeatureFlagDefaultFalse } from 'services/react/customHooks/useFeatureFlag'; +import { StyledTableCell, StyledTableRow, TableBox } from '../styles'; const PREFIX = 'features.SourceControlManagement.table'; @@ -60,7 +31,6 @@ interface IRepositoryPipelineTableProps { showFailedOnly: boolean; enableMultipleSelection?: boolean; disabled?: boolean; - lastOperationInfoShown?: boolean; } export const RemotePipelineTable = ({ @@ -69,15 +39,8 @@ export const RemotePipelineTable = ({ showFailedOnly, enableMultipleSelection = false, disabled = false, - lastOperationInfoShown = true, }: IRepositoryPipelineTableProps) => { - const isBackendRefreshEnabled = useFeatureFlagDefaultFalse( - 'source.control.metadata.auto.refresh.enabled' - ); const isSelected = (name: string) => selectedPipelines.indexOf(name) !== -1; - const { pageSize, sortBy, sortOrder, currentPage, lastRefreshTime } = useSelector( - ({ pull }) => pull - ); const handleClick = (event: React.MouseEvent, name: string) => { if (disabled) { @@ -92,6 +55,7 @@ export const RemotePipelineTable = ({ }; const handleSingleSelection = (name: string) => { + // currently only 1 application pull at a time is allowed, so single selection const selectedIndex = selectedPipelines.indexOf(name); let newSelected = []; if (selectedIndex === -1) { @@ -126,35 +90,9 @@ export const RemotePipelineTable = ({ setSelectedRemotePipelines([]); }; - const handlePageSizeChange = (event: React.ChangeEvent) => { - const { value } = event.target; - updatePullPageSize(parseInt(value, 10)); - }; - - const handlePageChange = (event: React.MouseEvent | null, page: number) => { - updatePullCurrentPage(page); - }; - - const handleSortByName = (event: React.MouseEvent) => { - const newSortOrder = sortBy === 'NAME' ? invertSortOrder(sortOrder) : 'ASC'; - updatePullSortConfig('NAME', newSortOrder); - }; - - const handleSortBySyncDate = (event: React.MouseEvent) => { - const newSortOrder = sortBy === 'LAST_SYNCED_AT' ? invertSortOrder(sortOrder) : 'ASC'; - updatePullSortConfig('LAST_SYNCED_AT', newSortOrder); - }; - return ( - - {isBackendRefreshEnabled && lastRefreshTime && ( - - {T.translate(`${PREFIX}.lastRefreshedAtLabel`, { - datetime: format(lastRefreshTime, FORMAT_TYPES.TIMESTAMP_MILLIS), - })} - - )} - + +
@@ -172,33 +110,7 @@ export const RemotePipelineTable = ({ )} - - {enableMultipleSelection ? ( - - {T.translate(`${PREFIX}.pipelineName`)} - - ) : ( - T.translate(`${PREFIX}.pipelineName`) - )} - - {enableMultipleSelection && ( - <> - - - {T.translate(`${PREFIX}.lastSyncDate`)} - - - {T.translate(`${PREFIX}.syncStatus`)} - - )} + {T.translate(`${PREFIX}.pipelineName`)} @@ -242,49 +154,11 @@ export const RemotePipelineTable = ({ )} {pipeline.name} - {enableMultipleSelection && ( - <> - - {format(pipeline.lastSyncDate, FORMAT_TYPES.TIMESTAMP_MILLIS)} - - - {pipeline.syncStatus ? ( - - - {T.translate(`${PREFIX}.gitSyncStatusSynced`)} - - ) : ( - - - {T.translate(`${PREFIX}.gitSyncStatusUnsynced`)} - - )} - - - )} ); })}
- {enableMultipleSelection && ( - - T.translate(`${PREFIX}.serverSidePaginationLabel`, { - from, - to: Math.min(to, currentPage * pageSize + remotePipelines.length), - }) - } - nextIconButtonProps={{ disabled: isLastRemotePipelinesPage() }} - /> - )}
); }; diff --git a/app/cdap/components/SourceControlManagement/RemotePipelineListView/index.tsx b/app/cdap/components/SourceControlManagement/RemotePipelineListView/index.tsx index 87c4a1a7fe6..bbeeadfbdda 100644 --- a/app/cdap/components/SourceControlManagement/RemotePipelineListView/index.tsx +++ b/app/cdap/components/SourceControlManagement/RemotePipelineListView/index.tsx @@ -14,62 +14,48 @@ * the License. */ -import React, { useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; import T from 'i18n-react'; -import cloneDeep from 'lodash/cloneDeep'; import { useSelector } from 'react-redux'; - -import { SUPPORT } from 'components/StatusButton/constants'; -import Alert from 'components/shared/Alert'; -import PrimaryContainedButton from 'components/shared/Buttons/PrimaryContainedButton'; -import PrimaryTextButton from 'components/shared/Buttons/PrimaryTextButton'; -import { LoadingAppLevel } from 'components/shared/LoadingAppLevel'; -import LoadingSVGCentered from 'components/shared/LoadingSVGCentered'; -import { getCurrentNamespace } from 'services/NamespaceStore'; -import { getHydratorUrl } from 'services/UiUtils/UrlGenerator'; -import { useFeatureFlagDefaultFalse } from 'services/react/customHooks/useFeatureFlag'; -import { useOnUnmount } from 'services/react/customHooks/useOnUnmount'; -import { OperationAlert } from '../OperationAlert'; +import cloneDeep from 'lodash/cloneDeep'; import { SearchBox } from '../SearchBox'; -import { SyncStatusFilters } from '../SyncStatusFilters'; -import { parseOperationResource } from '../helpers'; +import { FailStatusDiv, PipelineListContainer, StyledSelectionStatusDiv } from '../styles'; +import { RemotePipelineTable } from './RemotePipelineTable'; import { countPullFailedPipelines, - dismissOperationAlert, - fetchLatestOperation, getRemotePipelineList, - getRemotePipelineListV2, - pullAndDeployMultipleSelectedRemotePipelines, pullAndDeploySelectedRemotePipelines, resetPullStatus, - resetRemote, setPullViewErrorMsg, + resetRemote, setRemoteLoadingMessage, setRemoteNameFilter, setRemotePipelines, toggleRemoteShowFailedOnly, - updatePullSyncStatusFilter, + pullAndDeployMultipleSelectedRemotePipelines, + fetchLatestOperation, } from '../store/ActionCreator'; -import { - FailStatusDiv, - FiltersAndStatusWrapper, - PipelineListContainer, - StyledSelectionStatusDiv, -} from '../styles'; -import { IListResponse, IOperationMetaResponse } from '../types'; -import { RemotePipelineTable } from './RemotePipelineTable'; +import { LoadingAppLevel } from 'components/shared/LoadingAppLevel'; +import { getCurrentNamespace } from 'services/NamespaceStore'; +import LoadingSVGCentered from 'components/shared/LoadingSVGCentered'; +import PrimaryTextButton from 'components/shared/Buttons/PrimaryTextButton'; +import PrimaryContainedButton from 'components/shared/Buttons/PrimaryContainedButton'; +import { useOnUnmount } from 'services/react/customHooks/useOnUnmount'; +import { getHydratorUrl } from 'services/UiUtils/UrlGenerator'; +import { SUPPORT } from 'components/StatusButton/constants'; +import { IListResponse, IOperationMetaResponse, IOperationRun } from '../types'; +import Alert from 'components/shared/Alert'; +import { useFeatureFlagDefaultFalse } from 'services/react/customHooks/useFeatureFlag'; +import { parseOperationResource } from '../helpers'; +import { OperationAlert } from '../OperationAlert'; const PREFIX = 'features.SourceControlManagement.pull'; interface IRemotePipelineListViewProps { redirectOnSubmit?: boolean; - singlePipelineMode?: boolean; } -export const RemotePipelineListView = ({ - redirectOnSubmit, - singlePipelineMode, -}: IRemotePipelineListViewProps) => { +export const RemotePipelineListView = ({ redirectOnSubmit }: IRemotePipelineListViewProps) => { const { ready, remotePipelines, @@ -78,29 +64,20 @@ export const RemotePipelineListView = ({ loadingMessage, showFailedOnly, pullViewErrorMsg, - syncStatusFilter, } = useSelector(({ pull }) => pull); - const { running: isAnOperationRunning, operation, showLastOperationInfo } = useSelector( + const { running: isAnOperationRunning, operation } = useSelector( ({ operationRun }) => operationRun ); - const multiPullEnabled = - useFeatureFlagDefaultFalse('source.control.management.multi.app.enabled') && - !singlePipelineMode; + const multiPullEnabled = useFeatureFlagDefaultFalse( + 'source.control.management.multi.app.enabled' + ); + const pullFailedCount = countPullFailedPipelines(); - let pullFailedCount = 0; - if (!multiPullEnabled) { - pullFailedCount = countPullFailedPipelines(); - } useEffect(() => { if (!ready) { - const ns = getCurrentNamespace(); - if (multiPullEnabled) { - getRemotePipelineListV2(ns); - } else { - getRemotePipelineList(ns); - } + getRemotePipelineList(getCurrentNamespace()); } }, [ready]); @@ -112,37 +89,9 @@ export const RemotePipelineListView = ({ useOnUnmount(() => resetRemote()); - let filteredPipelines = remotePipelines; - if (!multiPullEnabled) { - filteredPipelines = remotePipelines.filter((pipeline) => - pipeline.name.toLowerCase().includes(nameFilter.toLowerCase()) - ); - } - - const handleNameFilterChange = (value: string) => { - if (multiPullEnabled) { - setRemoteNameFilter(value, true); - } else { - setRemoteNameFilter(value); - } - }; - - const getSelectedPipelinesCountLabel = () => { - if (multiPullEnabled) { - if (selectedPipelines.length === 1) { - return T.translate(`${PREFIX}.singularPipelineSelected`); - } - - return T.translate(`${PREFIX}.pipelinesSelected`, { - selected: selectedPipelines.length, - }); - } - - return T.translate(`${PREFIX}.pipelinesSelectedWithTotal`, { - selected: selectedPipelines.length, - total: remotePipelines.length, - }); - }; + const filteredPipelines = remotePipelines.filter((pipeline) => + pipeline.name.toLowerCase().includes(nameFilter.toLowerCase()) + ); const onPullSubmit = () => { resetPullStatus(); @@ -209,7 +158,6 @@ export const RemotePipelineListView = ({ showFailedOnly={showFailedOnly} enableMultipleSelection={multiPullEnabled} disabled={isAnOperationRunning} - lastOperationInfoShown={showLastOperationInfo} /> setPullViewErrorMsg()} /> - {operation && multiPullEnabled && showLastOperationInfo && ( - + + {operation && multiPullEnabled && } + {selectedPipelines.length > 0 && ( + +
+ {T.translate(`${PREFIX}.pipelinesSelected`, { + selected: selectedPipelines.length, + total: remotePipelines.length, + })} +
+ {pullFailedCount > 0 && ( + <> + + {pullFailedCount === 1 + ? T.translate(`${PREFIX}.pipelinePulledFail`) + : T.translate(`${PREFIX}.pipelinesPulledFail`, { + count: pullFailedCount.toString(), + })} + + + {showFailedOnly + ? T.translate('commons.showAll') + : T.translate('commons.showFailed')} + + + )} +
)} - - - - {selectedPipelines.length > 0 && ( - -
{getSelectedPipelinesCountLabel()}
- {!multiPullEnabled && pullFailedCount > 0 && ( - <> - - {pullFailedCount === 1 - ? T.translate(`${PREFIX}.pipelinePulledFail`) - : T.translate(`${PREFIX}.pipelinesPulledFail`, { - count: pullFailedCount.toString(), - })} - - - {showFailedOnly - ? T.translate('commons.showAll') - : T.translate('commons.showFailed')} - - - )} - {multiPullEnabled && pullFailedCount > 0 && ( - {T.translate(`${PREFIX}.pipelinesPulledFailMulti`)} - )} -
- )} - {multiPullEnabled && ( - - )} -
{ready ? RemotePipelineTableComp() : }
void; -} - -export const SyncStatusFilters = ({ - syncStatusFilter, - setSyncStatusFilter, -}: ISyncStatusFiltersProps) => { - const setFilter = (filterVal?: SyncStatusFilter) => () => setSyncStatusFilter(filterVal); - - return ( - - {T.translate(`${PREFIX}.filtersLabel`)}: - - - - - - - ); -}; diff --git a/app/cdap/components/SourceControlManagement/SyncTabs.tsx b/app/cdap/components/SourceControlManagement/SyncTabs.tsx index 4913e916f82..833f4ba2fc5 100644 --- a/app/cdap/components/SourceControlManagement/SyncTabs.tsx +++ b/app/cdap/components/SourceControlManagement/SyncTabs.tsx @@ -22,61 +22,47 @@ import styled from 'styled-components'; import T from 'i18n-react'; import { RemotePipelineListView } from './RemotePipelineListView'; import { FeatureProvider } from 'services/react/providers/featureFlagProvider'; -import { - getNamespacePipelineList, - getNamespacePipelineListV2, - getRemotePipelineList, - getRemotePipelineListV2, -} from './store/ActionCreator'; +import { getNamespacePipelineList, getRemotePipelineList } from './store/ActionCreator'; import { getCurrentNamespace } from 'services/NamespaceStore'; -import { useFeatureFlagDefaultFalse } from 'services/react/customHooks/useFeatureFlag'; const PREFIX = 'features.SourceControlManagement'; const StyledDiv = styled.div` - padding: 4px 10px; -`; - -const StyledTabs = styled(Tabs)` - border-bottom: 1px solid #e8e8e8; + padding: 10px; + margin-top: 10px; `; const ScmSyncTabs = () => { const [tabIndex, setTabIndex] = useState(0); - const multiOpEnabled = useFeatureFlagDefaultFalse('source.control.management.multi.app.enabled'); - const ns = getCurrentNamespace(); - function fetchNamespacePipelines(nameFilterStr: string) { - if (multiOpEnabled) { - getNamespacePipelineListV2(ns); - } else { - getNamespacePipelineList(ns, nameFilterStr); + const { ready: pushStateReady, nameFilter } = useSelector(({ push }) => push); + useEffect(() => { + if (!pushStateReady) { + getNamespacePipelineList(getCurrentNamespace(), nameFilter); } - } + }, [pushStateReady]); - function fetchRemotePipelines() { - if (multiOpEnabled) { - getRemotePipelineListV2(ns); - } else { - getRemotePipelineList(ns); + const { ready: pullStateReady } = useSelector(({ pull }) => pull); + useEffect(() => { + if (!pullStateReady) { + getRemotePipelineList(getCurrentNamespace()); } - } + }, [pullStateReady]); - const { nameFilter } = useSelector(({ push }) => push); const handleTabChange = (e, newValue) => { setTabIndex(newValue); // refetch latest pipeline data, while displaying possibly stale data if (newValue === 0) { - fetchNamespacePipelines(nameFilter); + getNamespacePipelineList(getCurrentNamespace(), nameFilter); } else { - fetchRemotePipelines(); + getRemotePipelineList(getCurrentNamespace()); } }; return ( <> - { > - + diff --git a/app/cdap/components/SourceControlManagement/helpers.ts b/app/cdap/components/SourceControlManagement/helpers.ts index fd499372d2f..a6ac2dbe6b9 100644 --- a/app/cdap/components/SourceControlManagement/helpers.ts +++ b/app/cdap/components/SourceControlManagement/helpers.ts @@ -22,7 +22,6 @@ import { IOperationResource, IOperationRun, IOperationResourceScopedErrorMessage, - SortOrder, } from './types'; import T from 'i18n-react'; import { ITimeInstant, timeInstantToString } from 'services/DataFormatter'; @@ -155,7 +154,3 @@ export const getOperationRunTime = (operation: IOperationRun): string => { } return null; }; - -export function invertSortOrder(ord: SortOrder): SortOrder { - return ord === 'ASC' ? 'DESC' : 'ASC'; -} diff --git a/app/cdap/components/SourceControlManagement/index.tsx b/app/cdap/components/SourceControlManagement/index.tsx index 9b47c990af6..6f4f5229408 100644 --- a/app/cdap/components/SourceControlManagement/index.tsx +++ b/app/cdap/components/SourceControlManagement/index.tsx @@ -24,15 +24,11 @@ import { useHistory } from 'react-router'; import { useOnUnmount } from 'services/react/customHooks/useOnUnmount'; import { reset, resetRemote } from './store/ActionCreator'; import ScmSyncTabs from './SyncTabs'; -import { useHideFooterInPage } from 'components/FooterContext'; -import { FeatureProvider } from 'services/react/providers/featureFlagProvider'; const PREFIX = 'features.SourceControlManagement'; const SourceControlManagementSyncView = () => { const history = useHistory(); - useHideFooterInPage(); - useOnUnmount(() => { resetRemote(); reset(); @@ -52,9 +48,7 @@ const SourceControlManagementSyncView = () => { history.push(closeAndBackLink); }} /> - - - + ); }; diff --git a/app/cdap/components/SourceControlManagement/store/ActionCreator.ts b/app/cdap/components/SourceControlManagement/store/ActionCreator.ts index 237dc6b2472..e4250eac356 100644 --- a/app/cdap/components/SourceControlManagement/store/ActionCreator.ts +++ b/app/cdap/components/SourceControlManagement/store/ActionCreator.ts @@ -21,103 +21,20 @@ import { of } from 'rxjs/observable/of'; import { MyPipelineApi } from 'api/pipeline'; import { BATCH_PIPELINE_TYPE } from 'services/helpers'; import SourceControlManagementSyncStore, { - DEFAULT_PAGE_SIZE, OperationRunActions, PullFromGitActions, PushToGitActions, } from '.'; import { SourceControlApi } from 'api/sourcecontrol'; import { LongRunningOperationApi } from 'api/longRunningOperation'; -import { - IPipeline, - IPushResponse, - IRepositoryPipeline, - IOperationRun, - IPipelineDetail, - IPipelineListResponse, - SyncStatusFilter, - SortBy, - SortOrder, -} from '../types'; +import { IPipeline, IPushResponse, IRepositoryPipeline, IOperationRun } from '../types'; import { SUPPORT } from 'components/StatusButton/constants'; import { compareTimeInstant } from '../helpers'; import { getCurrentNamespace } from 'services/NamespaceStore'; -import { timeInstantToMs } from 'services/DataFormatter'; const PREFIX = 'features.SourceControlManagement'; -const FILTER_SPLITTER = 'AND'; -const NAME_FILTER_KEY = 'NAME_CONTAINS'; -const SYNC_STATUS_FILTER_KEY = 'IS_SYNCED'; - -function makeScmQueryFilter(nameFilter?: string, syncStatusFilter?: SyncStatusFilter): string { - const filters = []; - if (nameFilter) { - filters.push(`"${NAME_FILTER_KEY}=${nameFilter}"`); - } - if (syncStatusFilter) { - filters.push(`"${SYNC_STATUS_FILTER_KEY}=${syncStatusFilter === 'SYNCED'}"`); - } - - return filters.join(FILTER_SPLITTER) || undefined; -} - -function getPageToken(nextPageTokens: string[], pageNo: number = 0) { - if (pageNo === 0) { - return undefined; - } - - // as the pageToken for the current page is the nextPageToken of the previous - return nextPageTokens[pageNo - 1]; -} - -export function isLastRemotePipelinesPage() { - const { nextPageTokens, currentPage } = SourceControlManagementSyncStore.getState().pull; - return !nextPageTokens[currentPage]; -} - -export function isLastNamespacePipelinesPage() { - const { nextPageTokens, currentPage } = SourceControlManagementSyncStore.getState().push; - return !nextPageTokens[currentPage]; -} // push actions -export const getNamespacePipelineListV2 = (namespace) => { - const { - nameFilter, - syncStatusFilter, - pageSize, - nextPageTokens, - currentPage, - sortBy, - sortOrder, - } = SourceControlManagementSyncStore.getState().push; - const filter = makeScmQueryFilter(nameFilter, syncStatusFilter); - MyPipelineApi.listScm({ - namespace, - pageSize, - pageToken: getPageToken(nextPageTokens, currentPage), - sortOrder, - sortOrderOn: sortBy, - filter, - }).subscribe( - (res: IPipelineListResponse) => { - const nsPipelines = res.apps.map((pipeline) => ({ - name: pipeline.name, - lastSyncDate: pipeline.lastSyncedAt, - syncStatus: pipeline.isSynced, - error: null, - status: null, - })); - setLocalPipelines(nsPipelines); - setPushNextPageToken(currentPage, res.nextPageToken); - setPushLastRefreshTime(res.lastRefreshTime); - }, - (err) => { - setLocalPipelines([]); - } - ); -}; - export const getNamespacePipelineList = (namespace, nameFilter = null) => { MyPipelineApi.list({ namespace, @@ -130,7 +47,7 @@ export const getNamespacePipelineList = (namespace, nameFilter = null) => { return { name: pipeline.name, fileHash: pipeline.sourceControlMeta?.fileHash, - lastSyncDate: timeInstantToMs(pipeline.sourceControlMeta?.lastSyncedAt), + lastSyncDate: pipeline.sourceControlMeta?.lastSyncedAt, error: null, status: null, }; @@ -157,7 +74,7 @@ const applySearch = () => { type: PushToGitActions.applySearch, }); }; -const debouncedApplySearch = debounce(applySearch, 300); +const debouncedApplySearch = debounce(applySearch, 1000); export const setNameFilter = (nameFilter: string) => { SourceControlManagementSyncStore.dispatch({ @@ -187,7 +104,7 @@ export const pushSelectedPipelines = (namespace, apps, payload, loadingMessageDi appId, }; return SourceControlApi.push(params, payload).pipe( - map((res: { apps?: IPushResponse[] } | string) => { + map((res: IPushResponse | string) => { if (typeof res === 'string') { return { message: res, name: appId, status: SUPPORT.partial }; } @@ -195,7 +112,7 @@ export const pushSelectedPipelines = (namespace, apps, payload, loadingMessageDi message: null, name: appId, status: SUPPORT.yes, - fileHash: res.apps[0]?.fileHash, + fileHash: res.fileHash, }; }), catchError((err) => { @@ -281,44 +198,6 @@ export const reset = () => { }; // pull actions -export const getRemotePipelineListV2 = (namespace) => { - const { - nameFilter, - syncStatusFilter, - pageSize, - nextPageTokens, - currentPage, - sortBy, - sortOrder, - } = SourceControlManagementSyncStore.getState().pull; - const filter = makeScmQueryFilter(nameFilter, syncStatusFilter); - SourceControlApi.list({ - namespace, - pageSize, - pageToken: getPageToken(nextPageTokens, currentPage), - sortOrder, - sortOrderOn: sortBy, - filter, - }).subscribe( - (res: IPipelineListResponse) => { - const remotePipelines = res.apps.map((pipeline) => ({ - name: pipeline.name, - lastSyncDate: pipeline.lastSyncedAt, - syncStatus: pipeline.isSynced, - error: null, - status: null, - })); - setRemotePipelines(remotePipelines); - setPullNextPageToken(currentPage, res.nextPageToken); - setPullLastRefreshTime(res.lastRefreshTime); - }, - (err) => { - setRemotePipelines([]); - setPullViewErrorMsg(err.message || T.translate(`${PREFIX}.pull.pipelinesListedFail`)); - } - ); -}; - export const getRemotePipelineList = (namespace) => { SourceControlApi.list({ namespace, @@ -360,24 +239,13 @@ export const setPullViewErrorMsg = (errorMsg: string = '') => { }); }; -const applySearchRemote = () => { - SourceControlManagementSyncStore.dispatch({ - type: PullFromGitActions.applySearch, - }); -}; -const debouncedApplySearchRemote = debounce(applySearchRemote, 300); - -export const setRemoteNameFilter = (nameFilter: string, refetch: boolean = false) => { +export const setRemoteNameFilter = (nameFilter: string) => { SourceControlManagementSyncStore.dispatch({ type: PullFromGitActions.setNameFilter, payload: { nameFilter, }, }); - - if (refetch) { - debouncedApplySearchRemote(); - } }; export const setSelectedRemotePipelines = (selectedPipelines: string[]) => { @@ -501,8 +369,6 @@ export const setLatestOperation = (namespace: string, operation: IOperationRun) type: OperationRunActions.setLatestOperation, payload: res, }); - markPullViewStale(); - markPushViewStale(); } }); }; @@ -573,132 +439,3 @@ export const refetchAllPipelines = () => { getNamespacePipelineList(getCurrentNamespace()); getRemotePipelineList(getCurrentNamespace()); }; - -export const dismissOperationAlert = () => { - SourceControlManagementSyncStore.dispatch({ - type: OperationRunActions.setShowLastOperationInfo, - payload: false, - }); -}; - -export const updatePullSyncStatusFilter = (payload?: SyncStatusFilter) => { - SourceControlManagementSyncStore.dispatch({ - type: PullFromGitActions.setSyncStatusFilter, - payload, - }); - applySearchRemote(); -}; - -export const updatePushSyncStatusFilter = (payload?: SyncStatusFilter) => { - SourceControlManagementSyncStore.dispatch({ - type: PushToGitActions.setSyncStatusFilter, - payload, - }); - applySearch(); -}; - -export const updatePullPageSize = (payload: number = DEFAULT_PAGE_SIZE) => { - SourceControlManagementSyncStore.dispatch({ - type: PullFromGitActions.setPageSize, - payload, - }); - // if pageSize changes move to the first page, - // to preserve consistency of pagination - updatePullCurrentPage(0); -}; - -export const updatePushPageSize = (payload: number = DEFAULT_PAGE_SIZE) => { - SourceControlManagementSyncStore.dispatch({ - type: PushToGitActions.setPageSize, - payload, - }); - // if pageSize changes move to the first page, - // to preserve consistency of pagination - updatePushCurrentPage(0); -}; - -export const updatePullSortConfig = (sortBy: SortBy, sortOrder: SortOrder) => { - SourceControlManagementSyncStore.dispatch({ - type: PullFromGitActions.setSortConfig, - payload: { - sortBy, - sortOrder, - }, - }); - // if sort config changes, move to the first page - updatePullCurrentPage(0); -}; - -export const updatePushSortConfig = (sortBy: SortBy, sortOrder: SortOrder) => { - SourceControlManagementSyncStore.dispatch({ - type: PushToGitActions.setSortConfig, - payload: { - sortBy, - sortOrder, - }, - }); - // if sort config changes, move to the first page - updatePushCurrentPage(0); -}; - -const setPullNextPageToken = (currentPage: number, nextToken?: string) => { - SourceControlManagementSyncStore.dispatch({ - type: PullFromGitActions.setPageToken, - payload: { - currentPage, - nextToken, - }, - }); -}; - -const setPullLastRefreshTime = (payload?: number) => { - SourceControlManagementSyncStore.dispatch({ - type: PullFromGitActions.setLastRefreshTime, - payload, - }); -}; - -const setPushNextPageToken = (currentPage: number, nextToken?: string) => { - SourceControlManagementSyncStore.dispatch({ - type: PushToGitActions.setPageToken, - payload: { - currentPage, - nextToken, - }, - }); -}; - -const setPushLastRefreshTime = (payload?: number) => { - SourceControlManagementSyncStore.dispatch({ - type: PushToGitActions.setLastRefreshTime, - payload, - }); -}; - -export const updatePullCurrentPage = (payload: number) => { - SourceControlManagementSyncStore.dispatch({ - type: PullFromGitActions.setCurrentPage, - payload, - }); - markPullViewStale(); -}; - -export const updatePushCurrentPage = (payload: number) => { - SourceControlManagementSyncStore.dispatch({ - type: PushToGitActions.setCurrentPage, - payload, - }); - markPushViewStale(); -}; - -export const markPullViewStale = () => { - SourceControlManagementSyncStore.dispatch({ - type: PullFromGitActions.markStale, - }); -}; - -export const markPushViewStale = () => { - SourceControlManagementSyncStore.dispatch({ - type: PushToGitActions.markStale, - }); -}; diff --git a/app/cdap/components/SourceControlManagement/store/index.ts b/app/cdap/components/SourceControlManagement/store/index.ts index 730c847b84e..9591d223ac5 100644 --- a/app/cdap/components/SourceControlManagement/store/index.ts +++ b/app/cdap/components/SourceControlManagement/store/index.ts @@ -17,48 +17,32 @@ import { combineReducers, createStore, Store as StoreInterface } from 'redux'; import { composeEnhancers } from 'services/helpers'; import { IAction } from 'services/redux-helpers'; -import { IOperationRun, IRepositoryPipeline, SortBy, SortOrder, SyncStatusFilter } from '../types'; - -export const DEFAULT_PAGE_SIZE = 10; +import { IOperationRun, IRepositoryPipeline } from '../types'; +import { act } from 'react-dom/test-utils'; interface IPushViewState { ready: boolean; localPipelines: IRepositoryPipeline[]; nameFilter: string; - syncStatusFilter?: SyncStatusFilter; - pageSize: number; - nextPageTokens: string[]; - currentPage: number; - sortOrder: SortOrder; - sortBy: SortBy; selectedPipelines: string[]; commitModalOpen: boolean; loadingMessage: string; showFailedOnly: boolean; - lastRefreshTime?: number; } interface IPullViewState { ready: boolean; remotePipelines: IRepositoryPipeline[]; nameFilter: string; - syncStatusFilter?: SyncStatusFilter; - pageSize: number; - nextPageTokens: string[]; - currentPage: number; - sortOrder: SortOrder; - sortBy: SortBy; selectedPipelines: string[]; loadingMessage: string; showFailedOnly: boolean; pullViewErrorMsg: string; - lastRefreshTime?: number; } interface IOperationRunState { running: boolean; operation?: IOperationRun; - showLastOperationInfo: boolean; } interface IStore { @@ -76,13 +60,6 @@ export const PushToGitActions = { toggleCommitModal: 'LOCAL_PIPELINES_TOGGLE_COMMIT_MODAL', setLoadingMessage: 'LOCAL_PIPELINES_SET_LOADING_MESSAGE', toggleShowFailedOnly: 'LOCAL_PIPELINES_TOGGLE_SHOW_FAILED_ONLY', - setSyncStatusFilter: 'LOCAL_PIPELINES_SET_SYNC_STATUS_FILTER', - setPageSize: 'LOCAL_PIPELINES_SET_PAGE_SIZE', - setPageToken: 'LOCAL_PIPELINES_SET_PAGE_TOKEN', - setCurrentPage: 'LOCAL_PIPELINES_SET_CURRENT_PAGE', - setSortConfig: 'LOCAL_PIPELINES_SET_SORT_CONFIG', - markStale: 'LOCAL_PIPELINES_MARK_STALE', - setLastRefreshTime: 'LOCAL_PIPELINES_SET_LAST_REFRESH_TIME', }; export const PullFromGitActions = { @@ -94,30 +71,17 @@ export const PullFromGitActions = { setLoadingMessage: 'REMOTE_PIPELINES_SET_LOADING_MESSAGE', toggleShowFailedOnly: 'REMOTE_PIPELINES_TOGGLE_SHOW_FAILED_ONLY', setPullViewErrorMsg: 'REMOTE_PIPELINES_SET_ERROR_MSG', - setSyncStatusFilter: 'REMOTE_PIPELINES_SET_SYNC_STATUS_FILTER', - setPageSize: 'REMOTE_PIPELINES_SET_PAGE_SIZE', - setPageToken: 'REMOTE_PIPELINES_SET_PAGE_TOKEN', - setCurrentPage: 'REMOTE_PIPELINES_SET_CURRENT_PAGE', - setSortConfig: 'REMOTE_PIPELINES_SET_SORT_CONFIG', - markStale: 'REMOTE_PIPELINES_MARK_STALE', - setLastRefreshTime: 'REMOTE_PIPELINES_SET_LAST_REFRESH_TIME', }; export const OperationRunActions = { setLatestOperation: 'SET_RUNNING_OPERATION', unsetLatestOperation: 'UNSET_RUNNING_OPERATION', - setShowLastOperationInfo: 'SET_SHOW_LAST_OPERATION_INFO', }; const defaultPushViewState: IPushViewState = { ready: false, localPipelines: [], nameFilter: '', - pageSize: DEFAULT_PAGE_SIZE, - nextPageTokens: [], - currentPage: 0, - sortOrder: 'ASC', - sortBy: 'NAME', selectedPipelines: [], commitModalOpen: false, loadingMessage: null, @@ -128,11 +92,6 @@ const defaultPullViewState: IPullViewState = { ready: false, remotePipelines: [], nameFilter: '', - pageSize: DEFAULT_PAGE_SIZE, - nextPageTokens: [], - currentPage: 0, - sortOrder: 'ASC', - sortBy: 'NAME', selectedPipelines: [], loadingMessage: null, showFailedOnly: false, @@ -141,19 +100,8 @@ const defaultPullViewState: IPullViewState = { const defaultOperationRunState: IOperationRunState = { running: false, - showLastOperationInfo: true, }; -function updateNextPageToken( - nextPageTokens: string[], - currentPage: number, - nextToken?: string -): string[] { - const tokensDraft = [...nextPageTokens]; - tokensDraft[currentPage] = nextToken; - return tokensDraft; -} - const push = (state = defaultPushViewState, action: IAction) => { switch (action.type) { case PushToGitActions.setLocalPipelines: @@ -171,7 +119,6 @@ const push = (state = defaultPushViewState, action: IAction) => { return { ...defaultPushViewState, nameFilter: state.nameFilter, - syncStatusFilter: state.syncStatusFilter, selectedPipelines: state.selectedPipelines, }; case PushToGitActions.setSelectedPipelines: @@ -194,49 +141,8 @@ const push = (state = defaultPushViewState, action: IAction) => { ...state, showFailedOnly: !state.showFailedOnly, }; - case PushToGitActions.setSyncStatusFilter: - return { - ...state, - syncStatusFilter: action.payload, - }; - case PushToGitActions.setPageSize: - return { - ...state, - pageSize: action.payload, - }; - case PushToGitActions.setCurrentPage: - return { - ...state, - currentPage: action.payload, - }; - case PushToGitActions.setPageToken: - return { - ...state, - nextPageTokens: updateNextPageToken( - state.nextPageTokens, - action.payload.currentPage, - action.payload.nextToken - ), - currentPage: action.payload.currentPage, - }; - case PushToGitActions.setSortConfig: - return { - ...state, - sortBy: action.payload.sortBy, - sortOrder: action.payload.sortOrder, - }; case PushToGitActions.reset: return defaultPushViewState; - case PushToGitActions.markStale: - return { - ...state, - ready: false, - }; - case PushToGitActions.setLastRefreshTime: - return { - ...state, - lastRefreshTime: action.payload, - }; default: return state; } @@ -264,7 +170,6 @@ const pull = (state = defaultPullViewState, action: IAction) => { return { ...defaultPushViewState, nameFilter: state.nameFilter, - syncStatusFilter: state.syncStatusFilter, selectedPipelines: state.selectedPipelines, }; case PullFromGitActions.setSelectedPipelines: @@ -282,49 +187,8 @@ const pull = (state = defaultPullViewState, action: IAction) => { ...state, showFailedOnly: !state.showFailedOnly, }; - case PullFromGitActions.setSyncStatusFilter: - return { - ...state, - syncStatusFilter: action.payload, - }; - case PullFromGitActions.setPageSize: - return { - ...state, - pageSize: action.payload, - }; - case PullFromGitActions.setCurrentPage: - return { - ...state, - currentPage: action.payload, - }; - case PullFromGitActions.setPageToken: - return { - ...state, - nextPageTokens: updateNextPageToken( - state.nextPageTokens, - action.payload.currentPage, - action.payload.nextToken - ), - currentPage: action.payload.currentPage, - }; - case PullFromGitActions.setSortConfig: - return { - ...state, - sortBy: action.payload.sortBy, - sortOrder: action.payload.sortOrder, - }; case PullFromGitActions.reset: return defaultPullViewState; - case PullFromGitActions.markStale: - return { - ...state, - ready: false, - }; - case PullFromGitActions.setLastRefreshTime: - return { - ...state, - lastRefreshTime: action.payload, - }; default: return state; } @@ -337,21 +201,12 @@ const operationRun = ( switch (action.type) { case OperationRunActions.setLatestOperation: return { - ...state, running: !action.payload?.done, operation: action.payload, - showLastOperationInfo: true, }; case OperationRunActions.unsetLatestOperation: return { - ...state, running: false, - showLastOperationInfo: false, - }; - case OperationRunActions.setShowLastOperationInfo: - return { - ...state, - showLastOperationInfo: action.payload, }; default: return state; diff --git a/app/cdap/components/SourceControlManagement/styles.ts b/app/cdap/components/SourceControlManagement/styles.ts index 4bebbf45457..a20e5289c79 100644 --- a/app/cdap/components/SourceControlManagement/styles.ts +++ b/app/cdap/components/SourceControlManagement/styles.ts @@ -22,8 +22,8 @@ export const TableBox = styled(TableContainer)` box-shadow: 0 1px 2px 0 rgb(0 0 0 / 20%); margin-top: 10px; margin-bottom: 30px; - max-height: calc(80vh - ${(props) => (props.lastOperationInfoShown ? '280px' : '200px')}); - min-height: calc(80vh - ${(props) => (props.lastOperationInfoShown ? '380px' : '200px')}); + max-height: calc(80vh - 200px); + min-height: calc(80vh - 300px); `; export const StyledTableCell = styled(TableCell)` @@ -82,25 +82,3 @@ export const FailStatusDiv = styled.div` export const AlertErrorView = styled.p` margin: 1rem 0; `; - -export const FiltersAndStatusWrapper = styled.div` - display: flex; - align-items: center; - justify-content: space-between; - gap: 24px; -`; - -export const SyncStatusWrapper = styled.div` - display: flex; - align-items: center; - gap: 8px; -`; - -export const RefreshTimeLabel = styled.div` - display: flex; - align-items: center; - justify-content: flex-end; - padding: 0 0 8px 0; - font-size: 12px; - font-style: italic; -`; diff --git a/app/cdap/components/SourceControlManagement/types.ts b/app/cdap/components/SourceControlManagement/types.ts index 9d9392ea5a1..c1b17e4324b 100644 --- a/app/cdap/components/SourceControlManagement/types.ts +++ b/app/cdap/components/SourceControlManagement/types.ts @@ -20,17 +20,12 @@ import { OperationType } from './OperationType'; import { OperationStatus } from './OperationStatus'; import { ITimeInstant } from 'services/DataFormatter'; -export type SyncStatusFilter = 'SYNCED' | 'UNSYNCED'; -export type SortOrder = 'ASC' | 'DESC'; -export type SortBy = 'NAME' | 'LAST_SYNCED_AT'; - export interface IRepositoryPipeline { name: string; - fileHash?: string; + fileHash: string; error: string; status: SUPPORT; - lastSyncDate?: number; - syncStatus?: boolean; + lastSyncDate?: ITimeInstant; } export interface IOperationResource { @@ -90,22 +85,6 @@ export interface IPipeline { }; } -export interface IPipelineDetail { - name: string; - lastSyncedAt?: number; - isSynced: boolean; - commitId?: string; - namespace?: string; - specificationHash?: string; - type?: string; -} - -export interface IPipelineListResponse { - apps: IPipelineDetail[]; - nextPageToken?: string; - lastRefreshTime?: number; -} - export interface IListResponse { status: SUPPORT; name: string; diff --git a/app/cdap/main.js b/app/cdap/main.js index e1c64dfac5f..c2fde621667 100644 --- a/app/cdap/main.js +++ b/app/cdap/main.js @@ -19,7 +19,7 @@ import 'react-hot-loader/patch'; import './globals'; import { InMemoryCache, IntrospectionFragmentMatcher } from 'apollo-cache-inmemory'; -import React, { Component, useEffect, useState } from 'react'; +import React, { Component } from 'react'; import { Route, Router, Switch } from 'react-router-dom'; import SessionTokenStore, { fetchSessionToken } from 'services/SessionTokenStore'; import { Theme, applyTheme } from 'services/ThemeHelper'; @@ -65,7 +65,6 @@ import history from 'services/history'; import { CookieBanner } from 'components/CookieBanner'; // See ./graphql/fragements/README.md import introspectionQueryResultData from '../../graphql/fragments/fragmentTypes.json'; -import { FooterContext } from 'components/FooterContext'; require('../ui-utils/url-generator'); require('font-awesome-sass-loader!./styles/font-awesome.config.js'); @@ -397,7 +396,7 @@ class CDAP extends Component { ))} )} - {this.props.showFooter &&
} +
@@ -408,34 +407,10 @@ class CDAP extends Component { CDAP.propTypes = { children: PropTypes.node, - showFooter: PropTypes.bool, }; -CDAP.defaultProps = { - showFooter: true, -}; - -function CdapWithFooterContext() { - const [show, setShow] = useState(true); - - useEffect(() => { - const appContainer = document.getElementById('app-container'); - if (!show) { - appContainer.classList.add('no-footer'); - } else { - appContainer.classList.remove('no-footer'); - } - }, [show]); - - return ( - - - - ); -} - const RootComp = hot(() => { - return } />; + return } />; }); ReactDOM.render(, document.getElementById('app-container')); diff --git a/app/cdap/services/DataFormatter/index.ts b/app/cdap/services/DataFormatter/index.ts index 4923f784bb2..545fb5b0848 100644 --- a/app/cdap/services/DataFormatter/index.ts +++ b/app/cdap/services/DataFormatter/index.ts @@ -130,11 +130,3 @@ export function timeInstantToString(t?: ITimeInstant): string { return moment(t.seconds * 1000).format('DD-MM-YYYY HH:mm:ss A'); } - -export function timeInstantToMs(t?: ITimeInstant): number { - if (!t) { - return 0; - } - - return t.seconds * 1000; -} diff --git a/app/cdap/styles/common.scss b/app/cdap/styles/common.scss index 049ef9d7f1d..8bf1f6dae50 100644 --- a/app/cdap/styles/common.scss +++ b/app/cdap/styles/common.scss @@ -60,10 +60,6 @@ body { margin-top: 48px; overflow-y: auto; height: calc(100vh - (#{$height-of-footer} + #{$height-of-header})); // Header + footer heights - - &.no-footer { - height: calc(100vh - #{$height-of-header}); - } } .container-fluid { padding-bottom: 52px; // footer height diff --git a/app/cdap/text/text-en.yaml b/app/cdap/text/text-en.yaml index d7ea3cc518e..8d8a9648572 100644 --- a/app/cdap/text/text-en.yaml +++ b/app/cdap/text/text-en.yaml @@ -3197,7 +3197,7 @@ features: pat: label: Personal access token (PAT) token: Token - tokenHelperText: Refer to the "Creating access token" guide in {provider} docs to generate the token + tokenHelperText: Refer to the "Creating a personal access token" guide in github docs to generate the token tokenName: Token name tokenNameHelperText: Give personal access token a name for secure store. The name can contain lower case alphabets, numbers, _, and - username: User name @@ -3245,10 +3245,7 @@ features: pipelinePullMessage: Pulling 1 pipeline from the remote repository pipelinesListedFail: "Failed to list remote pipelines" pipelinesPulledFail: "Failed to pull {count} pipelines" - pipelinesPulledFailMulti: Failed to pull the pipelines - pipelinesSelectedWithTotal: "{selected} of {total} pipelines selected" - pipelinesSelected: "{selected} pipelines selected" - singularPipelineSelected: "1 pipeline selected" + pipelinesSelected: "{selected} of {total} pipelines selected" pullAppMessage: Pulling {appId} from remote repository now... pullAppMessageMulti: Pulling {n} pipelines from the remote repository now... pullButton: Pull from repository @@ -3269,9 +3266,7 @@ features: pipelinePushMessage: Pushing 1 pipeline to the remote repository pipelinesPushedFail: "Failed to push {count} pipelines" pipelinesPushedFailMulti: Failed to push the pipelines - pipelinesSelectedWithTotal: "{selected} of {total} pipelines selected" - pipelinesSelected: "{selected} pipelines selected" - singularPipelineSelected: "1 pipeline selected" + pipelinesSelected: "{selected} of {total} pipelines selected" pushAppMessage: Pushing {appId} to remote repository now... pushAppMessageMulti: Pushing {n} pipelines to the remote repository now... pushButton: Push to repository @@ -3284,20 +3279,12 @@ features: table: connected: Connected pipelineName: Pipeline name - lastSyncDate: Last synced at + lastSyncDate: Last sync date gitStatus: Connected to Git - syncStatus: Sync status gitStatusHelperText: This status indicates that the pipeline has been pushed to or pulled from the git repository in the past. It does not necessarily mean the content is up to date. - syncStatusHelperText: This status indicates whether the pipeline is in sync with the linked remote repository. pullFail: Failed to pull this pipeline from remote. pushFail: Failed to push this pipeline to remote. synced: Synced - filtersLabel: Filters - gitSyncStatusAll: All - gitSyncStatusSynced: Synced - gitSyncStatusUnsynced: Unsynced - serverSidePaginationLabel: "Results {from} - {to}" - lastRefreshedAtLabel: Last refreshed at {datetime} syncButton: Sync Pipelines title: Source Control Management unlinkButton: Unlink Repository diff --git a/pom.xml b/pom.xml index df048530ad1..d972ce1200b 100644 --- a/pom.xml +++ b/pom.xml @@ -600,6 +600,10 @@ TestRunner.java + classes + 4 + 4 + true diff --git a/sandboxjs/sandbox_version.json b/sandboxjs/sandbox_version.json index 1be36f6061f..de1d288e3e1 100644 --- a/sandboxjs/sandbox_version.json +++ b/sandboxjs/sandbox_version.json @@ -1,4 +1,4 @@ { - "release": "v6.10.1-SNAPSHOT", - "version": "6.10.1-SNAPSHOT" + "release": "v6.10.0-SNAPSHOT", + "version": "6.10.0-SNAPSHOT" } diff --git a/server/config/development/cdap.json b/server/config/development/cdap.json index 0efb5a332eb..2c00d40371d 100644 --- a/server/config/development/cdap.json +++ b/server/config/development/cdap.json @@ -17,8 +17,6 @@ "feature.lifecycle.management.edit.enabled": "true", "feature.source.control.management.git.enabled": "true", "feature.source.control.management.multi.app.enabled": "true", - "feature.source.control.metadata.auto.refresh.enabled": "true", - "feature.source.control.management.gitlab.bitbucket.enabled": "true", "ui.analyticsTag": "", "ui.GTM": "", "hsts.enabled": "false", diff --git a/server/express.js b/server/express.js index 7cac5480f5a..25da2fcc6e0 100644 --- a/server/express.js +++ b/server/express.js @@ -393,16 +393,14 @@ function makeApp(authAddress, cdapConfig, uiSettings) { log.error( '[ERROR] Market request to url: ' + sourceLink + ' responded with error: ' + err ); - return res.status((marketResponse && marketResponse.statusCode) || 502).send(err); + res.status((marketResponse && marketResponse.statusCode) || 502).send(err); } else { - return res.status(marketResponse.statusCode).send(marketResponse.body); + res.status(marketResponse.statusCode).send(marketResponse.body); } } ).on('error', function(err) { log.error('[ERROR] Market request had error: (url: ' + sourceLink + ') ' + err.message); - if (!res.headersSent) { - return res.status(502).send(err.message); - } + res.status(502).send(err.message); }); });