diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2f0e92b8df9cf..0d542a9cebf43 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -39,6 +39,7 @@ jobs: push: true build-args: | NPM_BUILD_CMD=build + GIT_AUTH_TOKEN=${{ secrets.TOKEN_REPO }} tags: blotout/superset:${{ env.DOCKER_TAG }} - name: Comment uses: NejcZdovc/comment-pr@v1 diff --git a/Dockerfile b/Dockerfile index 76eec9a926daa..ad324e63eab94 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,16 +51,19 @@ ARG NPM_VER=7 RUN npm install -g npm@${NPM_VER} ARG NPM_BUILD_CMD="build" +ARG GIT_AUTH_TOKEN ENV BUILD_CMD=${NPM_BUILD_CMD} +ENV NODE_AUTH_TOKEN=${GIT_AUTH_TOKEN} # NPM ci first, as to NOT invalidate previous steps except for when package.json changes RUN mkdir -p /app/superset-frontend RUN mkdir -p /app/superset/assets COPY ./docker/frontend-mem-nag.sh / COPY ./superset-frontend/package* /app/superset-frontend/ +COPY ./superset-frontend/.npmrc /app/superset-frontend/ RUN /frontend-mem-nag.sh \ && cd /app/superset-frontend \ - && npm ci + && npm i # Next, copy in the rest and let webpack do its thing COPY ./superset-frontend /app/superset-frontend diff --git a/superset-frontend/.npmrc b/superset-frontend/.npmrc new file mode 100644 index 0000000000000..3004b64a89b93 --- /dev/null +++ b/superset-frontend/.npmrc @@ -0,0 +1,2 @@ +@blotoutio:registry=https://npm.pkg.github.com +//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN} diff --git a/superset-frontend/src/components/Button/index.tsx b/superset-frontend/src/components/Button/index.tsx index 168f1767e09d6..98d7d65683458 100644 --- a/superset-frontend/src/components/Button/index.tsx +++ b/superset-frontend/src/components/Button/index.tsx @@ -91,6 +91,8 @@ export default function Button(props: ButtonProps) { padding = 10; } + primary.base = 'rgb(255, 82, 25)'; + let backgroundColor = primary.light4; let backgroundColorHover = mix(0.1, primary.base, primary.light4); let backgroundColorActive = mix(0.25, primary.base, primary.light4); @@ -104,9 +106,9 @@ export default function Button(props: ButtonProps) { let borderColorDisabled = 'transparent'; if (buttonStyle === 'primary') { - backgroundColor = primary.dark1; - backgroundColorHover = mix(0.1, grayscale.light5, primary.dark1); - backgroundColorActive = mix(0.2, grayscale.dark2, primary.dark1); + backgroundColor = primary.base; + backgroundColorHover = mix(0.1, grayscale.light5, primary.base); + backgroundColorActive = mix(0.2, grayscale.dark2, primary.base); color = grayscale.light5; colorHover = color; } else if (buttonStyle === 'tertiary' || buttonStyle === 'dashed') { diff --git a/superset-frontend/src/components/ListView/ListView.tsx b/superset-frontend/src/components/ListView/ListView.tsx index 8d9182ac70e4c..af36e29afe429 100644 --- a/superset-frontend/src/components/ListView/ListView.tsx +++ b/superset-frontend/src/components/ListView/ListView.tsx @@ -100,7 +100,7 @@ const BulkSelectWrapper = styled(Alert)` } .deselect-all { - color: #1985a0; + color: rgb(255, 82, 25); margin-left: ${({ theme }) => theme.gridUnit * 4}px; } diff --git a/superset-frontend/src/components/Menu/SubMenu.tsx b/superset-frontend/src/components/Menu/SubMenu.tsx index 0efd3cdf5f87f..1ed8fe052708d 100644 --- a/superset-frontend/src/components/Menu/SubMenu.tsx +++ b/superset-frontend/src/components/Menu/SubMenu.tsx @@ -174,6 +174,7 @@ const SubMenu: React.FunctionComponent = props => { buttonStyle={btn.buttonStyle} onClick={btn.onClick} data-test={btn['data-test']} + data-type={btn.buttonStyle} > {btn.name} diff --git a/superset-frontend/stylesheets/antd/index.less b/superset-frontend/stylesheets/antd/index.less index cf51b165eb998..53667653d53ec 100644 --- a/superset-frontend/stylesheets/antd/index.less +++ b/superset-frontend/stylesheets/antd/index.less @@ -28,7 +28,7 @@ /* Theme variables here: https://github.com/ant-design/ant-design/blob/master/components/style/themes/default.less */ -@primary-color: #20a7c9; +@primary-color: rgb(255, 82, 25); @info-color: #66bcfe; @success-color: #59c189; @processing-color: #66bcfe; diff --git a/superset-frontend/stylesheets/less/TC/custom.less b/superset-frontend/stylesheets/less/TC/custom.less deleted file mode 100644 index e34f603656914..0000000000000 --- a/superset-frontend/stylesheets/less/TC/custom.less +++ /dev/null @@ -1,34 +0,0 @@ -.panel-body { - padding: 0px 15px 15px 15px !important; -} - -.list-search-container .dropdown-toggle { - top: -13px !important; -} - -.panel-primary .panel-heading { - padding: 15px 15px 0 43px !important; -} - -.list-container .list-add-action { - top: -15px !important; -} - -.btn-primary { - background-color: rgb(255, 82, 25) !important; - border-color: rgb(255, 82, 25) !important; -} - -.btn-primary:hover { - background-color: rgb(202, 76, 31) !important; - border-color: rgb(202, 76, 31) !important; -} - -.text-primary, -.text-primary:hover { - color: rgb(202, 76, 31) !important; -} - -.navbar-static-top { - display: none; -} diff --git a/superset/static/blotout.css b/superset-frontend/stylesheets/less/blotout.less similarity index 80% rename from superset/static/blotout.css rename to superset-frontend/stylesheets/less/blotout.less index 92c7fe71d6257..3fe1276342a36 100644 --- a/superset/static/blotout.css +++ b/superset-frontend/stylesheets/less/blotout.less @@ -15,12 +15,12 @@ header > nav ul { } header > nav .navbar-right { - display: block; + display: flex; padding-top: 15px !important; margin-bottom: -30px !important; } -header > nav .navbar-right .btn-primary { +header > nav .navbar-right [data-type='primary'] { display: none; } @@ -76,7 +76,7 @@ header > nav .navbar-right .btn-primary { text-decoration: none !important; } -.list-search-container .dropdown-toggle { +.list-search-container button.dropdown-toggle { top: 20px !important; } @@ -164,3 +164,34 @@ body > footer { .slice_container .filter_box .Select__multi-value__label { white-space: initial !important; } + +.container { + width: 100%; +} + +.panel-primary .panel-heading { + padding: 15px 15px 0 43px !important; +} + +.list-container .list-add-action { + top: -15px !important; +} + +.btn-primary { + background-color: rgb(255, 82, 25) !important; + border-color: rgb(255, 82, 25) !important; +} + +.btn-primary:hover { + background-color: rgb(202, 76, 31) !important; + border-color: rgb(202, 76, 31) !important; +} + +.text-primary, +.text-primary:hover { + color: rgb(202, 76, 31) !important; +} + +.navbar-static-top { + display: none; +} diff --git a/superset-frontend/stylesheets/less/index.less b/superset-frontend/stylesheets/less/index.less index fc91c477dbeb5..3ba8425802a77 100644 --- a/superset-frontend/stylesheets/less/index.less +++ b/superset-frontend/stylesheets/less/index.less @@ -22,6 +22,7 @@ @import './fonts.less'; @import './variables.less'; @import './cosmo/bootswatch.less'; +@import './blotout.less'; html, body { diff --git a/superset-frontend/stylesheets/less/variables.less b/superset-frontend/stylesheets/less/variables.less index 34bfdac628158..e236df6a58197 100644 --- a/superset-frontend/stylesheets/less/variables.less +++ b/superset-frontend/stylesheets/less/variables.less @@ -24,10 +24,10 @@ /* component styles. This will allow us to more easily adjust theming */ /************************************************************************/ -@primary-color: #20a7c9; +@primary-color: rgb(255, 82, 25); @indicator-color: @primary-color; -@brand-primary-dark1: #1a85a0; +@brand-primary-dark1: @primary-color; @brand-primary-dark2: #156378; @brand-primary-light1: #79cade; @brand-primary-light2: #a5dae9; diff --git a/superset/static/blotout.js b/superset/static/blotout.js index a175ce75d51d3..b05139a087506 100644 --- a/superset/static/blotout.js +++ b/superset/static/blotout.js @@ -25,11 +25,11 @@ const modifyElements = () => { window.location.pathname === '/annotationlayermodelview/list/' || window.location.pathname.startsWith('/annotationmodelview/')) { modifyCheck(() => { - const elements = document.querySelectorAll('header nav .navbar-right .btn-primary') + const elements = document.querySelectorAll(`header nav .navbar-right [data-type='primary']`) if (elements.length === 0) { return false } - elements[0].style.display = 'inline-block' + elements[0].style.display = 'inline-flex' return true }) return diff --git a/superset/templates/superset/base.html b/superset/templates/superset/base.html index 33cac677b1bdd..d9474c836748a 100644 --- a/superset/templates/superset/base.html +++ b/superset/templates/superset/base.html @@ -23,12 +23,11 @@ {{ super() }} {{ css_bundle("theme") }} - {% endblock %} {% block head_js %} {{ super() }} - + {{ js_bundle("theme") }} {% endblock %} diff --git a/superset/templates/superset/basic.html b/superset/templates/superset/basic.html index 9c5b7feea917d..0b79080b7e206 100644 --- a/superset/templates/superset/basic.html +++ b/superset/templates/superset/basic.html @@ -51,12 +51,10 @@ {% if entry %} {{ css_bundle(entry) }} {% endif %} - - {% endblock %} {{ js_bundle("theme") }} - +