Skip to content
This repository was archived by the owner on Nov 23, 2026. It is now read-only.
This repository was archived by the owner on Nov 23, 2026. It is now read-only.

[Epic] different and well defined extension points of phoenix #2573

Closed

Description

@DeepDiver1975

Goal

This shall be an explicit list of well defined extension points for phoenix and related system.
Each extension point will be properly and explicitly documented in here

Assumptions

Each app is implemented as it's own single page application and is reachable on the same domain in a subfolder (alternative might be to use sub domains - needs clarifications)

Application Menu

Every Phoenix application will provide an application menu which will list applications the user can switch to. Any new app shall be opened in it's own tab.

The configuration of the application menu will be loaded from an backend url (static file or served by a service). The configuration will be a list of menu items with these attributes:

  • icon: a path to an icon - hosted by the backend
  • uri: an url which points to the application - will be opened in a new tab
  • title: the name of the app which is displayed in the menu. This can either be a simple string or a map of language code to the translated application name

Example

{
    "applications": [
        {
            "icon": "/files/files.svg",
            "url": "/files",
            "title": {
                "en": "Files",
                "de": "Dateien"
            }
        },
        {
            "icon": "/documents/office.svg",
            "url": "/documents",
            "title": "Awesome Office™"
        }
    ]
}

Files: Adding file actions

The Phoenix files app can be extended to add file actions for various file types to allow opening a file in a specific application. Basically a give url will be opened in a tab on it's own and information about the file will be passed in the url. A list of url placeholders will be defined ...

The configuration of file actions is a list of file action elements with these attributes:

  • icon: an icon to be displayed on the file action menu - shall be an svg - further criteria to be defined (like the ability to set the color from outside)
  • url: the url to be called with placeholder which are going to be replaced by the files app
  • title: like in the application menu either simple string or a map of language to the translated name
  • fileExtensions: a list of file extensions which the application can handle

Example

    "filesActions": [
        {
            "icon": "/documents/office.svg",
            "url": "/documents/edit/{PATH}",
            "title": {
                "en": "Edit in Awesome Office™",
                "de": "Mit Awesome Office™ bearbeiten"
            },
            "fileExtensions": [
                "docx",
                "ods"
            ]
        }
    ]

Files: Sidebar Integration

Any app shall be capable to inject itself into the sidebar and be allowed to display information related to the currently selected file (any maybe load additional information for the current file) and to manipulate.

At the end we need a configuration entry here as well holding information about these attributes:

  • title: title in the sidebar tab - shall be translated
  • componentUrl: the location from where to load the component (CSP and CORS need to be properly setup on the hosting domain)
  • componentName: name of the component being the tag name

Example

  "files": {
    "sidebars": [
      {
          "title": {
                "en": "Webkomponenten-Demo I",
                "de": "Web Component Demo I"
            },
        "componentName": "my-custom-element",
        "componentUrl": "external/dist/my-custom-element.js"
      },

Activity

  1. DeepDiver1975 commented on Nov 27, 2019

    @DeepDiver1975
    ContributorAuthor

    Files: Sidebar Integration

    construction

    Prototype is in #2584

  2. DeepDiver1975 commented on Nov 27, 2019

    @DeepDiver1975
    ContributorAuthor
    * mime-types: a list of mime types which the application can handle
    

    or file extensions - this is what phoenix uses as of today

  3. changed the title [-][Vision/Proposal] different and well defined extension points of phoenix[/-] [+][Epic] different and well defined extension points of phoenix[/+] on Dec 9, 2019
  4. PVince81 commented on Dec 9, 2019

    @PVince81
    Contributor

    Next up:

    • document guidelines for how apps should provide extension points
      • scope, encapsulation, techniques (web component), etc
    • document guidelines about writing frontend extensions for the phoenix-files app
  5. PVince81 commented on Dec 11, 2019

    @PVince81
    Contributor
    • research how to translate with transifex the texts from the config
  6. DeepDiver1975 commented on Dec 18, 2019

    @DeepDiver1975
    ContributorAuthor
    * research how to translate with transifex the texts from the config
    

    there is no file format which can be used out of the box - https://docs.transifex.com/formats/introduction
    We can either build something (export/import & convert to one of the supported formats) or we maintain the individual translations directly in git in the sample or dist config file.

  7. LukasHirt commented on Jan 31, 2020

    @LukasHirt
    Collaborator

    Thinking now about another extension point. Fire up events when uploading a resource (on start and on end) and expose it so extensions can react to that. Any thoughts on this?

  8. DeepDiver1975 commented on Apr 23, 2020

    @DeepDiver1975
    ContributorAuthor

    implemented as far as I can tell -> close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions