summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2013-03-14 14:26:14 +0100
committerPetr Vobornik <pvoborni@redhat.com>2013-05-06 16:22:19 +0200
commit3e392bbfc66e10349b3205d25039a6619a64a29d (patch)
tree0553314dd841e4a1b96d2c1fee2d67ce6b5a53df
parent166102a910bad2002819205b009694372f1f0e22 (diff)
downloadfreeipa-3e392bbfc66e10349b3205d25039a6619a64a29d.tar.gz
freeipa-3e392bbfc66e10349b3205d25039a6619a64a29d.tar.xz
freeipa-3e392bbfc66e10349b3205d25039a6619a64a29d.zip
get_primary_key function usages removed
https://fedorahosted.org/freeipa/ticket/3236
-rw-r--r--install/ui/src/freeipa/details.js17
-rw-r--r--install/ui/src/freeipa/dns.js4
-rw-r--r--install/ui/src/freeipa/entity.js14
-rw-r--r--install/ui/src/freeipa/field.js4
-rw-r--r--install/ui/src/freeipa/host.js6
-rw-r--r--install/ui/src/freeipa/rule.js2
-rw-r--r--install/ui/src/freeipa/sudo.js2
7 files changed, 12 insertions, 37 deletions
diff --git a/install/ui/src/freeipa/details.js b/install/ui/src/freeipa/details.js
index aa36b5fbc..bf8ec9d97 100644
--- a/install/ui/src/freeipa/details.js
+++ b/install/ui/src/freeipa/details.js
@@ -291,16 +291,6 @@ IPA.details_facet = function(spec, no_init) {
that.dirty = false;
that.dirty_changed = IPA.observer();
- /* the primary key used for show and update is built as an array.
- for most entities, this will be a single element long, but for some
- it requires the containing entities primary keys as well.*/
- //FIXME: obsolete this stuff
- that.get_primary_key = function(from_url) {
-
- var pkeys = that.get_pkeys();
- return pkeys;
- };
-
that.create = function(container) {
if (that.entity.facets.length == 1) {
if (that.disable_breadcrumb === undefined) {
@@ -481,8 +471,7 @@ IPA.details_facet = function(spec, no_init) {
that.nofify_update_success = function() {
var msg = IPA.messages.details.updated;
- var key = that.get_primary_key();
- key = key[key.length -1] || '';
+ var key = that.get_pkey();
msg = msg.replace('${entity}', that.entity.metadata.label_singular);
msg = msg.replace('${primary_key}', key);
IPA.notify_success(msg);
@@ -513,7 +502,7 @@ IPA.details_facet = function(spec, no_init) {
that.create_fields_update_command = function(update_info) {
- var args = that.get_primary_key();
+ var args = that.get_pkeys();
var options = { all: true };
if (that.check_rights) options.rights = true;
@@ -619,7 +608,7 @@ IPA.details_facet = function(spec, no_init) {
});
if (that.get_pkey()) {
- command.args = that.get_primary_key(true);
+ command.args = that.get_pkeys();
}
return command;
diff --git a/install/ui/src/freeipa/dns.js b/install/ui/src/freeipa/dns.js
index 8d6f96fa3..8131e14f5 100644
--- a/install/ui/src/freeipa/dns.js
+++ b/install/ui/src/freeipa/dns.js
@@ -1449,8 +1449,8 @@ IPA.dns.record_prepare_details_for_type = function(type, fields, container) {
IPA.dnsrecord_host_link_field = function(spec) {
var that = IPA.link_field(spec);
that.other_pkeys = function() {
- var pkey = that.entity.get_primary_key();
- return [pkey[0]+'.'+pkey[1]];
+ var pkey = that.facet.get_pkeys();
+ return [pkey[1]+'.'+pkey[0]];
};
return that;
};
diff --git a/install/ui/src/freeipa/entity.js b/install/ui/src/freeipa/entity.js
index ee5cbdfd9..36fadf1ce 100644
--- a/install/ui/src/freeipa/entity.js
+++ b/install/ui/src/freeipa/entity.js
@@ -163,20 +163,6 @@ IPA.entity = function(spec) {
return that;
};
- that.get_primary_key_prefix = function(facet) {
- window.console.log('Obsolete function usage: entity.get_primary_key_prefix');
- var prefix = that.get_primary_key(facet);
- prefix.pop();
- return prefix;
- };
-
- that.get_primary_key = function(facet) {
- window.console.log('Obsolete function usage: entity.get_primary_key');
- facet = facet || that.facet;
- var pkeys = facet.get_pkeys();
- return pkeys;
- };
-
that.entity_init = that.init;
return that;
diff --git a/install/ui/src/freeipa/field.js b/install/ui/src/freeipa/field.js
index 14aae65ec..2f0912d27 100644
--- a/install/ui/src/freeipa/field.js
+++ b/install/ui/src/freeipa/field.js
@@ -732,7 +732,7 @@ IPA.link_field = function(spec) {
that.other_entity = IPA.get_entity(spec.other_entity);
function other_pkeys () {
- return that.entity.get_primary_key();
+ return that.facet.get_pkeys();
}
that.other_pkeys = spec.other_pkeys || other_pkeys;
@@ -810,7 +810,7 @@ IPA.enable_field = function(spec) {
var command = IPA.command({
entity: that.entity.name,
method: method,
- args: that.entity.get_primary_key(),
+ args: that.facet.get_pkeys(),
options: {all: true, rights: true}
});
diff --git a/install/ui/src/freeipa/host.js b/install/ui/src/freeipa/host.js
index c7637a951..c9a7f236e 100644
--- a/install/ui/src/freeipa/host.js
+++ b/install/ui/src/freeipa/host.js
@@ -514,7 +514,7 @@ IPA.host_dnsrecord_entity_link_field = function(spec){
var that = IPA.link_field(spec);
that.other_pkeys = function(){
- var pkey = that.entity.get_primary_key()[0];
+ var pkey = that.facet.get_pkey();
var first_dot = pkey.search(/\./);
var pkeys = [];
pkeys[1] = pkey.substring(0,first_dot);
@@ -664,7 +664,7 @@ IPA.host_unprovision_dialog = function(spec) {
that.unprovision = function(on_success, on_error) {
- var pkey = that.entity.get_primary_key();
+ var pkey = that.facet.get_pkeys();
var command = IPA.command({
name: that.entity.name+'_disable_'+pkey,
@@ -866,7 +866,7 @@ IPA.host.set_otp_dialog = function(spec) {
};
that.set_otp = function(password) {
- var pkey = that.entity.get_primary_key();
+ var pkey = that.facet.get_pkeys();
var command = IPA.command({
entity: that.entity.name,
diff --git a/install/ui/src/freeipa/rule.js b/install/ui/src/freeipa/rule.js
index 8699ba8fb..1d60c7556 100644
--- a/install/ui/src/freeipa/rule.js
+++ b/install/ui/src/freeipa/rule.js
@@ -209,7 +209,7 @@ IPA.rule_association_table_field = function(spec) {
var command = IPA.command({
entity: that.entity.name,
method: that.widget.remove_method,
- args: that.entity.get_primary_key()
+ args: that.facet.get_pkeys()
});
command.set_option(that.widget.other_entity.name, values);
diff --git a/install/ui/src/freeipa/sudo.js b/install/ui/src/freeipa/sudo.js
index cf857ec54..f187d43f3 100644
--- a/install/ui/src/freeipa/sudo.js
+++ b/install/ui/src/freeipa/sudo.js
@@ -909,7 +909,7 @@ IPA.sudo.options_section = function(spec) {
var command = IPA.command({
entity: that.facet.entity.name,
method: 'show',
- args: that.facet.get_primary_key(true),
+ args: that.facet.get_pkeys(),
on_success: function(data) {
that.table.load(data.result.result);
}