mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
get_primary_key function usages removed
https://fedorahosted.org/freeipa/ticket/3236
This commit is contained in:
parent
166102a910
commit
3e392bbfc6
@ -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;
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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;
|
||||
|
@ -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}
|
||||
});
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user