Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(global-header): added config for default header components #2263

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

ciiay
Copy link
Contributor

@ciiay ciiay commented Jan 27, 2025

Description

  • Added config for default application header components
  • Added extra common icons
  • Updated support to "tech-preview"
  • Updated support to "production" as the new plugin version will be ready for production

Which issue(s) does this PR fix

PR acceptance criteria

Please make sure that the following steps are complete:

  • GitHub Actions are completed and successful
  • Unit Tests are updated and passing
  • E2E Tests are updated and passing
  • Documentation is updated if necessary (requirement for new features)
  • Add a screenshot if the change is UX/UI related

How to test changes / Special notes to the reviewer

  1. Pull changes in rhdh-plugins PR to your local and in workspaces/global-header/plugins/global-header/ directory run npx --yes @janus-idp/cli package export-dynamic-plugin --dynamic-plugins-root <path-to-your-rhdh>/dynamic-plugins-root --dev
  2. Pull changes in this PR to your local rhdh, in app-config.local file:
dynamicPlugins:
  rootDirectory: dynamic-plugins-root
  frontend:
    red-hat-developer-hub.backstage-plugin-global-header:
      mountPoints:
        - mountPoint: application/header
          importName: GlobalHeader
          config:
            layout:
              position: above-main-content
              # position: above-sidebar
        - mountPoint: application/header/component
          importName: SearchComponent
          config:
            type: search
            enabled: true
            slot: header-start
            priority: 100
        - mountPoint: application/header/component
          importName: CreateDropdown
          config:
            type: dropdown_button
            enabled: true
            key: create
            slot: header-start
            priority: 90
        - mountPoint: global.header/component
          importName: HeaderIconButton
          config:
            type: icon_button
            slot: header-start
            priority: 80
            props:
              icon: support
              tooltip: Support
              to: https://github.com/redhat-developer/rhdh/issues
        - mountPoint: global.header/component
          importName: HeaderIconButton
          config:
            type: icon_button
            slot: header-start
            priority: 70
            props:
              icon: notifications
              tooltip: Notifications
              to: /notifications
        - mountPoint: application/header/component
          importName: ProfileDropdown
          config:
            type: dropdown_button
            enabled: true
            key: profile
            slot: header-end
            priority: 0

To test out the Notifications icon button, follow the below steps:
To set up notifications frontend, you can add to app-config.yaml:

dynamicPlugins:
  frontend:
    backstage.plugin-notifications:
      dynamicRoutes:
        - path: /notifications
          importName: NotificationsPage
          module: NotificationsPlugin
          menuItem:
            config:
              props:
                titleCounterEnabled: true
                webNotificationsEnabled: true
            icon: notificationsIcon
            text: Notifications

To send notifications, you can setup external service https://backstage.io/docs/auth/service-to-service-auth/#static-keys-for-plugin-to-plugin-auth like this:

backend:
  auth:
    externalAccess:
      - type: static
        options:
          token: ${EXTERNAL_SERVICE_TOKEN}
          subject: cicd-system-completion-events

(Make sure this is auth under backend and not the top level auth key)
Then you can use this to send notifications:

curl -X POST http://localhost:7007/api/notifications -H "Content-Type: application/json" -H "Authorization: Bearer ${EXTERNAL_SERVICE_TOKEN}" -d '{"recipients":{"type":"broadcast"},"payload": {"title": "Title of boradcast message","link": "http://foo.com/bar","severity": "high","topic": "The topic"}}'

Screen recording(uploaded Feb 7):

rhidp_5252_final.mp4

@ciiay ciiay requested review from debsmita1 and removed request for dzemanov January 27, 2025 21:02
Copy link
Contributor

@ciiay
Copy link
Contributor Author

ciiay commented Jan 28, 2025

/test e2e-tests

@ciiay ciiay force-pushed the rhidp-5252-add-default-header-components branch from 3c47b55 to bd34619 Compare January 28, 2025 18:18
Copy link
Contributor

@ciiay ciiay force-pushed the rhidp-5252-add-default-header-components branch 2 times, most recently from f54e4ea to b6c9481 Compare January 29, 2025 06:33
Copy link
Contributor

@ciiay ciiay force-pushed the rhidp-5252-add-default-header-components branch from 174e308 to 9439980 Compare January 29, 2025 14:22
Copy link
Contributor

Copy link
Contributor

Copy link
Contributor

Copy link
Member

@christoph-jerolimov christoph-jerolimov left a comment

Choose a reason for hiding this comment

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

Small change request

@ciiay ciiay force-pushed the rhidp-5252-add-default-header-components branch from 1e35b77 to 0bc2227 Compare January 31, 2025 21:17
Copy link
Contributor

Copy link
Member

@christoph-jerolimov christoph-jerolimov left a comment

Choose a reason for hiding this comment

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

The plugin doesn't define this components yet, so this code couldn't be found.

As discussed in Slack. You must update the plugin to the latest release as well.

I share this here so that others see that this PR is on hold until the plugin is updated. :)

@ciiay ciiay marked this pull request as ready for review February 5, 2025 04:55
@openshift-ci openshift-ci bot requested a review from dzemanov February 5, 2025 04:55
Copy link
Contributor

github-actions bot commented Feb 5, 2025

@ciiay ciiay force-pushed the rhidp-5252-add-default-header-components branch from e10a187 to 5413289 Compare February 5, 2025 14:36
Copy link
Contributor

github-actions bot commented Feb 5, 2025

@ciiay ciiay force-pushed the rhidp-5252-add-default-header-components branch from 5b09355 to 703c7a7 Compare February 5, 2025 15:28
Copy link
Contributor

github-actions bot commented Feb 5, 2025

@ciiay ciiay force-pushed the rhidp-5252-add-default-header-components branch from 703c7a7 to 14938b7 Compare February 7, 2025 15:27
Copy link

openshift-ci bot commented Feb 7, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign pataknight for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

github-actions bot commented Feb 7, 2025

@its-mitesh-kumar
Copy link

@ciiay , there is no clear line outline for the search box is this okay ?
Screenshot 2025-02-11 at 12 41 02 AM

@its-mitesh-kumar
Copy link

@ciiay Tested on cluster Search , Create , Support , Profile .
Search , Create => Seems working as per expected ,
while Support is not redirecting anywhere
and Profile is showing Guest user while I am logged through my Github .
I am attaching screen recording for the same

Screen.Recording.2025-02-11.at.1.32.55.AM.mov

@ciiay
Copy link
Contributor Author

ciiay commented Feb 11, 2025

@ciiay Tested on cluster Search , Create , Support , Profile . Search , Create => Seems working as per expected , while Support is not redirecting anywhere and Profile is showing Guest user while I am logged through my Github . I am attaching screen recording for the same

Screen.Recording.2025-02-11.at.1.32.55.AM.mov

Hi @its-mitesh-kumar , thanks for the review. This has to be tested with rhdh-plugins PR, not ready for testing on a cluster until the rhdh-plugins PR gets in and the new version is out and available.

@ciiay
Copy link
Contributor Author

ciiay commented Feb 11, 2025

@ciiay , there is no clear line outline for the search box is this okay ?

Hi @its-mitesh-kumar , this UI aligns up with the Figma design.

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.

5 participants