Skip to content
Open
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "keycloakify",
"version": "11.14.1",
"version": "11.14.2",
"description": "Framework to create custom Keycloak UIs",
"repository": {
"type": "git",
Expand Down
26 changes: 13 additions & 13 deletions src/bin/tools/npmInstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,34 @@ export async function npmInstall(params: { packageJsonDirPath: string }) {
const packageMangers = [
{
binName: "yarn",
lockFileBasename: "yarn.lock"
lockFileBasenames: ["yarn.lock"]
},
{
binName: "npm",
lockFileBasename: "package-lock.json"
lockFileBasenames: ["package-lock.json"]
},
{
binName: "pnpm",
lockFileBasename: "pnpm-lock.yaml"
lockFileBasenames: ["pnpm-lock.yaml"]
},
{
binName: "bun",
lockFileBasename: "bun.lockdb"
lockFileBasenames: ["bun.lockdb", "bun.lockb", "bun.lock"]
},
{
binName: "deno",
lockFileBasename: "deno.lock"
lockFileBasenames: ["deno.lock"]
}
] as const;

for (const packageManager of packageMangers) {
if (
fs.existsSync(
pathJoin(packageJsonDirPath, packageManager.lockFileBasename)
) ||
fs.existsSync(pathJoin(process.cwd(), packageManager.lockFileBasename))
) {
return packageManager.binName;
for (const { binName, lockFileBasenames } of packageMangers) {
for (const lockFileBasename of lockFileBasenames) {
if (
fs.existsSync(pathJoin(packageJsonDirPath, lockFileBasename)) ||
fs.existsSync(pathJoin(process.cwd(), lockFileBasename))
) {
return binName;
}
}
}

Expand Down
142 changes: 142 additions & 0 deletions stories/login/pages/LoginUpdateProfile.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,145 @@ export const WithProfileError: Story = {
/>
)
};

export const WithMoreFields: Story = {
render: () => (
<KcPageStory
kcContext={{
profile: {
attributesByName: {
multiAttribute: {
validators: {},
displayName: "Multi-Attribute Field",
annotations: {},
multivalued: true,
name: "multiAttribute"
},
favouritePet: {
validators: {
options: {
options: ["Cat", "Dog", "Bird"]
}
},
displayName: "Favourite Pet",
annotations: {
inputType: "select"
},
value: "dog",
values: ["dog"],
name: "favouritePet"
},
age: {
validators: {
integer: {
min: 0,
max: 99
}
},
displayName: "Age",
annotations: {
inputType: "html5-number"
},
name: "age"
},
birthdate: {
validators: {},
displayName: "Birthdate",
annotations: {
inputType: "html5-date"
},
name: "birthdate"
}
}
}
}}
/>
)
};

export const WithMoreFieldsPrefilled: Story = {
render: () => (
<KcPageStory
kcContext={{
profile: {
attributesByName: {
multiAttribute: {
validators: {},
displayName: "Multi-Attribute Field",
annotations: {},
multivalued: true,
values: ["value 1", "value 2"],
name: "multiAttribute"
},
favouritePet: {
validators: {
options: {
options: ["Cat", "Dog", "Bird"]
}
},
displayName: "Favourite Pet",
annotations: {
inputType: "select"
},
value: "Dog",
name: "favouritePet"
},
age: {
validators: {
integer: {
min: 0,
max: 99
}
},
displayName: "Age",
annotations: {
inputType: "html5-number"
},
value: "22",
name: "age"
},
birthdate: {
validators: {},
displayName: "Birthdate",
annotations: {
inputType: "html5-date"
},
value: "2000-01-01",
name: "birthdate"
}
}
}
}}
/>
)
};

export const WithGroups: Story = {
render: () => (
<KcPageStory
kcContext={{
profile: {
attributesByName: {
division: {
validators: {},
displayName: "Division",
annotations: {},
required: false,
html5DataAnnotations: {},
group: {
displayDescription: "Attributes, which refer to user metadata",
annotations: {},
displayHeader: "User metadata",
html5DataAnnotations: {},
name: "user-metadata"
},
multivalued: false,
readOnly: false,
name: "division"
}
}
}
}}
/>
)
};