Giter Club home page Giter Club logo

Comments (12)

m-rau avatar m-rau commented on August 19, 2024

Suggested solution is to reuse existing components:

custom content implementation

Custom content is to be implemented as a simple endpoint delivering static content.

Definition of a static file handler, e.g. from core4/api/v1/request/_content with a file about.html in this folder. The following static file handler will deliver all files out of this folder, e.g. http://domain/core4/api/v1/content/about.html

        (r'/content', CoreStaticFileHandler, {
            "path": "/api/v1/request/request/_content",
            "static_path": "/api/v1/request(_content",
            "title": "core4os static content", "protected": True
        })

define custom menu

The mapping of menu items to endpoint is to be specified in core4.yaml. This solution allows to customise the deployment by setting a custom core4os configuration, e.g. at /etc/core4/local.yaml.

The custom menu configuration is to be delivered to the FE. Suggestion is to use the existing /setting endpoint. This requires the mapping between menu items and endpoint as in the following example (see core4.yaml):

user_setting:
   _general:
     language: EN
     menu:
       About this App Manager: /home4/api/v1/about
       Imprint: /home4/api/v1/imprint
       Privacy Protection: /home4/api/v1/privacy

To access the custom configuration the FE addresses ``http://domain/core4/api/v1/setting/_general/menu

from core4.

marekmru avatar marekmru commented on August 19, 2024

From my point of view this is fine. It is extensible and covers the need for additional items. @m-rau

from core4.

m-rau avatar m-rau commented on August 19, 2024

please watch this: modification of the default user settings requires an update in current regression tests. To be more specific: to make tests successful, the (default) navigation must be included into the expected results. For example tests/api/test_setting.py::test_default_settings_override

from core4.

marekmru avatar marekmru commented on August 19, 2024

Resolved in #73:

  • Addedd an about widget
  • About widget is referenced in core4.yaml
  • should be returned by the settings api
  • is rendered in core4ui / webapps (remove node_modules, yarn.lock and do a 'yarn install')

#73

from core4.

m-rau avatar m-rau commented on August 19, 2024

I will merge and test. Need to consider #81

from core4.

m-rau avatar m-rau commented on August 19, 2024

merged and tested. The following issues have been identified:

  1. #81 is rejected. Refactoring the navigation configuration from dict to list is the solution

  2. bug identified: the custom link is not working. It seems that rather the key than the value is populated as the link (About instead of /about).

from core4.

m-rau avatar m-rau commented on August 19, 2024

assigned to @marekmru for fixing and refactoring

from core4.

marekmru avatar marekmru commented on August 19, 2024

No this is just the internal mapping. What happens on the page is:

const path = (this.menu.find(val => val.label === type) || {}).path

soo there is a lookup on the path for the iframe

from core4.

m-rau avatar m-rau commented on August 19, 2024

I will retest when the current pull requests are merged into develop and ready for testing

from core4.

m-rau avatar m-rau commented on August 19, 2024

Is working. Ticket closed.

from core4.

m-rau avatar m-rau commented on August 19, 2024

I was testing the wrong version. Latest version in branch develop is not working.
@marekmru: please check! The settings variable menu is now a list. This requires an update in the FE as expected.

from core4.

m-rau avatar m-rau commented on August 19, 2024

Furthermore: please remove the Profile link from the default menu. The only default item now is Logout.

from core4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.