Skip to content

Commit

Permalink
[hotfix] update password must requires current password (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
sijav authored Sep 16, 2024
1 parent 89aeb97 commit 2e5df97
Show file tree
Hide file tree
Showing 13 changed files with 800 additions and 2,582 deletions.
100 changes: 100 additions & 0 deletions .github/workflows/publish-old-panel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: 'Publish old panel'
on:
push:
branches:
- old-main
workflow_dispatch:

jobs:
publish-old-panel:
runs-on: ubuntu-latest
steps:
- name: Checkout (GitHub)
uses: actions/checkout@v3

- name: Create env file
run: |
echo "VITE_FIX_LANDING_PAGE_URL=${{ vars.FIX_LANDING_PAGE_URL }}" > .env.production
echo "VITE_VIDEOS_ASSETS_URL=${{ vars.VIDEOS_ASSETS_URL }}" >> .env.production
echo "VITE_IMAGES_ASSETS_URL=${{ vars.IMAGES_ASSETS_URL }}" >> .env.production
echo "VITE_USE_PROXY=false" >> .env.production
echo "VITE_NETWORK_RETRY_COUNT=${{ vars.NETWORK_RETRY_COUNT }}" >> .env.production
echo "VITE_WEBSOCKET_RETRY_TIMEOUT=${{ vars.WEBSOCKET_RETRY_TIMEOUT }}" >> .env.production
echo "VITE_USE_MOCK=false" >> .env.production
echo "VITE_DISCORD_URL=${{ vars.DISCORD_URL }}" >> .env.production
echo "VITE_TRACKJS_TOKEN=${{ secrets.TRACKJS_TOKEN }}" >> .env.production
echo "VITE_MUI_LICENSE_KEY=${{ secrets.MUI_LICENSE_KEY }}" >> .env.production
echo "VITE_VERSION=${{ github.sha }}" >> .env.production
echo "VITE_LOAD_PAGE_TIMEOUT=${{ vars.LOAD_PAGE_TIMEOUT }}" >> .env.production
echo "VITE_POSTHOG_DEV_PROJECT_API_KEY=${{ secrets.POSTHOG_DEV_PROJECT_API_KEY }}" >> .env.production
echo "VITE_POSTHOG_PROD_PROJECT_API_KEY=${{ secrets.POSTHOG_PROD_PROJECT_API_KEY }}" >> .env.production
echo "VITE_POSTHOG_API_HOST=${{ vars.POSTHOG_API_HOST }}" >> .env.production
echo "VITE_POSTHOG_UI_HOST=${{ vars.POSTHOG_UI_HOST }}" >> .env.production
- name: Add models
run: |
echo "[]" > mock-apis/data/model.json
echo "{ \"accounts\": [], \"regions\": [], \"kinds\": [], \"severity\": [] }" > mock-apis/data/search-start.json
echo "[]" > mock-apis/data/table.json
echo "[]" > mock-apis/data/tags.json
- name: Create a production build
uses: devcontainers/[email protected]
with:
runCmd: yarn i18n:extract && yarn i18n:compile && PUBLIC_URL=${{ vars.PUBLIC_URL }}/${{ github.sha }}/ yarn build

- name: Move dist to target
run: |
mkdir -p target/${{ github.sha }}
cp -r dist/* target/${{ github.sha }}
- name: Publish the new version to the CDN
uses: BetaHuhn/do-spaces-action@v2
with:
access_key: ${{ secrets.FIX_UI_DO_SPACES_KEY }}
secret_key: ${{ secrets.FIX_UI_DO_SPACES_SECRET }}
space_name: ${{ secrets.FIX_UI_DO_SPACE_NAME }}
space_region: ${{ secrets.FIX_UI_DO_SPACE_REGION }}
out_dir: fix-ui
source: target

# - name: Update the edge version on the CDN
# uses: BetaHuhn/do-spaces-action@v2
# with:
# access_key: ${{ secrets.FIX_UI_DO_SPACES_KEY }}
# secret_key: ${{ secrets.FIX_UI_DO_SPACES_SECRET }}
# space_name: ${{ secrets.FIX_UI_DO_SPACE_NAME }}
# space_region: ${{ secrets.FIX_UI_DO_SPACE_REGION }}
# out_dir: fix-ui/edge
# source: target/${{ github.sha }}/index.html

# - name: Create a patch with the new version
# # writes the file with a config map definition
# run: |
# echo "apiVersion: apps/v1" > fixbackend-ui-patch.yaml
# echo "kind: StatefulSet" >> fixbackend-ui-patch.yaml
# echo "metadata:" >> fixbackend-ui-patch.yaml
# echo " name: fixbackend" >> fixbackend-ui-patch.yaml
# echo "spec:" >> fixbackend-ui-patch.yaml
# echo " template:" >> fixbackend-ui-patch.yaml
# echo " spec:" >> fixbackend-ui-patch.yaml
# echo " containers:" >> fixbackend-ui-patch.yaml
# echo " - name: fixbackend" >> fixbackend-ui-patch.yaml
# echo " env:" >> fixbackend-ui-patch.yaml
# echo " - name: FIXUI_SHA" >> fixbackend-ui-patch.yaml
# echo " value: \"${{ github.sha }}\"" >> fixbackend-ui-patch.yaml

# - name: Authenticate with GitHub CLI
# run: |
# gh auth login --with-token <<< "${{ secrets.SOME_CI_PAT }}"

# - name: Bump fix-ui version
# env:
# GITHUB_TOKEN: ${{ secrets.SOME_CI_PAT }}
# run: |
# git config --global user.email "[email protected]"
# git config --global user.name "Some CI"
# git clone "https://[email protected]/someengineering/setup-infra.git"
# # update the configmap
# mv fixbackend-ui-patch.yaml setup-infra/argocd/envs/dev/fixbackend/fixbackend-ui-patch.yaml
# cd setup-infra
# git add .
# git commit -m "Bump fix-ui to ${{ github.sha }}"
# git push origin main
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'publish'
name: 'Publish'
on:
push:
branches:
Expand Down
66 changes: 33 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,38 +36,38 @@
"@emotion/cache": "11.13.1",
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@fontsource-variable/plus-jakarta-sans": "^5.0.22",
"@fontsource-variable/plus-jakarta-sans": "^5.1.0",
"@lingui/macro": "^4.11.4",
"@lingui/react": "^4.11.4",
"@mui/icons-material": "^6.0.2",
"@mui/icons-material": "^6.1.0",
"@mui/lab": "^6.0.0-beta.8",
"@mui/material": "^6.0.2",
"@mui/system": "^6.0.2",
"@mui/x-charts": "^7.15.0",
"@mui/x-charts-pro": "^7.0.0-beta.0",
"@mui/x-data-grid-premium": "^7.16.0",
"@mui/x-date-pickers-pro": "^7.16.0",
"@mui/x-tree-view": "^7.16.0",
"@tanstack/react-query": "^5.55.0",
"@mui/material": "^6.1.0",
"@mui/system": "^6.1.0",
"@mui/x-charts": "^7.17.0",
"@mui/x-charts-pro": "^7.0.0-beta.1",
"@mui/x-data-grid-premium": "^7.17.0",
"@mui/x-date-pickers-pro": "^7.17.0",
"@mui/x-tree-view": "^7.17.0",
"@tanstack/react-query": "^5.56.2",
"@uidotdev/usehooks": "^2.4.1",
"axios": "^1.7.7",
"d3": "^7.9.0",
"dayjs": "^1.11.13",
"diff": "^6.0.0",
"diff": "^7.0.0",
"flag-icons": "^7.2.3",
"hast-util-to-jsx-runtime": "^2.3.0",
"highlight.js": "^11.10.0",
"immer": "^10.1.1",
"js-cookie": "^3.0.5",
"lowlight": "^3.1.0",
"mustache": "^4.2.0",
"posthog-js": "^1.160.3",
"posthog-js": "^1.161.3",
"qrcode": "^1.5.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-error-boundary": "^4.0.13",
"react-lazy-load-image-component": "^1.6.2",
"react-router-dom": "^6.26.1",
"react-router-dom": "^6.26.2",
"react-transition-group": "^4.4.5",
"react-window": "^1.8.10",
"recharts": "^2.12.7",
Expand All @@ -79,57 +79,57 @@
"@emotion/styled": "^11.13.0",
"@eslint/compat": "^1.1.1",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.9.1",
"@eslint/js": "^9.10.0",
"@lingui/cli": "^4.11.4",
"@lingui/swc-plugin": "^4.0.8",
"@lingui/swc-plugin": "4.0.9",
"@lingui/vite-plugin": "^4.11.4",
"@storybook/addon-essentials": "^8.2.9",
"@storybook/addon-links": "^8.2.9",
"@storybook/blocks": "^8.2.9",
"@storybook/react": "^8.2.9",
"@storybook/react-vite": "^8.2.9",
"@storybook/test": "^8.2.9",
"@storybook/addon-essentials": "^8.3.0",
"@storybook/addon-links": "^8.3.0",
"@storybook/blocks": "^8.3.0",
"@storybook/react": "^8.3.0",
"@storybook/react-vite": "^8.3.0",
"@storybook/test": "^8.3.0",
"@testing-library/jest-dom": "^6.5.0",
"@types/d3": "^7.4.3",
"@types/diff": "^5.2.2",
"@types/js-cookie": "^3.0.6",
"@types/mustache": "^4.2.5",
"@types/qrcode": "^1.5.5",
"@types/react": "^18.3.5",
"@types/react": "^18.3.6",
"@types/react-dom": "^18.3.0",
"@types/react-is": "^18.3.0",
"@types/react-lazy-load-image-component": "^1.6.4",
"@types/react-window": "^1.8.8",
"@vitejs/plugin-react-swc": "~3.7.0",
"@vitest/coverage-v8": "^2.0.5",
"@vitest/ui": "^2.0.5",
"@vitest/coverage-v8": "^2.1.1",
"@vitest/ui": "^2.1.1",
"babel-plugin-macros": "3.1.0",
"esbuild": "^0.23.1",
"eslint": "^9.9.1",
"eslint": "^9.10.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.11",
"eslint-plugin-react-refresh": "^0.4.12",
"eslint-plugin-storybook": "^0.8.0",
"globals": "^15.9.0",
"husky": "^9.1.5",
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
"prettier": "^3.3.3",
"prettier-plugin-organize-imports": "^4.0.0",
"prop-types": "15",
"react-refresh": "^0.14.2",
"shx": "^0.3.4",
"storybook": "^8.2.9",
"storybook": "^8.3.0",
"tsc-files": "^1.1.4",
"type-fest": "^4.26.0",
"typescript": "^5.5.4",
"typescript-eslint": "^8.4.0",
"type-fest": "^4.26.1",
"typescript": "^5.6.2",
"typescript-eslint": "^8.5.0",
"unique-names-generator": "^4.7.1",
"uuid": "^10.0.0",
"vite": "^5.4.3",
"vite": "^5.4.5",
"vite-plugin-html": "^3.2.2",
"vite-plugin-mock-dev-server": "^1.7.1",
"vite-plugin-svgr": "^4.2.0",
"vitest": "^2.0.5",
"vitest": "^2.1.1",
"web-vitals": "^4.2.3"
},
"browserslist": {
Expand Down
18 changes: 11 additions & 7 deletions src/locales/de-DE/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ msgid "All security issues fixed"
msgstr "Alle Sicherheitsprobleme behoben"

#: src/pages/auth/forgot-password/ForgotPasswordPage.tsx:105
#: src/pages/auth/reset-password/ResetPasswordPage.tsx:120
#: src/pages/auth/reset-password/ResetPasswordPage.tsx:122
msgid "Already have an account? <0>Back to Sign in</0>"
msgstr ""

Expand Down Expand Up @@ -919,6 +919,10 @@ msgstr "Kritisch"
msgid "Current"
msgstr ""

#: src/pages/panel/user-settings/UserSettingsFormPassword.tsx:45
msgid "Current Password"
msgstr "Aktuelles Passwort"

#: src/pages/panel/workspace-settings-billing/ChangeProductTierModal.tsx:206
#: src/pages/panel/workspace-settings-billing/ChangeProductTierToFreeModal.tsx:129
msgid "Current Product Tier"
Expand Down Expand Up @@ -1665,8 +1669,8 @@ msgstr "Neue Ausgaben"
msgid "new non compliant resources in the past {since}"
msgstr "neue nicht konforme Ressourcen in der Vergangenheit {since}"

#: src/pages/panel/user-settings/UserSettingsFormPassword.tsx:29
#: src/pages/panel/user-settings/UserSettingsFormPassword.tsx:45
#: src/pages/panel/user-settings/UserSettingsFormPassword.tsx:30
#: src/pages/panel/user-settings/UserSettingsFormPassword.tsx:60
msgid "New Password"
msgstr "Neues Kennwort"

Expand Down Expand Up @@ -2093,7 +2097,7 @@ msgstr "Umbenennen"
msgid "Reset password"
msgstr ""

#: src/pages/auth/reset-password/ResetPasswordPage.tsx:116
#: src/pages/auth/reset-password/ResetPasswordPage.tsx:118
msgid "Reset Password"
msgstr "Passwort zurücksetzen"

Expand Down Expand Up @@ -2354,7 +2358,7 @@ msgstr ""
msgid "Sign up with {formattedName}"
msgstr "Melden Sie sich mit {formattedName} an"

#: src/pages/auth/register/RegisterPage.tsx:159
#: src/pages/auth/register/RegisterPage.tsx:161
msgid "Sign up with email"
msgstr ""

Expand All @@ -2370,7 +2374,7 @@ msgstr "Einige Prüfungen wurden für diese Ressource deaktiviert"

#: src/pages/panel/resource-detail/ResourceDetailView.tsx:321
#: src/pages/panel/user-settings/UserSettingsFormEmail.tsx:33
#: src/pages/panel/user-settings/UserSettingsFormPassword.tsx:24
#: src/pages/panel/user-settings/UserSettingsFormPassword.tsx:25
#: src/pages/panel/user-settings/UserSettingsTotpActivationModal.tsx:107
#: src/pages/panel/user-settings/UserSettingsTotpActivationModal.tsx:110
#: src/pages/panel/user-settings/UserSettingsTotpDeactivationModal.tsx:39
Expand Down Expand Up @@ -2603,7 +2607,7 @@ msgstr "Ungenutzte Datenbankinstanzen"
msgid "Update Email"
msgstr "E-Mail aktualisieren"

#: src/pages/panel/user-settings/UserSettingsFormPassword.tsx:33
#: src/pages/panel/user-settings/UserSettingsFormPassword.tsx:34
msgid "Update Password"
msgstr "Kennwort aktualisieren"

Expand Down
18 changes: 11 additions & 7 deletions src/locales/en-US/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ msgid "All security issues fixed"
msgstr "All security issues fixed"

#: src/pages/auth/forgot-password/ForgotPasswordPage.tsx:105
#: src/pages/auth/reset-password/ResetPasswordPage.tsx:120
#: src/pages/auth/reset-password/ResetPasswordPage.tsx:122
msgid "Already have an account? <0>Back to Sign in</0>"
msgstr "Already have an account? <0>Back to Sign in</0>"

Expand Down Expand Up @@ -919,6 +919,10 @@ msgstr "Critical"
msgid "Current"
msgstr "Current"

#: src/pages/panel/user-settings/UserSettingsFormPassword.tsx:45
msgid "Current Password"
msgstr "Current Password"

#: src/pages/panel/workspace-settings-billing/ChangeProductTierModal.tsx:206
#: src/pages/panel/workspace-settings-billing/ChangeProductTierToFreeModal.tsx:129
msgid "Current Product Tier"
Expand Down Expand Up @@ -1665,8 +1669,8 @@ msgstr "New issues"
msgid "new non compliant resources in the past {since}"
msgstr "new non compliant resources in the past {since}"

#: src/pages/panel/user-settings/UserSettingsFormPassword.tsx:29
#: src/pages/panel/user-settings/UserSettingsFormPassword.tsx:45
#: src/pages/panel/user-settings/UserSettingsFormPassword.tsx:30
#: src/pages/panel/user-settings/UserSettingsFormPassword.tsx:60
msgid "New Password"
msgstr "New Password"

Expand Down Expand Up @@ -2093,7 +2097,7 @@ msgstr "Rename"
msgid "Reset password"
msgstr "Reset password"

#: src/pages/auth/reset-password/ResetPasswordPage.tsx:116
#: src/pages/auth/reset-password/ResetPasswordPage.tsx:118
msgid "Reset Password"
msgstr "Reset Password"

Expand Down Expand Up @@ -2354,7 +2358,7 @@ msgstr "Sign in with email"
msgid "Sign up with {formattedName}"
msgstr "Sign up with {formattedName}"

#: src/pages/auth/register/RegisterPage.tsx:159
#: src/pages/auth/register/RegisterPage.tsx:161
msgid "Sign up with email"
msgstr "Sign up with email"

Expand All @@ -2370,7 +2374,7 @@ msgstr "Some checks have been disabled for this resource"

#: src/pages/panel/resource-detail/ResourceDetailView.tsx:321
#: src/pages/panel/user-settings/UserSettingsFormEmail.tsx:33
#: src/pages/panel/user-settings/UserSettingsFormPassword.tsx:24
#: src/pages/panel/user-settings/UserSettingsFormPassword.tsx:25
#: src/pages/panel/user-settings/UserSettingsTotpActivationModal.tsx:107
#: src/pages/panel/user-settings/UserSettingsTotpActivationModal.tsx:110
#: src/pages/panel/user-settings/UserSettingsTotpDeactivationModal.tsx:39
Expand Down Expand Up @@ -2603,7 +2607,7 @@ msgstr "Unused Database Instances"
msgid "Update Email"
msgstr "Update Email"

#: src/pages/panel/user-settings/UserSettingsFormPassword.tsx:33
#: src/pages/panel/user-settings/UserSettingsFormPassword.tsx:34
msgid "Update Password"
msgstr "Update Password"

Expand Down
2 changes: 1 addition & 1 deletion src/pages/auth/login/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export default function LoginPage() {
required
id="password"
name="password"
autoComplete="current-password"
autoComplete="current-password webauthn"
placeholder={t`Password`}
slotProps={{
input: {
Expand Down
10 changes: 6 additions & 4 deletions src/pages/auth/register/RegisterPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,12 @@ export default function RegisterPage() {
name="password"
autoComplete="new-password"
placeholder={t`Password`}
InputProps={{
startAdornment: (
<PasswordIcon width={24} height={24} fill={email ? `${panelUI.uiThemePalette.text.darkGray} !important` : undefined} />
),
slotProps={{
input: {
startAdornment: (
<PasswordIcon width={24} height={24} fill={email ? `${panelUI.uiThemePalette.text.darkGray} !important` : undefined} />
),
},
}}
variant="outlined"
fullWidth
Expand Down
Loading

0 comments on commit 2e5df97

Please sign in to comment.