Skip to content

Commit

Permalink
Remove Dashcard Reorder Feature Flag
Browse files Browse the repository at this point in the history
Closes ADMIN-257

Test Plan:
* Ensure that you are able to reorder/drag-n-drop dashcards
  without having to enable any feature flags

Change-Id: Ia09c4ee821eb6a867a9521fdff5ccda5c599bcca
Reviewed-on: https://gerrit.instructure.com/166529
Tested-by: Jenkins
Reviewed-by: Ed Schiebel <[email protected]>
Reviewed-by: Carl Kibler <[email protected]>
QA-Review: Anju Reddy <[email protected]>
Product-Review: Carl Kibler <[email protected]>
  • Loading branch information
Dan Minkevitch authored and Carl Kibler committed Nov 8, 2018
1 parent 07132b9 commit 98a4d3c
Show file tree
Hide file tree
Showing 17 changed files with 339 additions and 408 deletions.
5 changes: 1 addition & 4 deletions app/helpers/dashboard_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,7 @@ def map_courses_for_menu(courses, opts={})
presenter.to_h
end

if @domain_root_account.feature_enabled?(:dashcard_reordering)
mapped = mapped.sort_by {|h| h[:position] || ::CanvasSort::Last}
end
mapped
mapped.sort_by {|h| h[:position] || ::CanvasSort::Last}
end

end
11 changes: 5 additions & 6 deletions app/jsx/bundles/dashboard_card.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,24 @@

import React from 'react'
import ReactDOM from 'react-dom'
import DashboardCardBox from '../dashboard_card/DashboardCardBox'
import getDroppableDashboardCardBox from '../dashboard_card/getDroppableDashboardCardBox'
import axios from 'axios'

let promiseToGetDashboardCards

const sessionStorageKey = `dashcards_for_user_${ENV && ENV.current_user_id}`

export default function loadCardDashboard () {
const Box = ENV.DASHBOARD_REORDERING_ENABLED ? getDroppableDashboardCardBox() : DashboardCardBox
export default function loadCardDashboard() {
const Box = getDroppableDashboardCardBox()
const dashboardContainer = document.getElementById('DashboardCard_Container')

function render(dashboardCards) {
ReactDOM.render(
<Box
courseCards={dashboardCards}
reorderingEnabled={ENV.DASHBOARD_REORDERING_ENABLED}
hideColorOverlays={ENV.PREFERENCES.hide_dashcard_color_overlays}
/>, dashboardContainer
/>,
dashboardContainer
)
}

Expand All @@ -47,7 +46,7 @@ export default function loadCardDashboard () {

if (!promiseToGetDashboardCards) {
promiseToGetDashboardCards = axios.get('/dashboard/dashboard_cards').then(({data}) => data)
promiseToGetDashboardCards.then((dashboardCards) =>
promiseToGetDashboardCards.then(dashboardCards =>
sessionStorage.setItem(sessionStorageKey, JSON.stringify(dashboardCards))
)
}
Expand Down
Loading

0 comments on commit 98a4d3c

Please sign in to comment.