mno-enterprise-frontend 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +1 -0
- data/Rakefile +12 -0
- data/app/assets/images/favicon.ico +0 -0
- data/app/assets/images/mno_enterprise/impac/close-widget-pink.png +0 -0
- data/app/assets/images/mno_enterprise/impac/close-widget.png +0 -0
- data/app/assets/images/mno_enterprise/loader-32x32-bg-inverse.gif +0 -0
- data/app/assets/images/mno_enterprise/loader-32x32-bg-main.gif +0 -0
- data/app/assets/images/mno_enterprise/maestrano/logo-whitebg.png +0 -0
- data/app/assets/javascripts/mno_enterprise/angular/app.js.coffee.erb +173 -0
- data/app/assets/javascripts/mno_enterprise/angular/controllers/maestrano-controllers.js.coffee +4 -0
- data/app/assets/javascripts/mno_enterprise/angular/controllers/modals/modals-ctrl.js.coffee +62 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-account.js.coffee +157 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-app-deletion-request.js.coffee +62 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-apps-list.js.coffee +127 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-components.js.coffee +25 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-marketplace-app.js.coffee +77 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-marketplace.js.coffee +51 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-menu.js.coffee +174 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/arrears.js.coffee +70 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/billing.js.coffee +48 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/credit-card.js.coffee +142 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/index.js.coffee +61 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/invoices.js.coffee +42 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/members.js.coffee +280 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/settings.js.coffee +91 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/team-list.js.coffee +179 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/teams.js.coffee +268 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/file-model.js.coffee +33 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/maestrano-components.js.coffee +22 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-autostop-app.js.coffee +123 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-compile.js.coffee +18 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-currency-widget.js.coffee +43 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-current-currency.js.coffee +22 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-editable.js.coffee +68 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-flash-msg.js.coffee +40 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-helptext.js.coffee +38 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-loading-lounge.js.coffee +184 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-match.js.coffee +14 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-message-modal.js.coffee +56 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-notification-widget.js.coffee +192 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-partner-code-popup.js.coffee +74 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-partner-contact.js.coffee +59 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-password-strength.js.coffee +154 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-password.js.coffee +40 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-price-converter.js.coffee +49 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-scroll-to.js.coffee +14 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-typeahead.js.coffee +89 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/user-setup/components.js.coffee +7 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/user-setup/index.js.coffee +256 -0
- data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-app-by-category.js.coffee +5 -0
- data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-currency.js.coffee +30 -0
- data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-filters.js.coffee +7 -0
- data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-replace-underscore-with-space.js.coffee +4 -0
- data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-titleize.js.coffee +7 -0
- data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-truncate.js.coffee +24 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/maestrano-app-instance.js.coffee +15 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/maestrano-apps-document.js.coffee +83 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/maestrano-user.js.coffee +27 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/organization-svc.js.coffee +318 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/team-svc.js.coffee +180 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/tickets-svc.js.coffee +109 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/impac-config.svc.js.coffee +35 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-apps-list-helper.js.coffee +337 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-assets.js.coffee.erb +21 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-current-currency.js.coffee +7 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-current-user-svc.js.coffee +99 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-exchange-rates.js.coffee +102 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-message-svc.js.coffee +71 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-miscellaneous.js.coffee.erb +46 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-modal.js.coffee +67 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-msg-bus.js.coffee +50 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-services.js.coffee +21 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-shopping-cart.js.coffee +361 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-utilities.js.coffee +61 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/marketplace-svc.js.coffee +59 -0
- data/app/assets/javascripts/mno_enterprise/application.js +17 -0
- data/app/assets/javascripts/mno_enterprise/application_lib.js +14 -0
- data/app/assets/javascripts/mno_enterprise/lib/angular-really-click.js +17 -0
- data/app/assets/javascripts/mno_enterprise/lib/sortable.js +315 -0
- data/app/assets/javascripts/mno_enterprise/lib/ui-bootstrap-tpls-0.13.4.js +5836 -0
- data/app/assets/javascripts/mno_enterprise/lib/xeditable.js +1588 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap.js +12 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/affix.js +162 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/alert.js +94 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/button.js +116 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/carousel.js +237 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/collapse.js +211 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/dropdown.js +161 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/modal.js +324 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/popover.js +113 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/scrollspy.js +175 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/tab.js +153 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/tooltip.js +472 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/transition.js +59 -0
- data/app/assets/javascripts/ng-performance/ngPerformance.html +109 -0
- data/app/assets/javascripts/ng-performance/ngPerformance.js +211 -0
- data/app/assets/stylesheets/mno_enterprise/application.css +13 -0
- data/app/assets/stylesheets/mno_enterprise/custom/accordion.less +90 -0
- data/app/assets/stylesheets/mno_enterprise/custom/alert.less +30 -0
- data/app/assets/stylesheets/mno_enterprise/custom/angular-animate.less +42 -0
- data/app/assets/stylesheets/mno_enterprise/custom/angular-material.less +56 -0
- data/app/assets/stylesheets/mno_enterprise/custom/bootstrap-on-juice.less +22 -0
- data/app/assets/stylesheets/mno_enterprise/custom/button.less +84 -0
- data/app/assets/stylesheets/mno_enterprise/custom/footer.less +44 -0
- data/app/assets/stylesheets/mno_enterprise/custom/form.less +191 -0
- data/app/assets/stylesheets/mno_enterprise/custom/header.less +281 -0
- data/app/assets/stylesheets/mno_enterprise/custom/impac-variables-override.less +65 -0
- data/app/assets/stylesheets/mno_enterprise/custom/modal.less +183 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utilities.less +729 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/app-presentation.less +77 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/banners.less +145 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/carousel.less +68 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/helptext.less +40 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/miscellaneous.less +134 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/progress-bar.less +55 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/step.less +101 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/tabset.less +87 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/testimonial.less +118 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/text.less +23 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/apps.less +243 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/myspace.less +477 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/pages/confirmation_lounge.less +31 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/pages/home.less +57 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/pages/oauth-config-page.less +6 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/registration.less +84 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/star.less +18 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/bootstrap-wizard.less +63 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/dashboard-marketplace.less +187 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/dashboard-organization.less +149 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/dashboard-teams.less +119 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/support.less +42 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/tickets.less +80 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/mno-editable.less +60 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/notification-widget.less +49 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/password-strength.less +28 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/shopping-cart.less +333 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/star-wizard.less +49 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/user-setup.less +10 -0
- data/app/assets/stylesheets/mno_enterprise/custom/xeditable.less +40 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/font-awesome-regular.less +13 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/font-awesome-sprockets.less +13 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/font-awesome.less +16 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/fonts/FontAwesome.otf +0 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/fonts/fontawesome-webfont.eot +0 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/fonts/fontawesome-webfont.svg +640 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/fonts/fontawesome-webfont.woff +0 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/animated.less +34 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/bordered-pulled.less +25 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/core.less +12 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/extras.less +2 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/fixed-width.less +6 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/icons.less +677 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/larger.less +13 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/list.less +19 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/mixins.less +26 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/rotated-flipped.less +20 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/stacked.less +20 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/variables.less +687 -0
- data/app/assets/stylesheets/mno_enterprise/main.less +132 -0
- data/app/assets/stylesheets/mno_enterprise/mixins.less +75 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/alerts.less +73 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/badges.less +65 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/bootstrap.less +50 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/breadcrumbs.less +26 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/button-groups.less +243 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/buttons.less +160 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/carousel.less +269 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/close.less +34 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/code.less +69 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/component-animations.less +34 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/dropdowns.less +214 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/forms.less +566 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/glyphicons.less +301 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/grid.less +84 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/input-groups.less +166 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/jumbotron.less +50 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/labels.less +64 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/list-group.less +124 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/media.less +61 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins.less +39 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/alerts.less +14 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/background-variant.less +8 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/border-radius.less +18 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/buttons.less +52 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/center-block.less +7 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/clearfix.less +22 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/forms.less +85 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/gradients.less +59 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/grid-framework.less +91 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/grid.less +122 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/hide-text.less +21 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/image.less +33 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/labels.less +12 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/list-group.less +29 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/nav-divider.less +10 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/nav-vertical-align.less +9 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/opacity.less +8 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/pagination.less +23 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/panels.less +24 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/progress-bar.less +10 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/reset-filter.less +8 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/resize.less +6 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/responsive-visibility.less +15 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/size.less +10 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/tab-focus.less +9 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/table-row.less +28 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/text-emphasis.less +8 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/text-overflow.less +8 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/vendor-prefixes.less +227 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/modals.less +148 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/navbar.less +661 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/navs.less +244 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/normalize.less +427 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/pager.less +54 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/pagination.less +88 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/panels.less +265 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/popovers.less +135 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/print.less +107 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/progress-bars.less +87 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/responsive-embed.less +35 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/responsive-utilities.less +194 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/scaffolding.less +150 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/tables.less +234 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/theme.less +273 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/thumbnails.less +36 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/tooltip.less +103 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/type.less +302 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/utilities.less +56 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/variables.less +857 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/wells.less +29 -0
- data/app/assets/stylesheets/mno_enterprise/variables.less +226 -0
- data/app/assets/templates/mno_enterprise/dashboard/account.html +131 -0
- data/app/assets/templates/mno_enterprise/dashboard/app_deletion.html +36 -0
- data/app/assets/templates/mno_enterprise/dashboard/apps_list.html +103 -0
- data/app/assets/templates/mno_enterprise/dashboard/horizontal_menu.html +85 -0
- data/app/assets/templates/mno_enterprise/dashboard/marketplace/index.html +60 -0
- data/app/assets/templates/mno_enterprise/dashboard/marketplace/show.html +133 -0
- data/app/assets/templates/mno_enterprise/dashboard/menu.html +161 -0
- data/app/assets/templates/mno_enterprise/dashboard/organization/arrears.html +37 -0
- data/app/assets/templates/mno_enterprise/dashboard/organization/billing.html +37 -0
- data/app/assets/templates/mno_enterprise/dashboard/organization/credit-card.html +156 -0
- data/app/assets/templates/mno_enterprise/dashboard/organization/index.full.html +181 -0
- data/app/assets/templates/mno_enterprise/dashboard/organization/index.html +173 -0
- data/app/assets/templates/mno_enterprise/dashboard/organization/invoices.html +27 -0
- data/app/assets/templates/mno_enterprise/dashboard/organization/members.html +288 -0
- data/app/assets/templates/mno_enterprise/dashboard/organization/settings.html +55 -0
- data/app/assets/templates/mno_enterprise/dashboard/teams/index.html +175 -0
- data/app/assets/templates/mno_enterprise/dashboard/teams/member-add-modal.html +60 -0
- data/app/assets/templates/mno_enterprise/dashboard/teams/member-removal-modal.html +35 -0
- data/app/assets/templates/mno_enterprise/dashboard/teams/team-add-modal.html +35 -0
- data/app/assets/templates/mno_enterprise/dashboard/teams/team-delete-modal.html +35 -0
- data/app/assets/templates/mno_enterprise/dashboard/teams/team-list.html +107 -0
- data/app/assets/templates/mno_enterprise/default_template.html +20 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/autostop_app.html +42 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/currency_widget.html +1 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/editable.html +28 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/loading_lounge.html +63 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/modal-messages/congratulations.html +8 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/modal-messages/default.html +1 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/modal-messages/information.html +8 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/notification-widget.html +31 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/password.html +55 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/star_wizard.html +254 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/upload_spreadsheet.html +191 -0
- data/app/assets/templates/mno_enterprise/modals/new-organization-reseller-req.html +35 -0
- data/app/assets/templates/mno_enterprise/modals/new-organization.html +35 -0
- data/app/assets/templates/mno_enterprise/user-setup/index.html +312 -0
- data/app/controllers/mno_enterprise/invoices_controller.rb +22 -0
- data/app/controllers/mno_enterprise/pages_controller.rb +9 -0
- data/app/controllers/mno_enterprise/user_setup_controller.rb +11 -0
- data/app/views/layouts/mno_enterprise/_application_js.html.haml +17 -0
- data/app/views/layouts/mno_enterprise/_common_cdn_lib_js.html.haml +19 -0
- data/app/views/layouts/mno_enterprise/_footer_files.html.haml +5 -0
- data/app/views/layouts/mno_enterprise/_header_files.html.haml +31 -0
- data/app/views/layouts/mno_enterprise/_impersonate_header.html.haml +7 -0
- data/app/views/layouts/mno_enterprise/_public_page_header.html.haml +2 -0
- data/app/views/layouts/mno_enterprise/application.html.haml +18 -0
- data/app/views/layouts/mno_enterprise/application_dashboard.html.haml +22 -0
- data/app/views/layouts/mno_enterprise/third_party/_google_tag_container.html.haml +10 -0
- data/app/views/mno_enterprise/pages/app_access_unauthorized.html.haml +19 -0
- data/app/views/mno_enterprise/pages/app_logout.html.haml +18 -0
- data/app/views/mno_enterprise/pages/billing_details_required.html.haml +19 -0
- data/app/views/mno_enterprise/pages/loading.html.haml +3 -0
- data/app/views/mno_enterprise/pages/myspace.html.haml +6 -0
- data/app/views/mno_enterprise/provision/_provision_apps.html.haml +43 -0
- data/app/views/mno_enterprise/provision/_select_organization.html.haml +17 -0
- data/app/views/mno_enterprise/provision/new.html.haml +4 -0
- data/app/views/mno_enterprise/user_setup/index.html.haml +2 -0
- data/config/initializers/ng-annotate.rb +3 -0
- data/config/initializers/ng-performance.rb +3 -0
- data/config/routes.rb +19 -0
- data/lib/assets/javascripts/impac-angular.js +8719 -0
- data/lib/assets/stylesheets/impac-angular.less +2352 -0
- data/lib/mno-enterprise-frontend.rb +1 -0
- data/lib/mno_enterprise/frontend.rb +13 -0
- data/lib/mno_enterprise/frontend/assets_util.rb +47 -0
- data/lib/mno_enterprise/frontend/concerns/README.md +6 -0
- data/lib/mno_enterprise/frontend/concerns/controllers/pages_controller.rb +25 -0
- data/lib/mno_enterprise/frontend/engine.rb +13 -0
- data/spec/controllers/mno_enterprise/auth/confirmations_controller_spec.rb +84 -0
- data/spec/controllers/mno_enterprise/invoices_controller_spec.rb +34 -0
- data/spec/controllers/mno_enterprise/pages_controller_spec.rb +42 -0
- data/spec/controllers/mno_enterprise/user_setup_controller_spec.rb +33 -0
- data/spec/controllers/mno_enterprise/webhook/o_auth_controller_spec.rb +76 -0
- data/spec/rails_helper.rb +92 -0
- data/spec/routing/mno_enterprise/invoices_controller_routing_spec.rb +11 -0
- data/spec/routing/mno_enterprise/pages_controller_routing_spec.rb +18 -0
- data/spec/routing/mno_enterprise/user_setup_controller_routing_spec.rb +11 -0
- data/spec/spec_helper.rb +78 -0
- metadata +464 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
maestranoServices = angular.module('maestrano.services',[
|
2
|
+
'maestrano.services.apps-list-helper',
|
3
|
+
'maestrano.services.current-user-svc',
|
4
|
+
'maestrano.services.shopping-cart'
|
5
|
+
'maestrano.services.current-currency',
|
6
|
+
'maestrano.services.miscellaneous',
|
7
|
+
'maestrano.services.marketplace-svc',
|
8
|
+
'maestrano.services.message-svc',
|
9
|
+
'maestrano.services.modal-svc',
|
10
|
+
|
11
|
+
# Dashboard
|
12
|
+
'maestrano.services.dashboard.apps-document',
|
13
|
+
'maestrano.services.dashboard.organization-svc',
|
14
|
+
'maestrano.services.dashboard.team-svc'
|
15
|
+
'maestrano.services.dashboard.user',
|
16
|
+
'maestrano.services.dashboard.app-instance',
|
17
|
+
|
18
|
+
# Impac configuration
|
19
|
+
'maestrano.services.impac-config-svc'
|
20
|
+
|
21
|
+
])
|
@@ -0,0 +1,361 @@
|
|
1
|
+
#
|
2
|
+
# Main Shopping cart steps
|
3
|
+
# 0) start
|
4
|
+
# 1) identifyUser
|
5
|
+
# 2) selectOrga (optional)
|
6
|
+
# 3) chooseApps
|
7
|
+
# 4) chooseDeal (optional)
|
8
|
+
# 5) chooseSupport
|
9
|
+
# 6) chooseExtras
|
10
|
+
# 7) orderSummary
|
11
|
+
# 8) paymentScreen (optional)
|
12
|
+
# 9) checkout
|
13
|
+
# 10) confirmScreen (optional)
|
14
|
+
#
|
15
|
+
angular.module('maestrano.services.shopping-cart', [])
|
16
|
+
.factory('ShoppingCart', ['$http','$q','CurrentUserSvc', ($http,$q,$CurrentUserSvc) ->
|
17
|
+
service = {}
|
18
|
+
service.config = {
|
19
|
+
allAppsPath: '/mnoe/jpi/v1/shopping_cart/apps',
|
20
|
+
allOrgsPath: '/mnoe/jpi/v1/shopping_cart/organizations'
|
21
|
+
cartRootPath: '/mnoe/jpi/v1/shopping_cart'
|
22
|
+
|
23
|
+
deals: [{ entity: 'deal', product: 'new_6_month_prepay'},
|
24
|
+
{ entity: 'deal', product: 'new_12_month_prepay'},
|
25
|
+
{ entity: 'deal', product: 'starter_pack_deal'}]
|
26
|
+
|
27
|
+
firstStep: 'identifyUser'
|
28
|
+
steps: {
|
29
|
+
identifyUser: {
|
30
|
+
number: 0
|
31
|
+
skipCondition: ( (svc)-> svc.data.user? && svc.data.user.email? && svc.data.user.email != '')
|
32
|
+
next: 'selectOrga'
|
33
|
+
showOrder: false
|
34
|
+
showFunnel: false
|
35
|
+
},
|
36
|
+
selectOrga: {
|
37
|
+
number: 0
|
38
|
+
skipCondition: ( (svc)-> svc.data.organization? )
|
39
|
+
next: 'chooseApps'
|
40
|
+
showOrder: false
|
41
|
+
showFunnel: false
|
42
|
+
},
|
43
|
+
chooseApps: {
|
44
|
+
number: 1
|
45
|
+
skipCondition: ( (svc)-> svc.data.fasttrack )
|
46
|
+
next: 'chooseDeal'
|
47
|
+
showOrder: true
|
48
|
+
showFunnel: true
|
49
|
+
orderMode: 'list'
|
50
|
+
},
|
51
|
+
chooseDeal: {
|
52
|
+
number: 2
|
53
|
+
skipCondition: ( (svc)-> svc.data.fasttrack || !svc.isDealProposed() )
|
54
|
+
next: 'chooseSupport'
|
55
|
+
showOrder: true
|
56
|
+
showFunnel: true
|
57
|
+
orderMode: 'list'
|
58
|
+
},
|
59
|
+
chooseSupport: {
|
60
|
+
number: 2
|
61
|
+
skipCondition: ( (svc)-> svc.data.fasttrack )
|
62
|
+
next: 'chooseExtras'
|
63
|
+
showOrder: true
|
64
|
+
showFunnel: true
|
65
|
+
orderMode: 'list'
|
66
|
+
},
|
67
|
+
chooseExtras: {
|
68
|
+
number: 3
|
69
|
+
skipCondition: ( (svc)-> svc.data.fasttrack )
|
70
|
+
next: 'orderSummary'
|
71
|
+
showOrder: true
|
72
|
+
showFunnel: true
|
73
|
+
orderMode: 'list'
|
74
|
+
},
|
75
|
+
orderSummary: {
|
76
|
+
number: 4
|
77
|
+
next: 'ccDetails'
|
78
|
+
showOrder: true
|
79
|
+
showFunnel: true
|
80
|
+
orderMode: 'summary'
|
81
|
+
},
|
82
|
+
ccDetails: {
|
83
|
+
number: 4
|
84
|
+
next: 'confirmScreen'
|
85
|
+
showOrder: true
|
86
|
+
showFunnel: true
|
87
|
+
orderMode: 'summary'
|
88
|
+
},
|
89
|
+
confirmScreen: {
|
90
|
+
number: 4
|
91
|
+
showOrder: false
|
92
|
+
showFunnel: false
|
93
|
+
},
|
94
|
+
|
95
|
+
}
|
96
|
+
}
|
97
|
+
|
98
|
+
|
99
|
+
#==========================================
|
100
|
+
# Workflow functions
|
101
|
+
#==========================================
|
102
|
+
service.setLoading = (val)->
|
103
|
+
service.state.loading = val
|
104
|
+
|
105
|
+
# Switch the cart to a new step
|
106
|
+
service.switchStepTo = (stepName) ->
|
107
|
+
self = service
|
108
|
+
self.state.stepHist.push(self.state.step)
|
109
|
+
self.state.subStep = null
|
110
|
+
self.state.step = stepName
|
111
|
+
|
112
|
+
service.switchSubStepTo = (subStepName) ->
|
113
|
+
self = service
|
114
|
+
self.state.subStep = subStepName
|
115
|
+
|
116
|
+
# Move the cart workflow to the next
|
117
|
+
# step
|
118
|
+
# Passing is a step in argument is optional
|
119
|
+
# and only used by the next method itself
|
120
|
+
# when it need to skip steps (recursive call)
|
121
|
+
service.next = (currStep = null)->
|
122
|
+
self = service
|
123
|
+
|
124
|
+
# We get the next step to target
|
125
|
+
currentStep = (currStep || self.state.step)
|
126
|
+
if currentStep
|
127
|
+
nextStep = self.config.steps[currentStep]['next']
|
128
|
+
else
|
129
|
+
nextStep = self.config.firstStep
|
130
|
+
|
131
|
+
# Exit if no next step
|
132
|
+
unless nextStep?
|
133
|
+
return null
|
134
|
+
|
135
|
+
# Check if we can skip it
|
136
|
+
if angular.isFunction(self.config.steps[nextStep]['skipCondition'])
|
137
|
+
if self.config.steps[nextStep]['skipCondition'](self)
|
138
|
+
return self.next(nextStep)
|
139
|
+
|
140
|
+
# Switch to the nextStep
|
141
|
+
self.switchStepTo(nextStep)
|
142
|
+
|
143
|
+
# Go back one step
|
144
|
+
service.back = ()->
|
145
|
+
self = service
|
146
|
+
self.state.step = self.state.stepHist.pop()
|
147
|
+
return self.state.step
|
148
|
+
|
149
|
+
#==========================================
|
150
|
+
# HTTP functions
|
151
|
+
#==========================================
|
152
|
+
service.addBundle = (bundle = null)->
|
153
|
+
self = service
|
154
|
+
return false unless angular.isObject(bundle)
|
155
|
+
|
156
|
+
# Register bundle
|
157
|
+
self.$bundle = bundle
|
158
|
+
|
159
|
+
# Check if we should fasttrack
|
160
|
+
self.data.fasttrack = self.$bundle.fasttrack || false
|
161
|
+
|
162
|
+
# Retrieve the list of available applications to purchase
|
163
|
+
# Also add any app from the provided bundle that is not
|
164
|
+
# in the list of available apps (useful to display sandbox apps or non-active
|
165
|
+
# apps properly when they are specifically chosen)
|
166
|
+
service.getApps = ()->
|
167
|
+
self = service
|
168
|
+
return self.$q['apps'] if self.$q['apps']
|
169
|
+
|
170
|
+
# If a bundle is present, pass the apps as parameter to ensure
|
171
|
+
# they are in the returned list
|
172
|
+
# Need to pass app_instances as JSON as $http.get 'params' doe not handle
|
173
|
+
# automated conversion of JS objects
|
174
|
+
config = {}
|
175
|
+
config['params'] = { ensure_apps: angular.toJson(self.$bundle.app_instances) } if self.$bundle
|
176
|
+
|
177
|
+
# Fetch the apps
|
178
|
+
path = self.config.allAppsPath
|
179
|
+
self.$q['apps'] = $http.get(path,config).then((result)-> self.data.apps = result['data'])
|
180
|
+
|
181
|
+
# Return the promise
|
182
|
+
self.$q['apps']
|
183
|
+
|
184
|
+
service.getOrganizations = () ->
|
185
|
+
self = service
|
186
|
+
unless self.$q['organizations']
|
187
|
+
path = self.config.allOrgsPath
|
188
|
+
self.$q['organizations'] = $http.get(path).then((result)-> self.data.organizations = result['data'])
|
189
|
+
self.$q['organizations']
|
190
|
+
|
191
|
+
# Load details about the current user
|
192
|
+
service.getUser = () ->
|
193
|
+
self = service
|
194
|
+
$CurrentUserSvc.loadDocument().then(
|
195
|
+
(result) ->
|
196
|
+
self.data.user = result['data']['user']
|
197
|
+
)
|
198
|
+
|
199
|
+
# Call user service and log the current
|
200
|
+
# user in
|
201
|
+
service.userSignIn = (email,password) ->
|
202
|
+
self = service
|
203
|
+
$CurrentUserSvc.signIn(email,password)
|
204
|
+
.then((user) -> self.data.user = user)
|
205
|
+
|
206
|
+
# Call user service and sign the current
|
207
|
+
# user up
|
208
|
+
service.userSignUp = (hash) ->
|
209
|
+
self = service
|
210
|
+
$CurrentUserSvc.signUp(hash)
|
211
|
+
.then((user) -> self.data.user = user)
|
212
|
+
|
213
|
+
# Remotely push an item to the cart, update
|
214
|
+
# the item locally with the response as well
|
215
|
+
# as the financials
|
216
|
+
# TODO: id should actually be generated
|
217
|
+
# on the backend side
|
218
|
+
service.upsertItem = (hash) ->
|
219
|
+
self = service
|
220
|
+
path = "#{self.config.cartRootPath}/#{self.cart.id}/upsert_item"
|
221
|
+
$http.put(path,{ item: hash }).then(
|
222
|
+
(result) ->
|
223
|
+
angular.extend(hash,result.data.item)
|
224
|
+
angular.extend(self.cart, result.data.cart)
|
225
|
+
)
|
226
|
+
|
227
|
+
# Remotely remove an item from the cart and
|
228
|
+
# update the totals
|
229
|
+
service.removeItem = (hash) ->
|
230
|
+
self = service
|
231
|
+
path = "#{self.config.cartRootPath}/#{self.cart.id}/remove_item"
|
232
|
+
$http.put(path,{ item: hash }).then(
|
233
|
+
(result) ->
|
234
|
+
angular.extend(self.cart, result.data.cart)
|
235
|
+
)
|
236
|
+
|
237
|
+
# Generate an item id for a new item
|
238
|
+
# Used for item edition
|
239
|
+
# TODO: refactor - remove harcoded offset
|
240
|
+
service.generateItemId = ->
|
241
|
+
self = service
|
242
|
+
self.state.itemIdCounter += 1
|
243
|
+
id = self.state.itemIdCounter
|
244
|
+
id += 1000
|
245
|
+
if self.cart? && angular.isNumber(self.cart.lastItemId)
|
246
|
+
id += self.cart.lastItemId
|
247
|
+
id.toString()
|
248
|
+
|
249
|
+
# Create a new cart using the current
|
250
|
+
# cart user and provided organization
|
251
|
+
service.createCart = (orga)->
|
252
|
+
self = service
|
253
|
+
path = self.config.cartRootPath
|
254
|
+
data = { shopping_cart: { organization_id: orga.id, bundle: self.$bundle } }
|
255
|
+
$http.post(path,data).then (result) ->
|
256
|
+
self.data.organization = orga
|
257
|
+
self.cart = result['data']
|
258
|
+
|
259
|
+
service.checkout = (creditCard = {})->
|
260
|
+
self = service
|
261
|
+
path = "#{self.config.cartRootPath}/#{self.cart.id}/checkout"
|
262
|
+
$http.put(path,{ credit_card: creditCard}).then(
|
263
|
+
(result) ->
|
264
|
+
angular.extend(self.cart, result.data)
|
265
|
+
)
|
266
|
+
|
267
|
+
|
268
|
+
#==========================================
|
269
|
+
# Step specific methods
|
270
|
+
#==========================================
|
271
|
+
# Check whether we should display the deal page
|
272
|
+
# or not
|
273
|
+
service.isDealProposed = ()->
|
274
|
+
hasHostedApp = _.findWhere(service.cart.content.appInstances, { product: 'cube'})?
|
275
|
+
createdAt = moment(service.data.user.createdAt)
|
276
|
+
hasHostedApp && createdAt > moment().subtract({days:1})
|
277
|
+
|
278
|
+
# Should we show the order summary at the current
|
279
|
+
# step
|
280
|
+
service.isOrderShown = ->
|
281
|
+
self = service
|
282
|
+
self.config.steps[self.state.step]? && self.config.steps[self.state.step].showOrder
|
283
|
+
|
284
|
+
# Should we show the funnel for the current
|
285
|
+
# step
|
286
|
+
service.isFunnelShown = ->
|
287
|
+
self = service
|
288
|
+
self.config.steps[self.state.step]? && self.config.steps[self.state.step].showFunnel
|
289
|
+
|
290
|
+
service.stepNumber = ->
|
291
|
+
self = service
|
292
|
+
self.config.steps[self.state.step]? && self.config.steps[self.state.step].number
|
293
|
+
|
294
|
+
# Should the side area be a list or summary?
|
295
|
+
service.sideAreaMode = ->
|
296
|
+
self = service
|
297
|
+
self.config.steps[self.state.step]? && self.config.steps[self.state.step].orderMode
|
298
|
+
|
299
|
+
service.isPartnerFieldShown = ->
|
300
|
+
service.isDealProposed()
|
301
|
+
|
302
|
+
#==========================================
|
303
|
+
# Main functions
|
304
|
+
#==========================================
|
305
|
+
# Reset the cart service internal data
|
306
|
+
service.initialize = ()->
|
307
|
+
service.$bundle = {}
|
308
|
+
service.$q = {}
|
309
|
+
service.data = {
|
310
|
+
apps: [],
|
311
|
+
organizations: null,
|
312
|
+
user: null
|
313
|
+
fasttrack: false
|
314
|
+
}
|
315
|
+
service.cart = {
|
316
|
+
id: null
|
317
|
+
lastItemId: 0
|
318
|
+
content: {
|
319
|
+
appInstances: {}
|
320
|
+
services: {}
|
321
|
+
support: null
|
322
|
+
deal: null
|
323
|
+
}
|
324
|
+
total: {}
|
325
|
+
orderList: {
|
326
|
+
hourly: []
|
327
|
+
monthly: []
|
328
|
+
adhoc: []
|
329
|
+
variable: []
|
330
|
+
}
|
331
|
+
}
|
332
|
+
service.state = {
|
333
|
+
subStep: null
|
334
|
+
step: null
|
335
|
+
stepHist: []
|
336
|
+
loading: false
|
337
|
+
totalsLoading: false
|
338
|
+
itemIdCounter: 0
|
339
|
+
}
|
340
|
+
|
341
|
+
# Initialize a new shopping cart workflow
|
342
|
+
service.start = (bundle = null)->
|
343
|
+
self = service
|
344
|
+
# Reset the service
|
345
|
+
self.initialize()
|
346
|
+
|
347
|
+
# Process the bundle
|
348
|
+
self.addBundle(bundle)
|
349
|
+
|
350
|
+
# Load the apps in the background
|
351
|
+
self.getApps()
|
352
|
+
|
353
|
+
# Get the user info
|
354
|
+
self.getUser().then ->
|
355
|
+
# Move to the next step
|
356
|
+
self.next()
|
357
|
+
|
358
|
+
|
359
|
+
|
360
|
+
return service
|
361
|
+
])
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# This service provides oftenly used methods like Rails error processing
|
2
|
+
angular.module('maestrano.utilities', []).factory('Utilities', [() ->
|
3
|
+
service = {}
|
4
|
+
|
5
|
+
# Parse a Rails model error and return an array of messages
|
6
|
+
# ready to be displayed
|
7
|
+
service.processRailsError = (error) ->
|
8
|
+
messages = []
|
9
|
+
|
10
|
+
if error.status && error.status == 401
|
11
|
+
messages.push("Sorry! You are not authorized to perform this action")
|
12
|
+
else
|
13
|
+
if error.data && error.data != " "
|
14
|
+
if angular.isArray(error.data)
|
15
|
+
_.each(error.data, (errorMessage) ->
|
16
|
+
capitalizedError = errorMessage.charAt(0).toUpperCase() + errorMessage.slice(1);
|
17
|
+
messages.push("#{capitalizedError}")
|
18
|
+
)
|
19
|
+
else if angular.isObject(error.data)
|
20
|
+
_.each(error.data, (attrErrors, attribute) ->
|
21
|
+
capitalizedAttr = attribute.charAt(0).toUpperCase() + attribute.slice(1);
|
22
|
+
if angular.isArray(attrErrors)
|
23
|
+
_.each(attrErrors, (attrError) ->
|
24
|
+
if capitalizedAttr.match(/base/i)
|
25
|
+
messages.push(attrError)
|
26
|
+
else
|
27
|
+
messages.push("#{capitalizedAttr} #{attrError}")
|
28
|
+
)
|
29
|
+
else
|
30
|
+
if capitalizedAttr.match(/base/i)
|
31
|
+
messages.push(attrErrors)
|
32
|
+
else
|
33
|
+
messages.push("#{capitalizedAttr} #{attrErrors}")
|
34
|
+
)
|
35
|
+
else if angular.isString(error.data)
|
36
|
+
messages.push(error.data)
|
37
|
+
else
|
38
|
+
messages.push("Potentially a system or communication error. Please retry later.")
|
39
|
+
else
|
40
|
+
messages.push("Potentially a system or communication error. Please retry later.")
|
41
|
+
|
42
|
+
return messages
|
43
|
+
|
44
|
+
# Camelize a string
|
45
|
+
service.camelize = (word) ->
|
46
|
+
return word.replace(/(?:^|[-_])(\w)/g
|
47
|
+
, (_, c) ->
|
48
|
+
if c then c.toUpperCase() else ''
|
49
|
+
)
|
50
|
+
|
51
|
+
# Camelize a string for javascript
|
52
|
+
# (camelize with first letter lower case)
|
53
|
+
service.jsCamelize = (word) ->
|
54
|
+
camelized = this.camelize(word)
|
55
|
+
return camelized.charAt(0).toLowerCase() + camelized.slice(1)
|
56
|
+
|
57
|
+
service.capitalize = (word) ->
|
58
|
+
return (word.charAt(0).toUpperCase() + word.slice(1))
|
59
|
+
|
60
|
+
return service
|
61
|
+
])
|
@@ -0,0 +1,59 @@
|
|
1
|
+
angular.module('maestrano.services.marketplace-svc', []).factory('MarketplaceSvc', ['$http','$q', ($http,$q) ->
|
2
|
+
# Configuration
|
3
|
+
service = {}
|
4
|
+
service.routes = {
|
5
|
+
indexPath: -> "/mnoe/jpi/v1/marketplace"
|
6
|
+
showPath: (id) -> "#{service.routes.indexPath()}/#{id}"
|
7
|
+
}
|
8
|
+
|
9
|
+
# No default config for the moment
|
10
|
+
service.defaultConfig = {}
|
11
|
+
|
12
|
+
service.config = {
|
13
|
+
$q: null # The current service promise
|
14
|
+
}
|
15
|
+
|
16
|
+
service.data = {}
|
17
|
+
|
18
|
+
#======================================
|
19
|
+
# Data Management
|
20
|
+
#======================================
|
21
|
+
# Configure the service
|
22
|
+
service.configure = (opts) ->
|
23
|
+
angular.copy(opts,service.config)
|
24
|
+
angular.extend(service.config,service.defaultConfig)
|
25
|
+
|
26
|
+
# Load the organization details
|
27
|
+
# Document structure
|
28
|
+
# :categories(all app categories)
|
29
|
+
# :apps
|
30
|
+
# [{
|
31
|
+
# :id, :name, :stack, :key_benefits,
|
32
|
+
# :is_responsive, :is_star_ready, :is_connec_ready,
|
33
|
+
# :description, :testimonials, :pictures, :tutorial_page
|
34
|
+
# }]
|
35
|
+
#
|
36
|
+
service.load = (force = false) ->
|
37
|
+
self = service
|
38
|
+
if !self.config.$q? || force
|
39
|
+
self.config.$q = $http.get(self.routes.indexPath()).then (success) ->
|
40
|
+
angular.copy(success.data,self.data)
|
41
|
+
|
42
|
+
return self.config.$q
|
43
|
+
|
44
|
+
# Force the service to reload
|
45
|
+
service.reload = ->
|
46
|
+
self.load(true).then(self.startAutoRefresh)
|
47
|
+
|
48
|
+
# Setup the service
|
49
|
+
# A load is only triggered if the service does not have
|
50
|
+
# a promise already
|
51
|
+
# To force a service reload, use the 'reload' function
|
52
|
+
service.setup = (configOpts = {})->
|
53
|
+
self = service
|
54
|
+
if !self.config.$q?
|
55
|
+
self.configure(configOpts)
|
56
|
+
self.load(true)
|
57
|
+
|
58
|
+
return service
|
59
|
+
])
|