diff --git a/package.json b/package.json index 054b2bf2510..5ab2500e8fa 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "test:e2e": "cypress run", "serve": "NODE_ENV=production node server/server.js", "lego": "webpack -p --config scripts/webpack.lego.js", - "lint": "eslint ./src", + "lint": "eslint src/**/*.jsx src/**/*.js", "postinstall": "rimraf .cache-loader", "prebuild": "rimraf dist", "release": "standard-version" diff --git a/src/components/Base/Dragger/index.jsx b/src/components/Base/Dragger/index.jsx index 65cfc32d3ef..d9e91f35784 100644 --- a/src/components/Base/Dragger/index.jsx +++ b/src/components/Base/Dragger/index.jsx @@ -117,10 +117,13 @@ export default class Dragger extends React.Component { @observable scale = 1 + @observable translateX = 30 + @observable translateY = 60 + @observable isFullscreen = false @@ -168,22 +171,19 @@ export default class Dragger extends React.Component { const contentWidth = this.content.clientWidth * this.scale const contentHeight = this.content.clientHeight * this.scale - if (clientX < this.translateX) { - this.translateX = this.translateX - } else if (clientX > this.translateX + contentWidth) { + if (clientX > this.translateX + contentWidth) { this.translateX = -(deltaScale * this.content.clientWidth) + this.translateX - } else { + } else if (clientX >= this.translateX) { this.translateX = -(deltaScale * (clientX - this.translateX)) / this.scale + this.translateX } - if (clientY < this.translateY) { - this.translateY = this.translateY - } else if (clientY > this.translateY + contentHeight) { + + if (clientY > this.translateY + contentHeight) { this.translateY = -(deltaScale * this.content.clientHeight) + this.translateY - } else { + } else if (clientY >= this.translateY) { this.translateY = (-deltaScale * (clientY - this.translateY)) / this.scale + this.translateY diff --git a/src/components/Base/ScrollLoad/index.jsx b/src/components/Base/ScrollLoad/index.jsx index 918fed60e4b..925f917c48d 100644 --- a/src/components/Base/ScrollLoad/index.jsx +++ b/src/components/Base/ScrollLoad/index.jsx @@ -76,7 +76,8 @@ export default class ScrollLoad extends React.Component { loading: false, loadMore: isRemainingData(props), } - } else if (props.loading !== state.loading) { + } + if (props.loading !== state.loading) { return { loading: props.loading, } diff --git a/src/components/Base/Steps/index.jsx b/src/components/Base/Steps/index.jsx index a2e8029c1f6..16b19dee28d 100644 --- a/src/components/Base/Steps/index.jsx +++ b/src/components/Base/Steps/index.jsx @@ -51,7 +51,8 @@ export default class Steps extends React.Component { const { current } = this.props if (index === current) { return 'current' - } else if (index < current) { + } + if (index < current) { return 'finished' } diff --git a/src/components/Forms/GrayRelease/Components/Card/index.jsx b/src/components/Forms/GrayRelease/Components/Card/index.jsx index abc673e4967..7fbe0ee8b2e 100644 --- a/src/components/Forms/GrayRelease/Components/Card/index.jsx +++ b/src/components/Forms/GrayRelease/Components/Card/index.jsx @@ -45,6 +45,7 @@ export default class Card extends React.PureComponent { onSelect(component, !value) } + renderActions() { const { value, component, loading } = this.props diff --git a/src/components/Forms/ImageBuilder/B2IForm/index.jsx b/src/components/Forms/ImageBuilder/B2IForm/index.jsx index ce8697e82f8..e69d98ca0c4 100644 --- a/src/components/Forms/ImageBuilder/B2IForm/index.jsx +++ b/src/components/Forms/ImageBuilder/B2IForm/index.jsx @@ -167,7 +167,9 @@ export default class S2IForm extends React.Component {
{t('The version has no documentation.')}
++ {t('The version has no documentation.')} +
) } diff --git a/src/pages/appStore/components/Banner/index.jsx b/src/pages/appStore/components/Banner/index.jsx index 50521f8f6b4..6d89049b24d 100644 --- a/src/pages/appStore/components/Banner/index.jsx +++ b/src/pages/appStore/components/Banner/index.jsx @@ -30,6 +30,7 @@ export default class Banner extends React.PureComponent { className: PropTypes.string, children: PropTypes.node, } + get isAppsPage() { return location.pathname === '/apps' } diff --git a/src/pages/devops/components/Cards/CodeQualityResult/StatusCard.jsx b/src/pages/devops/components/Cards/CodeQualityResult/StatusCard.jsx index 85d0ad92d7a..ba749cbdbd6 100644 --- a/src/pages/devops/components/Cards/CodeQualityResult/StatusCard.jsx +++ b/src/pages/devops/components/Cards/CodeQualityResult/StatusCard.jsx @@ -30,6 +30,7 @@ export default class CodeStatusCard extends React.PureComponent { value: 0, url: '', } + render() { const { hasIcon, title, value, resultClass, unit, url } = this.props const classContent = CLASSLISTS[parseInt(resultClass, 10) - 1] diff --git a/src/pages/devops/components/Pipeline/StepModals/kubernetesDeploy.jsx b/src/pages/devops/components/Pipeline/StepModals/kubernetesDeploy.jsx index 4ad365f44f9..b2fc252647c 100644 --- a/src/pages/devops/components/Pipeline/StepModals/kubernetesDeploy.jsx +++ b/src/pages/devops/components/Pipeline/StepModals/kubernetesDeploy.jsx @@ -73,8 +73,10 @@ export default class KubernetesDeploy extends React.Component { @observable dockerCredentials = [{ key: 'default' }] + @observable isShowAdvenced = false + @observable isShowDetail = false diff --git a/src/pages/devops/components/Pipeline/StepsEditor/index.jsx b/src/pages/devops/components/Pipeline/StepsEditor/index.jsx index 3ce87ce1019..510f92cdce8 100644 --- a/src/pages/devops/components/Pipeline/StepsEditor/index.jsx +++ b/src/pages/devops/components/Pipeline/StepsEditor/index.jsx @@ -57,6 +57,7 @@ export default class StepsEditor extends React.Component { @observable zIndex = '' + @observable isEditMode = false diff --git a/src/pages/devops/containers/Pipelines/Detail/PipelineLogDialog/index.jsx b/src/pages/devops/containers/Pipelines/Detail/PipelineLogDialog/index.jsx index 6a8c5880d9f..ee58f7d7699 100644 --- a/src/pages/devops/containers/Pipelines/Detail/PipelineLogDialog/index.jsx +++ b/src/pages/devops/containers/Pipelines/Detail/PipelineLogDialog/index.jsx @@ -67,6 +67,7 @@ export default class PipelineLog extends React.Component { @observable activeNodeIndex = [0, 0] // lineindex, colunmIndex + @observable refreshFlag = true diff --git a/src/pages/projects/components/Cards/ImageArtifacts/Item/index.jsx b/src/pages/projects/components/Cards/ImageArtifacts/Item/index.jsx index 8436bc8804b..34824d04f0b 100644 --- a/src/pages/projects/components/Cards/ImageArtifacts/Item/index.jsx +++ b/src/pages/projects/components/Cards/ImageArtifacts/Item/index.jsx @@ -33,6 +33,7 @@ export default class ImageRunRecords extends React.Component { content: t('Copy Successfully'), }) } + render() { const { imageName, diff --git a/src/pages/projects/components/Modals/RepoApp/AppDetail/Banner/index.jsx b/src/pages/projects/components/Modals/RepoApp/AppDetail/Banner/index.jsx index 363eafd2270..17bdcdd2b55 100644 --- a/src/pages/projects/components/Modals/RepoApp/AppDetail/Banner/index.jsx +++ b/src/pages/projects/components/Modals/RepoApp/AppDetail/Banner/index.jsx @@ -30,6 +30,7 @@ class Banner extends PureComponent { icon: PropTypes.string, onClickBack: PropTypes.func, } + handleClickBack = () => { this.props.onClickBack ? this.props.onClickBack() : history.back() }