Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore(site): fix reset password storybook flake#15380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
BrunoQuaresma merged 1 commit intomainfrombq/fix-storybook-flake-reset-password
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes fromall 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
3 changes: 3 additions & 0 deletionssite/src/pages/UsersPage/UsersPage.stories.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -72,6 +72,9 @@ const meta: Meta<typeof UsersPage> = {
component: UsersPage,
parameters,
decorators: [withGlobalSnackbar, withAuthProvider, withDashboardProvider],
args: {
defaultNewPassword: "edWbqYiaVpEiEWwI",
},
};

export default meta;
Expand Down
10 changes: 8 additions & 2 deletionssite/src/pages/UsersPage/UsersPage.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,7 +35,13 @@ import { ResetPasswordDialog } from "./ResetPasswordDialog";
import { useStatusFilterMenu } from "./UsersFilter";
import { UsersPageView } from "./UsersPageView";

const UsersPage: FC = () => {
type UserPageProps = {
// Used by Storybook to prevent generating a new password each time the story
// loads, avoiding Chromatic snapshot differences.
defaultNewPassword?: string;
};

const UsersPage: FC<UserPageProps> = ({ defaultNewPassword }) => {
const queryClient = useQueryClient();
const navigate = useNavigate();
const location = useLocation();
Expand DownExpand Up@@ -134,7 +140,7 @@ const UsersPage: FC = () => {
onResetUserPassword={(user) => {
setConfirmResetPassword({
user,
newPassword: generateRandomString(12),
newPassword:defaultNewPassword ??generateRandomString(12),
});
}}
onUpdateUserRoles={async (userId, roles) => {
Expand Down
1 change: 0 additions & 1 deletionsite/src/pages/UsersPage/UsersPageView.stories.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,7 +34,6 @@ const meta: Meta<typeof UsersPageView> = {
isNonInitialPage: false,
users: [MockUser, MockUser2],
roles: MockAssignableSiteRoles,

canEditUsers: true,
filterProps: defaultFilterProps,
authMethods: MockAuthMethodsPasswordOnly,
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp