Drop concatenated title of add dialog for association_table widget

As for now the default title of add dialogs, which are
initialized from 'association_table' widget, is set to something
like 'Add ${other_entity} into ${entity} ${primary_key}',
where 'other_entity' and 'entity' are also translatable texts.
This construction is used via method 'create_add_dialog' of
'association_table' widget for the all 'Add' actions within
details of entities.

Such concatenation leads to a bad quality translation and
should be changed to an entire sentence.

From now a mentioned title is taken from a spec and should be
specified explicitly.

Fixes: https://pagure.io/freeipa/issue/7712
Fixes: https://pagure.io/freeipa/issue/7714
Reviewed-By: Serhii Tsymbaliuk <stsymbal@redhat.com>
This commit is contained in:
Stanislav Levin 2018-09-25 10:44:47 +03:00 committed by Serhii Tsymbaliuk
parent b3ac230418
commit 171c6a01d8
2 changed files with 1 additions and 9 deletions

View File

@ -184,7 +184,7 @@ IPA.attribute_adder_dialog = function(spec) {
required: true
}
];
spec.title = spec.title || text.get('@i18n:dialogs.add_title').replace('${entity}', metadata.label);
spec.title = spec.title || text.get('@i18n:dialogs.add_title_default');
spec.subject = metadata.label;
var that = IPA.entity_adder_dialog(spec);
@ -638,14 +638,10 @@ IPA.association_table_widget = function (spec) {
that.create_add_dialog = function() {
var entity_label = that.entity.metadata.label_singular;
var pkey = that.facet.get_pkey();
var other_entity_label = that.other_entity.metadata.label;
var title = that.add_title;
title = title.replace('${entity}', entity_label);
title = title.replace('${primary_key}', pkey);
title = title.replace('${other_entity}', other_entity_label);
return IPA.association_adder_dialog({
title: title,

View File

@ -153,14 +153,10 @@ IPA.rule_association_table_widget = function(spec) {
that.create_add_dialog = function() {
var entity_label = that.entity.metadata.label_singular;
var pkey = that.facet.get_pkey();
var other_entity_label = that.other_entity.metadata.label;
var title = that.add_title;
title = title.replace('${entity}', entity_label);
title = title.replace('${primary_key}', pkey);
title = title.replace('${other_entity}', other_entity_label);
var exclude = that.values;
if (that.external) {