chore: improve password error message (#6255)

chore: improve error message

chore: add password minlength & maxlength i18n

chore: check max length

fix: i18n variables

feat: add CredentialsRequirementType
This commit is contained in:
fundon
2024-03-26 07:15:06 +00:00
parent b8e6d7d6cb
commit 8ee9f6ec05
25 changed files with 354 additions and 82 deletions

View File

@@ -0,0 +1,5 @@
fragment CredentialsRequirement on CredentialsRequirementType {
password {
...PasswordLimits
}
}

View File

@@ -0,0 +1,4 @@
fragment PasswordLimits on PasswordLimitsType {
minLength
maxLength
}

View File

@@ -7,6 +7,17 @@ export interface GraphQLQuery {
containsFile?: boolean;
}
export const passwordLimitsFragment = `
fragment PasswordLimits on PasswordLimitsType {
minLength
maxLength
}`
export const credentialsRequirementFragment = `
fragment CredentialsRequirement on CredentialsRequirementType {
password {
...PasswordLimits
}
}`
export const checkBlobSizesQuery = {
id: 'checkBlobSizesQuery' as const,
operationName: 'checkBlobSizes',
@@ -708,8 +719,12 @@ query serverConfig {
name
features
type
credentialsRequirement {
...CredentialsRequirement
}
}
}`,
}${passwordLimitsFragment}
${credentialsRequirementFragment}`,
};
export const setWorkspacePublicByIdMutation = {

View File

@@ -1,3 +1,6 @@
#import './fragments/password-limits.gql'
#import './fragments/credentials-requirement.gql'
query serverConfig {
serverConfig {
version
@@ -5,5 +8,8 @@ query serverConfig {
name
features
type
credentialsRequirement {
...CredentialsRequirement
}
}
}

View File

@@ -292,6 +292,21 @@ export type RemoveEarlyAccessMutation = {
removeEarlyAccess: number;
};
export type CredentialsRequirementFragment = {
__typename?: 'CredentialsRequirementType';
password: {
__typename?: 'PasswordLimitsType';
minLength: number;
maxLength: number;
};
};
export type PasswordLimitsFragment = {
__typename?: 'PasswordLimitsType';
minLength: number;
maxLength: number;
};
export type GetCurrentUserQueryVariables = Exact<{ [key: string]: never }>;
export type GetCurrentUserQuery = {
@@ -701,6 +716,14 @@ export type ServerConfigQuery = {
name: string;
features: Array<ServerFeature>;
type: ServerDeploymentType;
credentialsRequirement: {
__typename?: 'CredentialsRequirementType';
password: {
__typename?: 'PasswordLimitsType';
minLength: number;
maxLength: number;
};
};
};
};