Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ jobs:
strategy:
fail-fast: false
matrix:
platform: [ macos-latest, ubuntu-22.04, windows-latest ]
platform: [ macos-latest, ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf

- name: Node.js setup
uses: actions/setup-node@v4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ jobs:
strategy:
fail-fast: false
matrix:
platform: [ macos-latest, ubuntu-22.04, windows-latest ]
platform: [ macos-latest, ubuntu-latest, windows-latest ]

runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf

- name: Setup node
uses: actions/setup-node@v4
Expand Down
2 changes: 2 additions & 0 deletions src/contexts/MainContextProvider/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const languageSelector = localStorage.languageSelector
? (localStorage.languageSelector === 'true')
: false;
const tips = localStorage.tips ? (localStorage.tips === 'true') : true;
const sortByStrength = localStorage.sortByStrength ? (localStorage.sortByStrength === 'true') : true;
let hasSetCookies = false;
let allowCookies = true;

Expand Down Expand Up @@ -53,6 +54,7 @@ const initState = {
tips,
allowCookies,
hasSetCookies,
sortByStrength,
};

export const MainContext = createContext(initState);
Expand Down
3 changes: 2 additions & 1 deletion src/languages/de_de.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,6 @@
"exportSuccessful": "Export erfolgreich",
"cookieNoticeText": "Diese Website verwendet Cookies, um sicherzustellen, dass Sie die bestmögliche Erfahrung auf unserer Website haben.",
"accept": "Akzeptieren",
"reject": "Ablehnen"
"reject": "Ablehnen",
"sortByStrength": "Standardmäßig nach Stärke sortieren"
}
3 changes: 2 additions & 1 deletion src/languages/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,6 @@
"exportSuccessful": "Export successful",
"cookieNoticeText": "This website uses cookies to ensure you get the best experience on our website.",
"accept": "Accept",
"reject": "Reject"
"reject": "Reject",
"sortByStrength": "Sort by strength by default"
}
3 changes: 2 additions & 1 deletion src/languages/es_es.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,6 @@
"exportSuccessful": "Exportación exitosa",
"cookieNoticeText": "Este sitio web utiliza cookies para garantizar que obtenga la mejor experiencia en nuestro sitio web.",
"accept": "Aceptar",
"reject": "Rechazar"
"reject": "Rechazar",
"sortByStrength": "Ordenar por fuerza de forma predeterminada"
}
3 changes: 2 additions & 1 deletion src/languages/fr_fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,6 @@
"exportSuccessful": "Exportation réussie",
"cookieNoticeText": "Ce site utilise des cookies pour vous garantir la meilleure expérience sur notre site.",
"accept": "Accepter",
"reject": "Rejeter"
"reject": "Rejeter",
"sortByStrength": "Trier par force par défaut"
}
3 changes: 2 additions & 1 deletion src/languages/jp_jp.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,6 @@
"exportSuccessful": "エクスポートに成功しました",
"cookieNoticeText": "このサイトはクッキーを使用しています。 クッキーを使用することに同意する場合は、この通知を閉じてください。",
"accept": "受け入れる",
"reject": "拒否する"
"reject": "拒否する",
"sortByStrength": "デフォルトで強さ順に並べ替え"
}
3 changes: 2 additions & 1 deletion src/languages/nl_nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,6 @@
"exportSuccessful": "Export aangemaakt",
"cookieNoticeText": "Deze website maakt gebruik van cookies om ervoor te zorgen dat je de beste ervaring op onze website krijgt.",
"accept": "Accepteren",
"reject": "Afwijzen"
"reject": "Afwijzen",
"sortByStrength": "Standaard sorteren op sterkte"
}
3 changes: 2 additions & 1 deletion src/languages/ru_ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,6 @@
"exportSuccessful": "Экспорт успешно завершен!",
"cookieNoticeText": "Этот сайт использует файлы cookie, чтобы обеспечить вам лучший опыт на нашем сайте.",
"accept": "Принять",
"reject": "Отклонить"
"reject": "Отклонить",
"sortByStrength": "Сортировать по силе по умолчанию"
}
3 changes: 2 additions & 1 deletion src/languages/tr_tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,6 @@
"exportSuccessful": "Başarıyla dışa aktarıldı",
"cookieNoticeText": "Bu site, size sitemizde en iyi deneyimi sunmak için çerezler kullanır. Çerez kullanımını kabul ediyorsanız, bu bildirimi kapatın.",
"accept": "Kabul etmek",
"reject": "Reddetmek"
"reject": "Reddetmek",
"sortByStrength": "Varsayılan olarak güce göre sırala"
}
3 changes: 2 additions & 1 deletion src/languages/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,6 @@
"exportSuccessful": "导出成功",
"cookieNoticeText": "本网站使用 Cookie。如果您同意使用 Cookie,请关闭此通知。",
"accept": "接受",
"reject": "拒绝"
"reject": "拒绝",
"sortByStrength": "默认按强度排序"
}
1 change: 1 addition & 0 deletions src/reducers/MainReducer/Actions/actionTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ export const SET_CHECKED_FOR_UPDATES = 'SET_CHECKED_FOR_UPDATES';
export const SET_COLOR_ON_DARK = 'SET_COLOR_ON_DARK';
export const SET_TIPS = 'SET_TIPS';
export const SET_ALLOW_COOKIES = 'SET_ALLOW_COOKIES';
export const SET_DEFAULT_SORT_BY_STRENGTH = 'SET_DEFAULT_SORT_BY_STRENGTH';
6 changes: 6 additions & 0 deletions src/reducers/MainReducer/Actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
SET_AUTO_UPDATE,
SET_CHECKED_FOR_UPDATES,
SET_COLOR_ON_DARK,
SET_DEFAULT_SORT_BY_STRENGTH,
SET_ERROR,
SET_LANGUAGE_INDEX,
SET_LANGUAGE_SELECTOR,
Expand Down Expand Up @@ -97,3 +98,8 @@ export const setAllowCookies = (allow) => ({
type: SET_ALLOW_COOKIES,
payload: allow,
});

export const setDefaultSortByStrength = (value) => ({
type: SET_DEFAULT_SORT_BY_STRENGTH,
payload: value,
});
9 changes: 8 additions & 1 deletion src/reducers/MainReducer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
SET_ALLOW_COOKIES,
SET_AUTO_UPDATE,
SET_CHECKED_FOR_UPDATES,
SET_COLOR_ON_DARK,
SET_COLOR_ON_DARK, SET_DEFAULT_SORT_BY_STRENGTH,
SET_ERROR,
SET_LANGUAGE_INDEX,
SET_LANGUAGE_SELECTOR,
Expand Down Expand Up @@ -54,6 +54,7 @@ const MainReducer = (state, action) => {
languageSelector: false,
colorOnDark: false,
tips: true,
sortByStrength: true,
};
case SET_AUTO_UPDATE:
localStorage.autoUpdate = action.payload;
Expand Down Expand Up @@ -105,6 +106,12 @@ const MainReducer = (state, action) => {
...state,
allowCookies: action.payload,
};
case SET_DEFAULT_SORT_BY_STRENGTH:
localStorage.sortByStrength = action.payload;
return {
...state,
sortByStrength: action.payload,
};
default:
return state;
}
Expand Down
10 changes: 8 additions & 2 deletions src/routes/Generate/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ const Generate = () => {
const [state1, d1] = useContext(MainContext);
const [state2, d2] = useContext(PasswordContext);

const { languageIndex, loading, allowCookies } = state1;
const {
languageIndex, loading, allowCookies, sortByStrength,
} = state1;
const language = state1.languages[languageIndex];

const [exportType, setExportType] = useState('application/json');
Expand Down Expand Up @@ -228,12 +230,16 @@ const Generate = () => {
}
}, []);

const passwordRows = [];
let passwordRows = [];
if (passwords && passwords.length > 0) {
const splitter = new Graphemer();
passwords.forEach((e, i) => {
passwordRows.push(createData(`${e}${i}`, e, splitter.countGraphemes(e), PasswordStrength(e)));
});

if (sortByStrength) {
passwordRows = passwordRows.sort((a, b) => parseFloat(b.strength) - parseFloat(a.strength));
}
}

if (loading) {
Expand Down
13 changes: 12 additions & 1 deletion src/routes/Settings/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import {
resetState,
setAutoUpdate,
setCheckedForUpdates,
setColorOnDark,
setColorOnDark, setDefaultSortByStrength,
setError,
setLanguageIndex,
setLanguageSelector,
Expand All @@ -69,6 +69,7 @@ const Settings = () => {
colorOnDark,
tips,
allowCookies,
sortByStrength,
} = state;

const language = state.languages[languageIndex];
Expand Down Expand Up @@ -210,6 +211,16 @@ const Settings = () => {
)}
label={language.languageSelector}
/>
<FormControlLabel
control={(
<Checkbox
checked={sortByStrength}
onChange={(e) => d1(setDefaultSortByStrength(e.target.checked))}
value="strengthSortSelector"
/>
)}
label={language.sortByStrength}
/>
<FormControl variant="outlined" sx={{ mt: 2 }}>
<InputLabel id="language-label">{language.language}</InputLabel>
<Select
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2055,12 +2055,12 @@ __metadata:
linkType: hard

"@mui/x-data-grid@npm:^7.23.6":
version: 7.23.6
resolution: "@mui/x-data-grid@npm:7.23.6"
version: 7.24.0
resolution: "@mui/x-data-grid@npm:7.24.0"
dependencies:
"@babel/runtime": "npm:^7.25.7"
"@mui/utils": "npm:^5.16.6 || ^6.0.0"
"@mui/x-internals": "npm:7.23.6"
"@mui/x-internals": "npm:7.24.0"
clsx: "npm:^2.1.1"
prop-types: "npm:^15.8.1"
reselect: "npm:^5.1.1"
Expand All @@ -2076,19 +2076,19 @@ __metadata:
optional: true
"@emotion/styled":
optional: true
checksum: 10c0/30e643b44d7f020a94cc9a234d67a80e6f300d3b7d2761f3b52a9eb7fd37337b39084203461f75fc65b89eddc01c9dfdd872cce5cf9a7009d83af348ca61d4dd
checksum: 10c0/b1a4808c94879cb1f45c43c841801e70c1c9e8c9778604a0c07defe77bad63c3c51169283cc38cf06bcdb5664de43deb0e20912b071b67cca2e23bded8a12e8c
languageName: node
linkType: hard

"@mui/x-internals@npm:7.23.6":
version: 7.23.6
resolution: "@mui/x-internals@npm:7.23.6"
"@mui/x-internals@npm:7.24.0":
version: 7.24.0
resolution: "@mui/x-internals@npm:7.24.0"
dependencies:
"@babel/runtime": "npm:^7.25.7"
"@mui/utils": "npm:^5.16.6 || ^6.0.0"
peerDependencies:
react: ^17.0.0 || ^18.0.0 || ^19.0.0
checksum: 10c0/c41de79311eea8a10c40a982e648d374a3d6cc950318dc2c563fd193455a4e972a6f552777c15d282eb8282e77f8e9fe0e2d95a28310e579b3322103e4836c4d
checksum: 10c0/3c73b33ca529427aa53d9ca75aa9dccde8d2ce9c6bbf45ebd9d69ad0b5c937818fcb50604e62a1ef13dca3b7289f0f1fd70a6ae79ad79a84fa063854be304b79
languageName: node
linkType: hard

Expand Down