•  
      request #23465 Publish a project sidebar custom element
    Infos
    #23465
    Thomas Gerbet (tgerbet)
    2022-02-03 13:07
    2021-10-26 10:45
    25017
    Details
    Publish a project sidebar custom element

    Having a way to use the project sidebar outside of Tuleap itself would help the integration with third party tools.

    The idea is to maintain the component inside the Tuleap codebase so it can be close to the actual look & feel of the sidebars and get additional features over time.

    The project sidebar component needs to embed every assets it needs and take the rest as an input. The usage will look like something like this:

        <project-sidebar config='{...}'></project-sidebar>
        <script src="/path/to/sidebar.js"></script>
        <style>
            /* Not forced by the implementation, requirements might be different in your context */
            project-sidebar {
                position: fixed;
                top: 0;
                left: 0;
            }
        </style>
    

    While it is not really a "best practice" from a custom element PoV, our best bet is probably to pass the config of the sidebar as a JSON object. We do not expect it to change once the component is initialized and given the large amount of data we might need to give to the component more traditional approach are probably not suitable here.

    The custom element will be published to the npmjs.com registry so it can be easily consumed by third parties.

    Technical implementation details:

    • The element will be an Vue 3 app in TS build as a custom element, see https://v3.vuejs.org/guide/web-components.html#building-custom-elements-with-vue
    • All the styles needs to be embedded and loaded by the element itself, care must be taken to not conflict with other style on the page
    • To ease the usage by third parties, the package should not require an additional build process to be used (i.e. the published bundle should be directly usable)
    • Interactions requiring changes outside the sidebar itself should throw custom events to let the third party integrate them in the best possible way (e.g. opening the project banner)
    • A strategy needs to be elaborated to publish the package, we will probably needs to have specific tags in addition to the ones used to publish main Tuleap versions
    Other
    Empty
    Empty
    • [ ] enhancement
    • [x] internal improvement
    Empty
    Stage
    Empty
    Closed
    2022-01-19
    Attachments
    Empty
    References
    Referencing request #23465

    Git commit

    tuleap/tuleap/stable

    Init Project Sidebar custom element 6c0bc5eebd
    Display the project name in the project sidebar custom element 89dd3367a4
    CSS builds with Vite goes through PostCSS Autoprefixer plugin 20ab68f82f
    Enable ESLint Vue 3 recommended rules 0874fe1192
    Display Tuleap and version information in sidebar footer 955aa01b09
    Display copyright notice (if present) in the sidebar footer c35faeb467
    Use the same example base config in the demo page and in the tests 882ea9647d
    Provide the sidebar configuration globally d05ad91dc8
    Display tools in the project sidebar c5dcfddbf5
    Display the icons associated with each tool in the project sidebar 2b21413cff
    Display project privacy badge in the sidebar component 07a2ed7f64
    Sidebar component configuration should be reactive 12519cfd18
    Fix the build of project sidebar component on clean sources 2c95c74902
    Fix homepage link of the @tuleap/project-sidebar component 01851616a1
    Display SVG based instance logo in the sidebar 37338bef28
    Use vite/client types instead of defining on our own shims a8c41eea0e
    Display legacy PNG logo in the sidebar f26520e19e
    Add project icon and administration link to the project sidebar 9f60fef86c
    Do not rebuild @tuleap/tlp-popovers in @tuleap/project-sidebar 5056a8e06c
    Add project flags to the project sidebar component 00632e45b4
    Add button to display the project announcement a77bb15664
    Explicit dependency to the package providing the getProjectPrivacyIcon function f9ac462d57
    Drop forgotten console.log in v-on 4efb4e655c
    Drop /account/update-sidebar-preference.php in favor of the REST API cfdc6ff2e2
    Sidebar component can be collapsed 717a9b067d
    Display linked projects in the project sidebar component f6587de08b
    Shortcuts can be used with the sidebar component 30aae24b38
    Set the rules for the publication process of a JS package 92b4351e6f
    Document how to use the sidebar component 20c8b23ac2
    Explicit PHP unit tests coverage under the src/ folder bb778994d4
    Drop indirect dependency to sprintf-js in the project sidebar component 2d9e3a1991
    Introduce @tuleap/project-sidebar-internal c08e739743
    Setup publication pipeline and prepare @tuleap/project-sidebar 1.0.0 9b5c47e77a
    Update publication process of JS libraries cb5a31bfe8
    Fix JS librairies publication pipeline and links of the project-sidebar element on npmjs.com 757d702c26
    Mention that the project sidebar elements also needs a stylesheet with the Tuleap CSS vars 1cef6b0761
    Make possible to remove the collapse button of the project sidebar component 15679b1267
    Fix the package build e825df7f1e
    Handle build process during the RPM creation via Turborepo 68088616bc
    Handle build process during the RPM creation via Turborepo 118772ee94
    Handle build process during the RPM creation via Turborepo eadd95d03b
    Handle build process during the RPM creation via Turborepo 9dc37c216c

    Follow-ups

    User avatar
    Thomas Gerbet (tgerbet)2021-12-15 16:52
    • Original Submission
      Something went wrong, the follow up content couldn't be loaded
      Only formatting have been changed, you should switch to markup to see the changes