add a new rule at the end of all existing rule

Bug #1623049 reported by Slobodan Blatnjak
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R3.1
Won't Fix
Medium
Rahul
R3.2
Won't Fix
Undecided
Rahul
Trunk
Fix Committed
Medium
Suresh Akula

Bug Description

When playing with rules, we have two options to add new rules: “+” on the title, that refers to ‘add a new rule at the end of all existing rules’, and the ‘+’ located at the end of each rule that means ‘add a new rule just next to me’ … This was working in 2.21. But no more in 3.0.1

Have inspected "+" element and compared versions 2.21-102 and 3.0.1.0-23 3.1.0.0-25
On 2.21-102 html element looks like:
  <i class="icon-plus" onclick="appendRuleEntry(this, false);" title="Add rule below"></i>
on 3.x.x version it looks like:
  <a data-bind="click: function() { $root.addRule(); }"><i class="icon-plus"></i></a>

policymodel.js addRule function desn't take arguments like 'this element' to append new rule element just to it, so new rule is simply added to the ruleList rulesList.add([newRuleModel])
addRule: function() {
            var rulesList = this.model().attributes['PolicyRules'],
                newRuleModel = new RuleModel();
            this.showHideServiceInstance(newRuleModel);

            rulesList.add([newRuleModel]);
        },

In 2.21-102 we have line "parentEl.parentNode.insertBefore(ruleEntry, parentEl.nextSibling)" in appendRuleEntry function in policy-config.js file which will add new rule html element next to rule with "+":
function appendRuleEntry(who, defaultRow) {
    var ruleEntry = createRuleEntry(null, $("#ruleTuples").children().length, window.vns, window.policies, window.subnets, window.sts);
    if (defaultRow) {
        $("#ruleTuples").prepend($(ruleEntry));
    } else {
        var parentEl = who.parentNode.parentNode.parentNode;
        parentEl.parentNode.insertBefore(ruleEntry, parentEl.nextSibling);
    }
    scrollUp("#windowCreatePolicy",ruleEntry,false);
}

Tags: ui
description: updated
information type: Proprietary → Public
Sachin Bansal (sbansal)
tags: added: ui
Revision history for this message
Rahul (rahuls) wrote :

Backbone based editable grids didn't support insertion at a particular index. Functionality could not be supported while moving to MVC based code.

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/29742
Submitter: Suresh Akula (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/29847
Submitter: Suresh Akula (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/29742
Submitter: Suresh Akula (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/29742
Committed: http://github.org/Juniper/contrail-web-controller/commit/3e8f12e2f33d11d1b62a0b843d9b52ea1f285e98
Submitter: Zuul (<email address hidden>)
Branch: master

commit 3e8f12e2f33d11d1b62a0b843d9b52ea1f285e98
Author: surakula <email address hidden>
Date: Mon Mar 20 15:03:07 2017 -0700

1. Fixed the add new item to the end of the selected list
2. Fixed the add a new immediate next item to the selected item.
3. Fixed typo errors
4. Fixed testcases

Partial-Bug: #1623049

Change-Id: I4e3c819a0ca8ef800f8d38227b71a3bbb2f48fd5

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/29847
Committed: http://github.org/Juniper/contrail-web-core/commit/7c8de67f062515738dd429e26e6f89599c84d8c6
Submitter: Zuul (<email address hidden>)
Branch: master

commit 7c8de67f062515738dd429e26e6f89599c84d8c6
Author: surakula <email address hidden>
Date: Thu Mar 23 14:58:35 2017 -0700

1. Fixed the add new item to the end of the selected list
2. Fixed the add a new immediate next item to the selected item.

Change-Id: I1e523fd9463e3fcd41b5ba521f274e9ecdce81dc
Closes-Bug: #1623049

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/30216
Submitter: Suresh Akula (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/30216
Committed: http://github.org/Juniper/contrail-web-controller/commit/a5b468791015286aa1c6def2bebf2258e5ae35cb
Submitter: Zuul (<email address hidden>)
Branch: master

commit a5b468791015286aa1c6def2bebf2258e5ae35cb
Author: surakula <email address hidden>
Date: Thu Apr 6 13:24:42 2017 -0700

1. Fixed method signature error on Service Instance model
Closes-Bug: #1623049

Change-Id: I7264e0dc98db28d77fbb0d839c24c9dbff1a82cc

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.