From 89be148580169d9a8dbafa8a72f8c23034e3b601 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Tue, 14 May 2013 19:21:02 +0200 Subject: Web UI: move ./_base/metadata_provider.js to ./metadata.js Metadata provider is IPA specific object, not a framework object, so it should not be in _base directory. https://fedorahosted.org/freeipa/ticket/3604 --- install/ui/src/freeipa/_base/metadata_provider.js | 62 --------------------- install/ui/src/freeipa/aci.js | 2 +- install/ui/src/freeipa/association.js | 2 +- install/ui/src/freeipa/automember.js | 2 +- install/ui/src/freeipa/certificate.js | 2 +- install/ui/src/freeipa/entity.js | 2 +- install/ui/src/freeipa/field.js | 2 +- install/ui/src/freeipa/hbactest.js | 2 +- install/ui/src/freeipa/ipa.js | 2 +- install/ui/src/freeipa/metadata.js | 65 +++++++++++++++++++++++ install/ui/src/freeipa/text.js | 2 +- install/ui/test/aci_tests.js | 2 +- install/ui/test/details_tests.js | 2 +- 13 files changed, 76 insertions(+), 73 deletions(-) delete mode 100644 install/ui/src/freeipa/_base/metadata_provider.js create mode 100644 install/ui/src/freeipa/metadata.js diff --git a/install/ui/src/freeipa/_base/metadata_provider.js b/install/ui/src/freeipa/_base/metadata_provider.js deleted file mode 100644 index 9a332b556..000000000 --- a/install/ui/src/freeipa/_base/metadata_provider.js +++ /dev/null @@ -1,62 +0,0 @@ -/* Authors: - * Petr Vobornik - * - * Copyright (C) 2013 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 . -*/ - -define(['dojo/_base/lang', './Provider', './Search_provider'], - function(lang, Provider, Search_provider) { - - var metadata = new Provider({ - code: '@m:' - }); - var objects = new Provider({ - code: '@mo:', - source: metadata, - path: 'objects' - }); - var commmads = new Provider({ - code: '@mc:', - source: metadata, - path: 'commands' - }); - var object_param = new Search_provider({ - code: '@mo-param:', - source: metadata, - path: 'objects', - base_query: '%1.takes_params', - array_attr: 'name' - }); - var cmd_arg = new Search_provider({ - code: '@mc-arg:', - source: metadata, - path: 'commands', - base_query: '%1.takes_args', - array_attr: 'name' - }); - var cmd_option = new Search_provider({ - code: '@mc-opt:', - source: metadata, - path: 'commands', - base_query: '%1.takes_options', - array_attr: 'name' - }); - - metadata.providers.push(objects, commmads, object_param, cmd_arg, cmd_option); - - return metadata; -}); \ No newline at end of file diff --git a/install/ui/src/freeipa/aci.js b/install/ui/src/freeipa/aci.js index 20acca20e..aa28d7218 100644 --- a/install/ui/src/freeipa/aci.js +++ b/install/ui/src/freeipa/aci.js @@ -20,7 +20,7 @@ */ define([ - './_base/metadata_provider', + './metadata', './ipa', './jquery', './phases', diff --git a/install/ui/src/freeipa/association.js b/install/ui/src/freeipa/association.js index e2ddaf866..15e164963 100644 --- a/install/ui/src/freeipa/association.js +++ b/install/ui/src/freeipa/association.js @@ -24,7 +24,7 @@ define([ 'dojo/Deferred', - './_base/metadata_provider', + './metadata', './ipa', './jquery', './navigation', diff --git a/install/ui/src/freeipa/automember.js b/install/ui/src/freeipa/automember.js index 36793f303..f8083b89e 100644 --- a/install/ui/src/freeipa/automember.js +++ b/install/ui/src/freeipa/automember.js @@ -19,7 +19,7 @@ */ define([ - './_base/metadata_provider', + './metadata', './ipa', './jquery', './navigation', diff --git a/install/ui/src/freeipa/certificate.js b/install/ui/src/freeipa/certificate.js index e53b6ef6d..897939087 100755 --- a/install/ui/src/freeipa/certificate.js +++ b/install/ui/src/freeipa/certificate.js @@ -21,7 +21,7 @@ define([ 'dojo/_base/lang', - './_base/metadata_provider', + './metadata', './ipa', './jquery', './menu', diff --git a/install/ui/src/freeipa/entity.js b/install/ui/src/freeipa/entity.js index 0d0564d1d..1896f9077 100644 --- a/install/ui/src/freeipa/entity.js +++ b/install/ui/src/freeipa/entity.js @@ -23,7 +23,7 @@ define([ 'dojo/_base/lang', - './_base/metadata_provider', + './metadata', './_base/Singleton_registry', './builder', './ipa', diff --git a/install/ui/src/freeipa/field.js b/install/ui/src/freeipa/field.js index 17f440aba..087f6e289 100644 --- a/install/ui/src/freeipa/field.js +++ b/install/ui/src/freeipa/field.js @@ -25,7 +25,7 @@ define([ 'dojo/_base/array', 'dojo/_base/lang', - './_base/metadata_provider', + './metadata', './builder', './ipa', './jquery', diff --git a/install/ui/src/freeipa/hbactest.js b/install/ui/src/freeipa/hbactest.js index 4eefe5635..c5189f9b3 100644 --- a/install/ui/src/freeipa/hbactest.js +++ b/install/ui/src/freeipa/hbactest.js @@ -19,7 +19,7 @@ */ define([ - './_base/metadata_provider', + './metadata', './ipa', './jquery', './navigation', diff --git a/install/ui/src/freeipa/ipa.js b/install/ui/src/freeipa/ipa.js index 69d375a4b..441a9052e 100644 --- a/install/ui/src/freeipa/ipa.js +++ b/install/ui/src/freeipa/ipa.js @@ -25,7 +25,7 @@ define(['./jquery', './json2', './_base/i18n', - './_base/metadata_provider', + './metadata', './builder', './reg', './text'], diff --git a/install/ui/src/freeipa/metadata.js b/install/ui/src/freeipa/metadata.js new file mode 100644 index 000000000..d33d3ae8f --- /dev/null +++ b/install/ui/src/freeipa/metadata.js @@ -0,0 +1,65 @@ +/* Authors: + * Petr Vobornik + * + * Copyright (C) 2013 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 . +*/ + +define([ + 'dojo/_base/lang', + './_base/Provider', + './_base/Search_provider' + ], function(lang, Provider, Search_provider) { + + var metadata = new Provider({ + code: '@m:' + }); + var objects = new Provider({ + code: '@mo:', + source: metadata, + path: 'objects' + }); + var commands = new Provider({ + code: '@mc:', + source: metadata, + path: 'commands' + }); + var object_param = new Search_provider({ + code: '@mo-param:', + source: metadata, + path: 'objects', + base_query: '%1.takes_params', + array_attr: 'name' + }); + var cmd_arg = new Search_provider({ + code: '@mc-arg:', + source: metadata, + path: 'commands', + base_query: '%1.takes_args', + array_attr: 'name' + }); + var cmd_option = new Search_provider({ + code: '@mc-opt:', + source: metadata, + path: 'commands', + base_query: '%1.takes_options', + array_attr: 'name' + }); + + metadata.providers.push(objects, commands, object_param, cmd_arg, cmd_option); + + return metadata; +}); \ No newline at end of file diff --git a/install/ui/src/freeipa/text.js b/install/ui/src/freeipa/text.js index 1e5b0e591..a439237ae 100644 --- a/install/ui/src/freeipa/text.js +++ b/install/ui/src/freeipa/text.js @@ -24,7 +24,7 @@ * Serves for returning labels, titles, messages from various providers. * Other providers can extends functionality. */ -define(['./_base/Provider', './_base/i18n', './_base/metadata_provider'], +define(['./_base/Provider', './_base/i18n', './metadata'], function(Provider, i18n, metadata) { var text = new Provider({ diff --git a/install/ui/test/aci_tests.js b/install/ui/test/aci_tests.js index a819d3f14..b0464e7fd 100644 --- a/install/ui/test/aci_tests.js +++ b/install/ui/test/aci_tests.js @@ -19,7 +19,7 @@ */ define([ - 'freeipa/_base/metadata_provider', + 'freeipa/metadata', 'freeipa/aci', 'freeipa/details', 'freeipa/facet', diff --git a/install/ui/test/details_tests.js b/install/ui/test/details_tests.js index 26bc4fb66..85fb270fd 100644 --- a/install/ui/test/details_tests.js +++ b/install/ui/test/details_tests.js @@ -19,7 +19,7 @@ */ define([ - 'freeipa/_base/metadata_provider', + 'freeipa/metadata', 'freeipa/ipa', 'freeipa/jquery', 'freeipa/details', -- cgit