#2625208: Add ordering for facets to enable changing of url argument orders. added weight to facets to support fixed weights in urls. Ordering only happens on the detail page with a weight field. We should also enable this on the overview.

Comments

borisson_ created an issue. See original summary.

borisson_’s picture

Category: Task » Feature request
dragos-dumi’s picture

Hi, I would contrib to this one, but not sure which page are you referring to; is this one? "admin/config/search/facets"

borisson_’s picture

Yes. That is the page where we want to enable sorting through drag and drop

dragos-dumi’s picture

Attached a patch for the draggable overview page.
What I don't know if it's possible (or how) to lock the children within a facet source. Currently you could drag the facet below another source (but that doesn't affect the weight save).

Needs a test.

dragos-dumi’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 5: facets-2688899-facets-weight-draggable-overview.patch, failed testing.

borisson_’s picture

Yeah, dragging to a different source won't work and that would feel very weird that dragging there is possible but doesn't do anything. Not sure how to resolve that. I'll make sure to discuss this next time we have a hangout / meeting.

In any case, thanks for your work on this patch!

borisson_’s picture

We quickly discussed this issue earlier and decided that we shouldn't have to worry about dragging to another source, that's behavior that we do not want to support. We should document that on the overview.

We should have a look if core has any js-tests on the drag-drop UI and if it doesn't we can commit this patch as-is.

dragos-dumi’s picture

Attaching the rerolled patch - the initial one had ofsfets changes, an interdiff with a message as described in #9 and the complete patch.

Regarding the tests, I couldn't find and example o such tests nor a method that would help us. The only thing I was able to find was this one, but doesnt't look it can help - it moves element from a parent to another one, without a mention about weight with its sibliings

/**
   * Drag an element to a another in a given page
   * @param $pageId
   * @param $fromId
   * @param $toId
   * @return mixed
   */
  public function drag($pageId, $fromId, $toId) {
    return $this->command('drag', $pageId, $fromId, $toId);
  }
dragos-dumi’s picture

Status: Needs work » Needs review
borisson_’s picture

Awesome, thanks! I'll test the patch out tonight and report my findings (or commit).

borisson_’s picture

Status: Needs review » Fixed

Works perfectly, committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.