90929d4c6b284dd318f4a78c2aa407afb7423747oliver.bradley * The contents of this file are subject to the terms of the Common Development and
90929d4c6b284dd318f4a78c2aa407afb7423747oliver.bradley * Distribution License (the License). You may not use this file except in compliance with the
90929d4c6b284dd318f4a78c2aa407afb7423747oliver.bradley * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
90929d4c6b284dd318f4a78c2aa407afb7423747oliver.bradley * specific language governing permission and limitations under the License.
90929d4c6b284dd318f4a78c2aa407afb7423747oliver.bradley * When distributing Covered Software, include this CDDL Header Notice in each file and include
90929d4c6b284dd318f4a78c2aa407afb7423747oliver.bradley * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
90929d4c6b284dd318f4a78c2aa407afb7423747oliver.bradley * Header, with the fields enclosed by brackets [] replaced by your own identifying
90929d4c6b284dd318f4a78c2aa407afb7423747oliver.bradley * information: "Portions copyright [year] [name of copyright owner]".
90929d4c6b284dd318f4a78c2aa407afb7423747oliver.bradley * Copyright 2015 ForgeRock AS.
9ef3a0e80a4e67fde2d24364ad9a7d5d64654f19jason.browne/*global define, window */
9ef3a0e80a4e67fde2d24364ad9a7d5d64654f19jason.brownedefine("org/forgerock/openidm/ui/admin/dashboard/widgets/ResourceListWidget", [
9ef3a0e80a4e67fde2d24364ad9a7d5d64654f19jason.browne "underscore",
9ef3a0e80a4e67fde2d24364ad9a7d5d64654f19jason.browne "bootstrap",
9ef3a0e80a4e67fde2d24364ad9a7d5d64654f19jason.browne "org/forgerock/commons/ui/common/main/AbstractView",
9ef3a0e80a4e67fde2d24364ad9a7d5d64654f19jason.browne "org/forgerock/openidm/ui/admin/delegates/SyncDelegate",
9ef3a0e80a4e67fde2d24364ad9a7d5d64654f19jason.browne "org/forgerock/openidm/ui/admin/delegates/ConnectorDelegate",
9ef3a0e80a4e67fde2d24364ad9a7d5d64654f19jason.browne "org/forgerock/openidm/ui/common/delegates/ConfigDelegate",
9ef3a0e80a4e67fde2d24364ad9a7d5d64654f19jason.browne "org/forgerock/openidm/ui/admin/util/ConnectorUtils"
9ef3a0e80a4e67fde2d24364ad9a7d5d64654f19jason.browne], function($, _, bootstrap,
9ef3a0e80a4e67fde2d24364ad9a7d5d64654f19jason.browne template: "templates/admin/dashboard/widgets/ResourceListWidgetTemplate.html",
9ef3a0e80a4e67fde2d24364ad9a7d5d64654f19jason.browne _.bind(function (sync, connectors, managedObjects, iconList) {
9ef3a0e80a4e67fde2d24364ad9a7d5d64654f19jason.browne tempIconClass = ConnectorUtils.getIcon(connector.connectorRef.connectorName, iconList);
9ef3a0e80a4e67fde2d24364ad9a7d5d64654f19jason.browne sync.mappings = _.sortBy(_.sortBy(sync.mappings, 'name'));
9ef3a0e80a4e67fde2d24364ad9a7d5d64654f19jason.browne this.data.mappings = sync.mappings.slice(0, 4);
9ef3a0e80a4e67fde2d24364ad9a7d5d64654f19jason.browne connectors = _.sortBy(_.sortBy(connectors, 'displayName'));
9ef3a0e80a4e67fde2d24364ad9a7d5d64654f19jason.browne managedObjects.objects = _.sortBy(_.sortBy(managedObjects.objects, 'name'));
9ef3a0e80a4e67fde2d24364ad9a7d5d64654f19jason.browne this.data.managedObjects = managedObjects.objects.slice(0, 4);