mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-07-29 15:55:47 -05:00
webui: layer for standalone pages which use WebUI framework
Current compiled Web UI layer (app.js) contains every FreeIPA plugin and not just the UI framework. It's not possible to start just a simple facet. This commit creates a basis for a layer (core.js) which contains only framework code and not entity related code. Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
This commit is contained in:
@@ -714,6 +714,7 @@ fi
|
||||
%{_usr}/share/ipa/ui/js/libs/*.js
|
||||
%dir %{_usr}/share/ipa/ui/js/freeipa
|
||||
%{_usr}/share/ipa/ui/js/freeipa/app.js
|
||||
%{_usr}/share/ipa/ui/js/freeipa/core.js
|
||||
%dir %{_usr}/share/ipa/ui/js/plugins
|
||||
%dir %{_usr}/share/ipa/ui/images
|
||||
%{_usr}/share/ipa/ui/images/*.jpg
|
||||
|
||||
@@ -3,6 +3,7 @@ NULL =
|
||||
appdir = $(IPA_DATA_DIR)/ui/js/freeipa
|
||||
app_DATA = \
|
||||
app.js \
|
||||
core.js \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DIST = \
|
||||
|
||||
@@ -24,9 +24,10 @@ define([
|
||||
'dojo/when',
|
||||
'./plugin_loader',
|
||||
'./phases',
|
||||
'./reg',
|
||||
'./Application_controller',
|
||||
'exports'
|
||||
],function(lang, Deferred, when, plugin_loader, phases, Application_controller, app) {
|
||||
],function(lang, Deferred, when, plugin_loader, phases, reg, Application_controller, app) {
|
||||
|
||||
/**
|
||||
* Application wrapper
|
||||
@@ -84,11 +85,39 @@ define([
|
||||
}));
|
||||
},
|
||||
|
||||
simple_mode_phases: function() {
|
||||
|
||||
phases.on('init', lang.hitch(this, function() {
|
||||
var app = this.app = new this.App_class();
|
||||
app.init();
|
||||
return app;
|
||||
}));
|
||||
|
||||
phases.on('runtime', lang.hitch(this, function() {
|
||||
var d = new Deferred();
|
||||
var facet = reg.facet.get(this.target_facet);
|
||||
if (!facet) {
|
||||
window.console.error('Target facet not found: '+this.target_facet);
|
||||
} else {
|
||||
this.app.show_facet(facet);
|
||||
}
|
||||
return d.promise;
|
||||
}));
|
||||
},
|
||||
|
||||
run: function() {
|
||||
when(plugin_loader.load_plugins(), lang.hitch(this, function() {
|
||||
this.register_phases();
|
||||
phases.controller.run();
|
||||
}));
|
||||
},
|
||||
|
||||
run_simple: function(facet) {
|
||||
this.target_facet = facet;
|
||||
when(plugin_loader.load_plugins(), lang.hitch(this, function() {
|
||||
this.simple_mode_phases();
|
||||
phases.controller.run();
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/* Authors:
|
||||
* Petr Vobornik <pvoborni@redhat.com>
|
||||
*
|
||||
* Copyright (C) 2012 Red Hat
|
||||
* see file 'COPYING' for use and warranty information
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
define([
|
||||
'./app_container',
|
||||
'./plugins/sync_otp',
|
||||
'./plugins/login'
|
||||
],function(app_container) {
|
||||
return app_container;
|
||||
});
|
||||
@@ -32,6 +32,7 @@ define(['dojo/_base/array',
|
||||
'dojo/topic',
|
||||
'./builder',
|
||||
'./datetime',
|
||||
'./entity',
|
||||
'./ipa',
|
||||
'./jquery',
|
||||
'./navigation',
|
||||
@@ -39,10 +40,11 @@ define(['dojo/_base/array',
|
||||
'./reg',
|
||||
'./rpc',
|
||||
'./text',
|
||||
'./util'
|
||||
'./util',
|
||||
'exports'
|
||||
],
|
||||
function(array, lang, Evented, has, keys, on, string, topic, builder,
|
||||
datetime, IPA, $, navigation, phases, reg, rpc, text, util) {
|
||||
datetime, entity_mod, IPA, $, navigation, phases, reg, rpc, text, util, exp) {
|
||||
|
||||
/**
|
||||
* Widget module
|
||||
@@ -54,7 +56,6 @@ define(['dojo/_base/array',
|
||||
* @class widget
|
||||
* @singleton
|
||||
*/
|
||||
var exp = {};
|
||||
|
||||
/**
|
||||
* Width of column which contains only checkbox
|
||||
|
||||
@@ -114,6 +114,9 @@ var profile = (function(){
|
||||
],
|
||||
|
||||
layers: {
|
||||
"freeipa/core": {
|
||||
include: ["freeipa/core"]
|
||||
},
|
||||
"freeipa/app": {
|
||||
include: ["freeipa/app", "freeipa/extend"]
|
||||
}
|
||||
|
||||
@@ -106,15 +106,3 @@ fi
|
||||
|
||||
# compile using uglify.js
|
||||
$DIR/uglifyjs/uglify $RDIR/$RELEASE/$LAYER.js $OUTPUT_FILE
|
||||
|
||||
# clean all other files
|
||||
BUILD_DIR=$RDIR/$RELEASE/`echo $LAYER | cut -d/ -f 1`
|
||||
LAYER_FILE=`echo $LAYER | cut -d/ -f 2`.js
|
||||
rm -f $RDIR/$RELEASE/build-report.txt
|
||||
pushd $BUILD_DIR
|
||||
if [[ $? != 0 ]] ; then
|
||||
echo "Invalid build dir: $BUILD_DIR"
|
||||
exit 1
|
||||
fi
|
||||
ls -1 | grep -v -e "^$LAYER_FILE$" | xargs rm -rf
|
||||
popd
|
||||
@@ -31,5 +31,6 @@ fi
|
||||
$DIR/clean.sh
|
||||
$DIR/build.sh webui
|
||||
# don't stop at error. Some dependency errors are expected.
|
||||
$DIR/compile.sh --release lib --layer freeipa/core --output $IPA_DIR/core.js
|
||||
$DIR/compile.sh --release lib --layer freeipa/app --output $IPA_DIR/app.js
|
||||
$DIR/clean.sh
|
||||
Reference in New Issue
Block a user