Announcement

Collapse
No announcement yet.

Getting app to show in top bar on login

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Getting app to show in top bar on login

    Hello,

    I am writing an app for OX App Suite which I have managed to get to show in the top bar menu on login by adding it to the array allFavorites in io.ox/core/api/apps.js as such (Note the TODO comment as well):

    Code:
    // TODO: Make favorites dynamic
    var allFavorites = ['io.ox/portal', 'io.ox/mail', 'io.ox/contacts',
                        'io.ox/calendar', 'io.ox/tasks', 'io.ox/files', 'com.example/myapp'];
    I'm assuming this isn't the way this is supposed to be done in a finished product. Is there any better way as it stands to get my app into that menu as a placeholder launcher on login? Am I approaching this the wrong way?

  • #2
    Your assumption is correct, editing core files is never the solution.

    Until that TODO is fixed, you can try the following:

    Code:
    new Stage('io.ox/core/stages', {
        id: 'com.example.yourapp', // something unique
        index: 800,
        run: function () {
            ox.ui.apps.add(
                new ox.ui.AppPlaceholder({
                    id: 'com.example/yourapp', // will be passed to ox.launch() on click
                    title: gt('Your App')
                })
            );
        }
    });

    Comment


    • #3
      That worked - thank you very much! I'll use it as a temporary solution, then.

      Comment


      • #4
        This stopped working the last time I did a Git pull. The dependency "io.ox/core/extPatterns/stage" seems to cause an error which bounces me back to the login page. The console reads "Could not load theme: default". I'm doing this in a plugin at the "core" namespace - I'm thinking this might be the problem, that maybe it's no longer possible to load this dependency at that point, but I'm not sure what would be a better point to add in the menu item.

        I seem to be able to add in my menu item by adding the AppPlaceHolder in an extension point (io.ox/core/topbar/favorites), but this also feels like a somewhat hacky way to do it. Any thoughts?

        Comment


        • #5
          Are you sure it's that dependency which causes the problem? The file hasn't changed for a while.
          "Could not load theme: default" sounds like some files are missing.
          Did you pull the master branch? Since the recent release of 7.6.0, you will have to migrate your plugin: http://oxpedia.org/wiki/index.php?ti...e_app_using_yo

          Comment


          • #6
            Sorry I haven't updated this. The issue was with the grunt config - as noted on this page: https://github.com/Open-Xchange-Fron...d-grunt-config

            I had misunderstood the role of the coreDir setting, which needs to point to the build directory of a distributed version of the UI, ie. one where base apps and themes are present.

            Thanks for your reply.

            Comment

            Working...
            X