Skip to content

feat(keycloak): property-manager login theme + how-to-apply guide - #188

Merged
HadiSaaibi merged 1 commit into
hadisaiibi-mouhannadfrom
feat/keycloak-theme
Jul 21, 2026
Merged

feat(keycloak): property-manager login theme + how-to-apply guide#188
HadiSaaibi merged 1 commit into
hadisaiibi-mouhannadfrom
feat/keycloak-theme

Conversation

@MouhannadKhodor

@MouhannadKhodor MouhannadKhodor commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Keycloak login theme — property-manager

Keycloakify 11 source for the custom property-manager login theme used by the prorentallb
realm (the branded "Property Manager" sign-in page). Already built and live on prod
(fm-keycloak, Keycloak 26) — this PR version-controls the source and documents how to build +
apply it in any Keycloak.

  • Source onlynode_modules/, dist/, and dist_keycloak/ (the built jars) are gitignored
    build outputs, produced by the build step below.
  • Login theme only (accountThemeImplementation: "none"); theme name property-manager (set in
    vite.config.ts).

📄 Full apply steps → keycloak-theme/APPLYING-THE-THEME.md

Short version:

  1. Build: cd keycloak-theme && npm install && npm run build-keycloak-theme → produces
    dist_keycloak/keycloak-theme-for-kc-all-other-versions.jar (use this one for KC 26).
  2. Deploy the jar: drop it in Keycloak's providers dir and restart. Prod mounts
    keycloak-providers//opt/keycloak/providers/ via an additive docker-compose.override.yml,
    then docker compose up -d keycloak.
  3. Apply in settings: Admin console → realm prorentallbRealm settings → Themes →
    Login theme → property-manager → Save
    .
  4. Verify: click Sign in in the app and confirm the branding.

Gotchas (all documented in the guide): KC26 needs the all-other-versions jar (not 22-to-25);
the realm has i18n off (login is EN-only); the KC container must be restarted after swapping
the jar; PatternFly .pf-c-input-group / #kc-info-wrapper reskin traps are handled in
src/login/theme.css.

Base = hadisaiibi-mouhannad; independent of PR #186 (tenant portal).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added a branded Property Manager Keycloak login theme with navy-and-gold styling.
    • Added RTL support, localization, language selection, alerts, social login, OTP, and responsive form styling.
    • Added Storybook support for previewing and testing theme pages.
  • Documentation
    • Added setup, build, deployment, application, verification, and rollback guidance.
  • Chores
    • Added project configuration for formatting, linting, TypeScript, and local development.

Keycloakify 11 source for the `property-manager` login theme (login-only) used by
the prorentallb realm — already live on fm-keycloak (KC26). Source only; node_modules/
dist/dist_keycloak are gitignored build outputs. Build+deploy+apply steps in
keycloak-theme/APPLYING-THE-THEME.md. [skip-gn]

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

The PR adds a complete property-manager Keycloakify theme project, including Vite/TypeScript tooling, Storybook configuration, generated Keycloak context wiring, login page rendering, a custom RTL-aware template, navy-and-gold CSS styling, and build/deployment documentation.

Property Manager Keycloak theme

Layer / File(s) Summary
Project foundation and tooling
keycloak-theme/package.json, keycloak-theme/vite.config.ts, keycloak-theme/tsconfig*.json, keycloak-theme/.storybook/*, keycloak-theme/index.html, keycloak-theme/.gitignore, keycloak-theme/.prettier*, keycloak-theme/eslint.config.js
Adds project metadata, build scripts, Vite/TypeScript configuration, linting and formatting rules, Storybook setup, entry HTML, and ignore patterns.
Keycloak context and runtime entry
keycloak-theme/src/kc.gen.tsx, keycloak-theme/src/login/KcContext.ts, keycloak-theme/src/login/i18n.ts, keycloak-theme/src/main.tsx
Defines the theme context types and global kcContext, lazy-loads the login page, exposes i18n helpers, and mounts the page or fallback content.
Login page composition and template
keycloak-theme/src/login/KcPage.tsx, keycloak-theme/src/login/KcPageStory.tsx, keycloak-theme/src/login/Template.tsx
Connects Keycloakify’s default page with lazy user-profile fields, typed page-story mocks, localized rendering, authentication actions, alerts, locale selection, social providers, and informational content.
Theme styling and project documentation
keycloak-theme/src/login/theme.css, keycloak-theme/README.md, keycloak-theme/APPLYING-THE-THEME.md, keycloak-theme/LICENSE
Adds the navy-and-gold responsive login styling, deployment and rollback instructions, starter documentation, and the MIT license.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant main_tsx
  participant KcPage
  participant KcLoginPage
  participant Template
  Browser->>main_tsx: mount React application
  main_tsx->>KcPage: provide window.kcContext
  KcPage->>KcLoginPage: lazy-load login page
  KcLoginPage->>Template: render localized login template
  Template-->>Browser: display themed Keycloak page
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: a property-manager Keycloak login theme and apply guide.
Description check ✅ Passed The description covers the theme purpose and apply/QA steps, but it omits the issue/ticket link and screenshots sections.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/keycloak-theme

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
keycloak-theme/package.json (1)

12-12: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Run TypeScript in build mode so vite.config.ts is checked.

The root tsconfig.json includes only src, while vite.config.ts belongs to the referenced tsconfig.node.json. Plain tsc does not build referenced projects, and Vite transpiles without type-checking, so configuration errors can pass the production build. Use tsc -b or explicitly type-check both configs before vite build. (typescriptlang.org)

Proposed fix
-        "build": "tsc && vite build",
+        "build": "tsc -b && vite build",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@keycloak-theme/package.json` at line 12, Update the build script in
package.json to run TypeScript in build mode with tsc -b before vite build,
ensuring both the root and referenced tsconfig.node.json projects, including
vite.config.ts, are type-checked.

Source: MCP tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@keycloak-theme/.gitignore`:
- Around line 53-57: Add /public/keycloakify-dev-resources/ to
keycloak-theme/.gitignore alongside the existing generated-output paths,
matching the path already excluded by .prettierignore.

In `@keycloak-theme/eslint.config.js`:
- Around line 42-46: Update the ESLint configuration around the stories override
to either register eslint-plugin-import and add it to
keycloak-theme/package.json, or remove the import/no-anonymous-default-export
override if the plugin is not required; ensure the final configuration does not
reference an unloaded or undeclared plugin.

In `@keycloak-theme/src/login/theme.css`:
- Around line 266-269: Remove `.kc-feedback-text` from the earlier warm-white
rule, leaving that declaration scoped to `.pf-c-alert__title`; retain the later
`.kc-feedback-text` error color rule unchanged.

---

Nitpick comments:
In `@keycloak-theme/package.json`:
- Line 12: Update the build script in package.json to run TypeScript in build
mode with tsc -b before vite build, ensuring both the root and referenced
tsconfig.node.json projects, including vite.config.ts, are type-checked.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e7055fd0-b55e-4b80-b9e1-a4088cbe33bc

📥 Commits

Reviewing files that changed from the base of the PR and between 183b456 and 3f6e0af.

⛔ Files ignored due to path filters (3)
  • keycloak-theme/package-lock.json is excluded by !**/package-lock.json
  • keycloak-theme/public/favicon-32x32.png is excluded by !**/*.png
  • keycloak-theme/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (24)
  • keycloak-theme/.gitignore
  • keycloak-theme/.prettierignore
  • keycloak-theme/.prettierrc.json
  • keycloak-theme/.storybook/main.ts
  • keycloak-theme/.storybook/preview-head.html
  • keycloak-theme/.storybook/preview.ts
  • keycloak-theme/APPLYING-THE-THEME.md
  • keycloak-theme/LICENSE
  • keycloak-theme/README.md
  • keycloak-theme/eslint.config.js
  • keycloak-theme/index.html
  • keycloak-theme/package.json
  • keycloak-theme/src/kc.gen.tsx
  • keycloak-theme/src/login/KcContext.ts
  • keycloak-theme/src/login/KcPage.tsx
  • keycloak-theme/src/login/KcPageStory.tsx
  • keycloak-theme/src/login/Template.tsx
  • keycloak-theme/src/login/i18n.ts
  • keycloak-theme/src/login/theme.css
  • keycloak-theme/src/main.tsx
  • keycloak-theme/src/vite-env.d.ts
  • keycloak-theme/tsconfig.json
  • keycloak-theme/tsconfig.node.json
  • keycloak-theme/vite.config.ts

Comment thread keycloak-theme/.gitignore
Comment on lines +53 to +57
/dist

/dist_keycloak
/build
/storybook-static

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Ignore Keycloakify’s generated development resources in Git.

keycloak-theme/.prettierignore excludes /public/keycloakify-dev-resources/, but this Git ignore file does not. Add the same path to prevent generated resources from being committed.

 /dist_keycloak
 /build
 /storybook-static
+/public/keycloakify-dev-resources
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/dist
/dist_keycloak
/build
/storybook-static
/dist
/dist_keycloak
/build
/storybook-static
/public/keycloakify-dev-resources
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@keycloak-theme/.gitignore` around lines 53 - 57, Add
/public/keycloakify-dev-resources/ to keycloak-theme/.gitignore alongside the
existing generated-output paths, matching the path already excluded by
.prettierignore.

Comment on lines +42 to +46
{
files: ["**/*.stories.*"],
rules: {
"import/no-anonymous-default-export": "off",
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== eslint.config.js ==\n'
cat -n keycloak-theme/eslint.config.js | sed -n '1,220p'

printf '\n== package.json ==\n'
cat -n keycloak-theme/package.json | sed -n '1,220p'

printf '\n== search for import/no-anonymous-default-export and eslint-plugin-import ==\n'
rg -n --hidden --glob '!**/node_modules/**' 'import/no-anonymous-default-export|eslint-plugin-import|plugins:\s*\{|import:' keycloak-theme

Repository: chrisshaddad/bootcamp-starter

Length of output: 3901


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== repo-wide search ==\n'
rg -n --hidden --glob '!**/node_modules/**' 'eslint-plugin-import|import/no-anonymous-default-export' .

printf '\n== lockfiles mentioning eslint-plugin-import ==\n'
rg -n --hidden --glob '!**/node_modules/**' 'eslint-plugin-import' ./*lock* ./**/package-lock.json ./**/pnpm-lock.yaml ./**/yarn.lock 2>/dev/null || true

Repository: chrisshaddad/bootcamp-starter

Length of output: 2090


🌐 Web query:

ESLint flat config disabled rule from plugin without plugin loaded "Definition for rule was not found" off

💡 Result:

The error "Definition for rule was not found" occurs in ESLint flat config when you attempt to configure or disable a rule from a plugin without that plugin being correctly loaded in the configuration for the specific files being linted [1][2]. Unlike the older.eslintrc format, where rules could often be referenced globally, flat config requires the plugin to be explicitly defined in the plugins key of the configuration object that matches your files [3][4]. To resolve this issue, ensure the following steps are taken: 1. Import the Plugin: You must import the plugin as a JavaScript module in your eslint.config.js file [5]. 2. Define the Plugin in the Config Object: You must add the imported plugin to the plugins property of the configuration object that applies to your target files [3][4]. 3. Scope to Files: If the rule should only apply to certain files (e.g., TypeScript files), ensure your configuration object includes the files property so that the plugin is only loaded when those files are processed [1][4]. Example: import myPlugin from "eslint-plugin-my-plugin"; export default [ { files: ["/*.js"], plugins: { "my-plugin": myPlugin, }, rules: { "my-plugin/rule-name": "off", // Rule is now found because the plugin is loaded }, }, ]; If you are seeing this error when trying to disable a rule that you no longer use or that is no longer installed, you must remove the reference to that rule from your rules object entirely [6]. ESLint will throw this error if you attempt to configure a rule that does not exist or whose defining plugin is missing [1][2]. You can use the --inspect-config command (ESLint 9+) to troubleshoot which configuration objects are being applied to your files and verify that the plugin is correctly registered [2].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== root package.json ==\n'
cat -n package.json | sed -n '1,220p'

printf '\n== keycloak-theme tree (shallow) ==\n'
find keycloak-theme -maxdepth 1 -type f | sort

printf '\n== package-lock snippets around eslint-plugin-import ==\n'
sed -n '10700,10870p' package-lock.json | cat -n | sed -n '1,220p'

Repository: chrisshaddad/bootcamp-starter

Length of output: 9022


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== keycloak-theme/package-lock.json matches ==\n'
rg -n 'eslint-plugin-import|import/no-anonymous-default-export' keycloak-theme/package-lock.json || true

printf '\n== keycloak-theme/yarn.lock matches ==\n'
rg -n 'eslint-plugin-import|import/no-anonymous-default-export' keycloak-theme/yarn.lock || true

Repository: chrisshaddad/bootcamp-starter

Length of output: 255


Register eslint-plugin-import here, or remove the override. import/no-anonymous-default-export comes from eslint-plugin-import, but this config doesn’t load that plugin or declare it in keycloak-theme/package.json.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@keycloak-theme/eslint.config.js` around lines 42 - 46, Update the ESLint
configuration around the stories override to either register
eslint-plugin-import and add it to keycloak-theme/package.json, or remove the
import/no-anonymous-default-export override if the plugin is not required;
ensure the final configuration does not reference an unloaded or undeclared
plugin.

Comment on lines +266 to +269
.pf-c-alert__title,
.kc-feedback-text {
color: var(--pm-warm-white);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Conflicting .kc-feedback-text color rules — later one silently wins.

.kc-feedback-text is targeted by two rulesets with equal specificity: warm-white at Line 266-269 and #f2a3a3 at Line 386-389. Source order makes the second declaration win unconditionally, so the first is dead code and any non-error usage of .kc-feedback-text renders red regardless of intent.

🎨 Proposed fix — drop the duplicate target from the earlier rule
 .pf-c-alert__title,
-.kc-feedback-text {
+.pf-c-alert__title {
     color: var(--pm-warm-white);
 }

Also applies to: 386-389

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@keycloak-theme/src/login/theme.css` around lines 266 - 269, Remove
`.kc-feedback-text` from the earlier warm-white rule, leaving that declaration
scoped to `.pf-c-alert__title`; retain the later `.kc-feedback-text` error color
rule unchanged.

@HadiSaaibi
HadiSaaibi merged commit b15037e into hadisaiibi-mouhannad Jul 21, 2026
1 of 2 checks passed
@HadiSaaibi
HadiSaaibi deleted the feat/keycloak-theme branch July 21, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants