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,180 @@
|
|
1
|
+
angular.module('maestrano.services.dashboard.team-svc', []).factory('DhbTeamSvc', ['$http','$q','$window', ($http,$q,$window) ->
|
2
|
+
# Configuration
|
3
|
+
service = {}
|
4
|
+
service.routes = {
|
5
|
+
basePath: -> "/mnoe/jpi/v1/organizations/#{service.config.id}/teams"
|
6
|
+
loadPath: -> "#{service.routes.basePath()}"
|
7
|
+
createPath: -> "#{service.routes.basePath()}"
|
8
|
+
showPath: (id) -> "/mnoe/jpi/v1/teams/#{id}"
|
9
|
+
updatePath: (id) -> service.routes.showPath(id)
|
10
|
+
addMembersPath: (id) -> "#{service.routes.showPath(id)}/add_users"
|
11
|
+
removeMembersPath: (id) -> "#{service.routes.showPath(id)}/remove_users"
|
12
|
+
destroyPath: (id) -> service.routes.showPath(id)
|
13
|
+
}
|
14
|
+
|
15
|
+
service.defaultConfig = {
|
16
|
+
delay: 1000 * 60 * 2 # minutes - long polling delay
|
17
|
+
}
|
18
|
+
|
19
|
+
service.config = {
|
20
|
+
id: null, # The organization id to load
|
21
|
+
timerId: null, # The current timer id (used for long polling)
|
22
|
+
$q: null # The current service promise
|
23
|
+
}
|
24
|
+
|
25
|
+
service.data = []
|
26
|
+
|
27
|
+
#======================================
|
28
|
+
# Data Management
|
29
|
+
#======================================
|
30
|
+
# Return the id of the currently loaded/loading organization
|
31
|
+
service.getId = ->
|
32
|
+
service.config.id
|
33
|
+
|
34
|
+
# Configure the service
|
35
|
+
service.configure = (opts) ->
|
36
|
+
angular.copy(opts,service.config)
|
37
|
+
angular.extend(service.config,service.defaultConfig)
|
38
|
+
|
39
|
+
# Load the organization details
|
40
|
+
# Document structure
|
41
|
+
# :team(s)
|
42
|
+
# :id
|
43
|
+
# :name
|
44
|
+
# :users(array)
|
45
|
+
# [:id, :name, :surname]
|
46
|
+
# :app_instances(array)
|
47
|
+
# [:id, :name, :logo]
|
48
|
+
#
|
49
|
+
service.load = (force = false) ->
|
50
|
+
self = service
|
51
|
+
if !self.config.$q? || force
|
52
|
+
self.config.$q = $http.get(self.routes.loadPath()).then (success) ->
|
53
|
+
angular.copy(success.data.teams,self.data)
|
54
|
+
|
55
|
+
return self.config.$q
|
56
|
+
|
57
|
+
# Start data auto refresh for the service
|
58
|
+
service.startAutoRefresh = ->
|
59
|
+
self = service
|
60
|
+
unless self.config.timerId?
|
61
|
+
self.config.timerId = $window.setInterval((-> self.load(true)),self.config.delay)
|
62
|
+
|
63
|
+
# Stop data auto refresh for the service
|
64
|
+
service.stopAutoRefresh = ->
|
65
|
+
self = service
|
66
|
+
if self.config.timerId?
|
67
|
+
$window.clearInterval(self.config.timerId)
|
68
|
+
self.config.timerId = null
|
69
|
+
|
70
|
+
# Force the service to reload
|
71
|
+
service.reload = ->
|
72
|
+
self.stopAutoRefresh()
|
73
|
+
self.load(true).then(self.startAutoRefresh)
|
74
|
+
|
75
|
+
# Setup the service
|
76
|
+
# A full reload is only performed if the orga id
|
77
|
+
# passed in the configOpts is different from the one
|
78
|
+
# currently used
|
79
|
+
# To force a service reload, use the 'reload' function
|
80
|
+
service.setup = (configOpts = service.config)->
|
81
|
+
self = service
|
82
|
+
if configOpts.id != self.config.id
|
83
|
+
self.stopAutoRefresh()
|
84
|
+
self.configure(configOpts)
|
85
|
+
self.load(true).then(self.startAutoRefresh)
|
86
|
+
|
87
|
+
|
88
|
+
#======================================
|
89
|
+
# Team Management
|
90
|
+
#======================================
|
91
|
+
service.team = {}
|
92
|
+
|
93
|
+
# Create a new team
|
94
|
+
# opts = { name: "SomeName" }
|
95
|
+
service.team.create = (opts) ->
|
96
|
+
self = service
|
97
|
+
data = { team: opts }
|
98
|
+
q = $http.post(self.routes.createPath(),data).then (success)->
|
99
|
+
self.data.push(success.data.team)
|
100
|
+
success.data.team
|
101
|
+
|
102
|
+
return q
|
103
|
+
|
104
|
+
# Edit the details on a given organization
|
105
|
+
# opts = { name: "SomeName", app_instances: [{id: 3}] }
|
106
|
+
service.team.update = (teamId,opts) ->
|
107
|
+
self = service
|
108
|
+
data = { team: opts }
|
109
|
+
q = $http.put(self.routes.updatePath(teamId),data).then (success)->
|
110
|
+
team = _.find(self.data, (t) -> t.id == teamId)
|
111
|
+
angular.copy(success.data.team,team)
|
112
|
+
|
113
|
+
return q
|
114
|
+
|
115
|
+
# Destroy a team
|
116
|
+
service.team.destroy = (teamId) ->
|
117
|
+
self = service
|
118
|
+
q = $http.delete(self.routes.destroyPath(teamId)).then (success)->
|
119
|
+
team = _.find(self.data, (t) -> t.id == teamId)
|
120
|
+
idx = self.data.indexOf(team)
|
121
|
+
self.data.splice(idx,1)
|
122
|
+
team
|
123
|
+
|
124
|
+
#======================================
|
125
|
+
# Member Management
|
126
|
+
#======================================
|
127
|
+
service.members = {}
|
128
|
+
# Accept an array of user objects
|
129
|
+
# [{ id: 1 }]
|
130
|
+
# Or
|
131
|
+
# an array of user id
|
132
|
+
# Or
|
133
|
+
# (not yet implemented) a single email address
|
134
|
+
# Or
|
135
|
+
# (not yet implemented) a an array of email addresses
|
136
|
+
# Or
|
137
|
+
# (not yet implemented) a newline separated list of email addresses
|
138
|
+
service.members.add = (teamId, members) ->
|
139
|
+
self = service
|
140
|
+
baseList = members
|
141
|
+
|
142
|
+
finalList = []
|
143
|
+
_.each baseList, (e) ->
|
144
|
+
if angular.isObject(e)
|
145
|
+
finalList.push(e)
|
146
|
+
else
|
147
|
+
finalList.push({id: e})
|
148
|
+
|
149
|
+
data = { team: { users: finalList } }
|
150
|
+
q = $http.put(self.routes.addMembersPath(teamId), data).then (success)->
|
151
|
+
team = _.find(self.data, (t) -> t.id == teamId)
|
152
|
+
angular.copy(success.data.team.users,team.users)
|
153
|
+
|
154
|
+
return q
|
155
|
+
|
156
|
+
# Remove a member from an organization
|
157
|
+
# Accept an array of user objects
|
158
|
+
# [{ id: 1 }]
|
159
|
+
# Or
|
160
|
+
# an array of user id
|
161
|
+
service.members.remove = (teamId, members) ->
|
162
|
+
self = service
|
163
|
+
baseList = members
|
164
|
+
|
165
|
+
finalList = []
|
166
|
+
_.each baseList, (e) ->
|
167
|
+
if angular.isObject(e)
|
168
|
+
finalList.push(e)
|
169
|
+
else
|
170
|
+
finalList.push({id: e})
|
171
|
+
|
172
|
+
data = { team: { users: finalList } }
|
173
|
+
q = $http.put(self.routes.removeMembersPath(teamId),data).then (success)->
|
174
|
+
team = _.find(self.data, (t) -> t.id == teamId)
|
175
|
+
angular.copy(success.data.team.users,team.users)
|
176
|
+
|
177
|
+
return q
|
178
|
+
|
179
|
+
return service
|
180
|
+
])
|
@@ -0,0 +1,109 @@
|
|
1
|
+
angular.module('maestrano.services.dashboard.tickets-svc', []).factory('DhbTicketsSvc', ['$http','$q','$window', ($http,$q,$window) ->
|
2
|
+
# Configuration
|
3
|
+
service = {}
|
4
|
+
service.routes = {
|
5
|
+
basePath: -> "/mnoe/jpi/v1/dashboard/user"
|
6
|
+
loadPath: -> "#{service.routes.basePath()}/tickets"
|
7
|
+
createPath: -> "#{service.routes.basePath()}/tickets"
|
8
|
+
updatePath: (ticket) -> "#{service.routes.basePath()}/tickets/#{ticket.id}"
|
9
|
+
}
|
10
|
+
|
11
|
+
service.defaultConfig = {
|
12
|
+
delay: 2000 * 60 # seconds - long polling delay
|
13
|
+
}
|
14
|
+
|
15
|
+
service.config = {
|
16
|
+
bootstraped: false, # Hasn't been loaded at least once
|
17
|
+
timerId: null, # The current timer id (used for long polling)
|
18
|
+
$q: null # The current service promise
|
19
|
+
}
|
20
|
+
|
21
|
+
service.data = {}
|
22
|
+
|
23
|
+
#======================================
|
24
|
+
# Data Management
|
25
|
+
#======================================
|
26
|
+
# Return true if the service has been loaded at leaste once
|
27
|
+
service.isBootstraped = ->
|
28
|
+
service.config.bootstraped
|
29
|
+
|
30
|
+
# Configure the service
|
31
|
+
service.configure = (opts) ->
|
32
|
+
angular.copy(opts,service.config)
|
33
|
+
angular.extend(service.config,service.defaultConfig)
|
34
|
+
|
35
|
+
# Load the tickets details
|
36
|
+
service.load = (force = false) ->
|
37
|
+
self = service
|
38
|
+
if !self.config.$q? || force
|
39
|
+
self.config.$q = $http.get(self.routes.loadPath()).then (success) ->
|
40
|
+
angular.copy(success.data,self.data)
|
41
|
+
|
42
|
+
return self.config.$q
|
43
|
+
|
44
|
+
# Start data auto refresh for the service
|
45
|
+
service.startAutoRefresh = ->
|
46
|
+
self = service
|
47
|
+
unless self.config.timerId?
|
48
|
+
self.config.timerId = $window.setInterval((-> self.load(true)),self.config.delay)
|
49
|
+
|
50
|
+
# Stop data auto refresh for the service
|
51
|
+
service.stopAutoRefresh = ->
|
52
|
+
self = service
|
53
|
+
if self.config.timerId?
|
54
|
+
$window.clearInterval(self.config.timerId)
|
55
|
+
self.config.timerId = null
|
56
|
+
|
57
|
+
# Force the service to reload
|
58
|
+
service.reload = ->
|
59
|
+
self.stopAutoRefresh()
|
60
|
+
self.load(true).then(self.startAutoRefresh)
|
61
|
+
|
62
|
+
# Setup the service
|
63
|
+
# A full reload is only performed if the user id
|
64
|
+
# passed in the configOpts is different from the one
|
65
|
+
# currently used
|
66
|
+
# To force a service reload, use the 'reload' function
|
67
|
+
service.setup = (configOpts = service.config)->
|
68
|
+
self = service
|
69
|
+
self.stopAutoRefresh()
|
70
|
+
self.configure(configOpts)
|
71
|
+
self.load(true).then(self.startAutoRefresh)
|
72
|
+
|
73
|
+
service.createTicket = (opts) ->
|
74
|
+
self = service
|
75
|
+
data = opts
|
76
|
+
q = $http.post(self.routes.createPath(),data).then (success)->
|
77
|
+
ticket = success.data
|
78
|
+
self.data["ticket#{ticket.id}"] = ticket
|
79
|
+
return q
|
80
|
+
|
81
|
+
service.postComment = (ticket,model) ->
|
82
|
+
self = service
|
83
|
+
opts = { transformRequest: angular.identity, headers: {'Content-Type': undefined} }
|
84
|
+
data = new FormData()
|
85
|
+
data.append('comment',model.comment)
|
86
|
+
if model.attachment
|
87
|
+
data.append('attachment',model.attachment)
|
88
|
+
q = $http.put(self.routes.updatePath(ticket),data,opts).then (success) ->
|
89
|
+
self.data["ticket#{ticket.id}"].comments.push(success.data)
|
90
|
+
return q
|
91
|
+
|
92
|
+
|
93
|
+
#======================================
|
94
|
+
# Organization Management
|
95
|
+
#======================================
|
96
|
+
#service.organization = {}
|
97
|
+
|
98
|
+
# Edit the details on a given organization
|
99
|
+
# opts = { name: "SomeName", soa_enabled: true }
|
100
|
+
#service.organization.update = (opts) ->
|
101
|
+
#self = service
|
102
|
+
#data = { organization: opts }
|
103
|
+
#q = $http.put(self.routes.updatePath(),data).then (success)->
|
104
|
+
#angular.copy(success.data.organization,self.data.organization)
|
105
|
+
|
106
|
+
#return q
|
107
|
+
|
108
|
+
return service
|
109
|
+
])
|
@@ -0,0 +1,35 @@
|
|
1
|
+
angular
|
2
|
+
.module('maestrano.services.impac-config-svc', [])
|
3
|
+
.service('ImpacConfigSvc' , ($log, $q, CurrentUserSvc, DhbOrganizationSvc) ->
|
4
|
+
|
5
|
+
@getUserData = ->
|
6
|
+
deferred = $q.defer()
|
7
|
+
id = CurrentUserSvc.getUserData()
|
8
|
+
if id
|
9
|
+
deferred.resolve(id)
|
10
|
+
else
|
11
|
+
$log.error(err = {msg: "Unable to retrieve user data"})
|
12
|
+
deferred.reject(err)
|
13
|
+
|
14
|
+
return deferred.promise
|
15
|
+
|
16
|
+
@getOrganizations = ->
|
17
|
+
deferred = $q.defer()
|
18
|
+
|
19
|
+
DhbOrganizationSvc.load().then (success) ->
|
20
|
+
currentOrgId = DhbOrganizationSvc.getId()
|
21
|
+
|
22
|
+
CurrentUserSvc.getOrganizations().then (orgs) ->
|
23
|
+
userOrgs = orgs
|
24
|
+
currentOrgId ||= orgs[0].id if orgs.length > 0
|
25
|
+
|
26
|
+
if userOrgs && currentOrgId
|
27
|
+
deferred.resolve({organizations: userOrgs, currentOrgId: currentOrgId})
|
28
|
+
else
|
29
|
+
$log.error(err = {msg: "Unable to retrieve user organizations"})
|
30
|
+
deferred.reject(err)
|
31
|
+
|
32
|
+
return deferred.promise
|
33
|
+
|
34
|
+
return @
|
35
|
+
)
|
data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-apps-list-helper.js.coffee
ADDED
@@ -0,0 +1,337 @@
|
|
1
|
+
angular.module('maestrano.services.apps-list-helper', []).factory( 'AppsListHelper', [
|
2
|
+
'AssetPath','$window','MsgBus'
|
3
|
+
(AssetPath,$window,MsgBus) ->
|
4
|
+
|
5
|
+
service = {}
|
6
|
+
|
7
|
+
class AppsListHelperClass
|
8
|
+
constructor: (@controlType) ->
|
9
|
+
self = this
|
10
|
+
|
11
|
+
actionProgressClass: (instance) ->
|
12
|
+
realStatus = instance.status
|
13
|
+
realStatus = 'provisioning' if realStatus == 'staged'
|
14
|
+
realStatus = 'starting' if realStatus == 'restarting'
|
15
|
+
realStatus = 'terminated' unless realStatus
|
16
|
+
|
17
|
+
if realStatus == 'updating'
|
18
|
+
return "progress-mno-warning progress-striped active"
|
19
|
+
else if realStatus == 'running'
|
20
|
+
return "progress-mno-success"
|
21
|
+
else if realStatus == 'starting' || realStatus == 'provisioning'
|
22
|
+
return "progress-mno-success progress-striped active"
|
23
|
+
else if realStatus == 'terminating'
|
24
|
+
return "progress-mno-danger progress-striped active"
|
25
|
+
else if realStatus == 'terminated'
|
26
|
+
return "progress-mno-danger"
|
27
|
+
else if realStatus == 'stopping'
|
28
|
+
return "progress-mno-none progress-striped active"
|
29
|
+
else
|
30
|
+
# includes "stopping" and "stopped" state
|
31
|
+
return "progress-mno-none"
|
32
|
+
|
33
|
+
# Return the action progression in percent
|
34
|
+
# unit: specifies the unit that should be appended
|
35
|
+
# to the result. If null then the result is an integer.
|
36
|
+
# Eg. actionProgress(intance, '%') -> 95%
|
37
|
+
actionProgress: (instance, unit = null) ->
|
38
|
+
# Get out of there if the bar is not shown
|
39
|
+
if !this.isProgressBarShown(instance)
|
40
|
+
return 0
|
41
|
+
|
42
|
+
# Get the relevant status from an actionProgress
|
43
|
+
# point of view
|
44
|
+
realStatus = instance.status
|
45
|
+
realStatus = 'provisioning' if realStatus == 'staged'
|
46
|
+
realStatus = 'starting' if realStatus == 'restarting'
|
47
|
+
realStatus = 'terminated' unless realStatus
|
48
|
+
|
49
|
+
if (realStatus == 'stopped' || realStatus == 'running' || realStatus == 'terminated')
|
50
|
+
percent = 100
|
51
|
+
percent = "#{percent}#{unit}" if unit?
|
52
|
+
return percent
|
53
|
+
else if realStatus == 'updating'
|
54
|
+
percent = 70
|
55
|
+
percent = "#{percent}#{unit}" if unit?
|
56
|
+
return percent
|
57
|
+
|
58
|
+
# Get the maxDuration (seconds) and referenceField based on
|
59
|
+
# the action being performed
|
60
|
+
maxDuration = instance.durations[realStatus]
|
61
|
+
referenceField = {
|
62
|
+
'provisioning': 'createdAt',
|
63
|
+
'starting': 'startedAt',
|
64
|
+
'stopping': 'stoppedAt',
|
65
|
+
'terminating': 'terminatedAt'
|
66
|
+
}[realStatus]
|
67
|
+
|
68
|
+
# Get the action elapsed time in seconds
|
69
|
+
startTime = new Date(instance[referenceField])
|
70
|
+
endTime = new Date((new Date()).getTime() - $window.clientTimeOffset) #remove Client-Server time offset
|
71
|
+
elapsedTime = (endTime.getTime() - startTime.getTime()) / 1000
|
72
|
+
|
73
|
+
# Calculate the percentage
|
74
|
+
# Max value is 95% / Min value is 5%
|
75
|
+
percent = Math.round((elapsedTime / maxDuration)*100)
|
76
|
+
percent = Math.min(percent, 95)
|
77
|
+
percent = Math.max(percent, 5)
|
78
|
+
percent = "#{percent}#{unit}" if unit?
|
79
|
+
return percent
|
80
|
+
|
81
|
+
ownerLabelFor: (instance) ->
|
82
|
+
return {
|
83
|
+
'User': 'You',
|
84
|
+
'Organization': instance.ownerLabel
|
85
|
+
}[instance.ownerType]
|
86
|
+
|
87
|
+
isAppActionUrlEnabled: (instance) ->
|
88
|
+
return (instance && instance.status != 'terminating' && instance.status != 'terminated')
|
89
|
+
|
90
|
+
appActionUrl: (instance) ->
|
91
|
+
"/mnoe/launch/#{instance.uid}"
|
92
|
+
|
93
|
+
appLoaderPath: (instance) ->
|
94
|
+
if instance.status == 'running'
|
95
|
+
AssetPath['loaders/app_label_running.png']
|
96
|
+
else if instance.status == 'starting' || instance.status == 'staged' || instance.status == 'provisioning'
|
97
|
+
AssetPath['loaders/app_label_starting.gif']
|
98
|
+
else if instance.status == 'stopping'
|
99
|
+
AssetPath['loaders/app_label_stopping.gif']
|
100
|
+
else if instance.status == 'stopped'
|
101
|
+
AssetPath['loaders/app_label_stopped.png']
|
102
|
+
else if instance.status == 'terminating'
|
103
|
+
AssetPath['loaders/app_label_terminating.gif']
|
104
|
+
else if instance.status == 'terminated'
|
105
|
+
AssetPath['loaders/app_label_terminated.png']
|
106
|
+
else # upgrading/downgrading/updating etc.
|
107
|
+
AssetPath['loaders/app_label_stopping.gif']
|
108
|
+
|
109
|
+
appLoaderStatus: (instance) ->
|
110
|
+
if instance.status == 'running'
|
111
|
+
return '<span class="mgreen">online</span>'
|
112
|
+
else if instance.status == 'starting'
|
113
|
+
return '<span class="mgreen">loading</span>'
|
114
|
+
else if instance.status == 'staged' || instance.status == 'provisioning'
|
115
|
+
return '<span class="mgreen">preparing</span>'
|
116
|
+
else if instance.status == 'stopping'
|
117
|
+
return '<span class="text-warning">idling</span>'
|
118
|
+
else if instance.status == 'stopped'
|
119
|
+
return '<span class="mgrey">offline</span>'
|
120
|
+
else if instance.status == 'terminating'
|
121
|
+
return '<span class="mred">terminating</span>'
|
122
|
+
else if instance.status == 'terminated'
|
123
|
+
return '<span class="mred">terminated</span>'
|
124
|
+
else # upgrading/downgrading/updating etc.
|
125
|
+
return "<span class='text-warning'>#{instance.status}</span>"
|
126
|
+
|
127
|
+
isLaunchHidden: (instance) ->
|
128
|
+
instance.status == 'terminating' ||
|
129
|
+
instance.status == 'terminated' ||
|
130
|
+
this.isOauthConnectBtnShown(instance) ||
|
131
|
+
this.isNewOfficeApp(instance)
|
132
|
+
|
133
|
+
# Deprecated?
|
134
|
+
isStartShown: (instance) ->
|
135
|
+
if instance.stack? && instance.stack.match(/^(cloud|connector)$/i)
|
136
|
+
return false
|
137
|
+
else
|
138
|
+
(@controlType == 'ops' || @controlType == 'dashboard') &&
|
139
|
+
instance &&
|
140
|
+
instance.canStart &&
|
141
|
+
instance.status == 'stopped'
|
142
|
+
|
143
|
+
# Deprecated?
|
144
|
+
isStopShown: (instance) ->
|
145
|
+
if instance.stack? && instance.stack.match(/^(cloud|connector)$/i)
|
146
|
+
return false
|
147
|
+
else
|
148
|
+
(@controlType == 'ops' || @controlType == 'dashboard') &&
|
149
|
+
instance &&
|
150
|
+
instance.billingType == 'hourly' &&
|
151
|
+
instance.canStop &&
|
152
|
+
instance.status == 'running'
|
153
|
+
|
154
|
+
isTimerButtonShown: (instance) ->
|
155
|
+
this.isStopShown(instance) && instance.autostopAt?
|
156
|
+
|
157
|
+
isRestartShown: (instance) ->
|
158
|
+
if instance.stack? && instance.stack.match(/^(cloud|connector)$/i)
|
159
|
+
return false
|
160
|
+
else
|
161
|
+
(@controlType == 'manage' || @controlType == 'dashboard') &&
|
162
|
+
instance &&
|
163
|
+
instance.status == 'running'
|
164
|
+
|
165
|
+
isDeleteShown: (instance) ->
|
166
|
+
(@controlType == 'manage' || @controlType == 'dashboard') &&
|
167
|
+
instance &&
|
168
|
+
instance.canTerminate &&
|
169
|
+
(instance.status == 'stopped' ||
|
170
|
+
instance.status == 'running')
|
171
|
+
|
172
|
+
|
173
|
+
isTransferShown: (instance) ->
|
174
|
+
(@controlType == 'manage' || @controlType == 'dashboard') &&
|
175
|
+
instance &&
|
176
|
+
!instance.personal &&
|
177
|
+
instance.status != 'terminating' &&
|
178
|
+
instance.status != 'terminated' &&
|
179
|
+
instance.canTerminate
|
180
|
+
|
181
|
+
isProgressBarShown: (instance) ->
|
182
|
+
if @controlType == 'dashboard' then return true
|
183
|
+
else
|
184
|
+
@controlType == 'ops' &&
|
185
|
+
instance &&
|
186
|
+
(
|
187
|
+
instance.status == 'staged' ||
|
188
|
+
instance.status == 'provisioning' ||
|
189
|
+
instance.status == 'starting' ||
|
190
|
+
instance.status == 'restarting' ||
|
191
|
+
instance.status == 'stopping' ||
|
192
|
+
instance.status == 'terminating'
|
193
|
+
)
|
194
|
+
|
195
|
+
isChangeGradeShown: (instance) ->
|
196
|
+
if instance.stack? && instance.stack.match(/^(cloud|connector)$/i)
|
197
|
+
return false
|
198
|
+
else
|
199
|
+
(@controlType == 'manage' || @controlType == 'dashboard') &&
|
200
|
+
instance &&
|
201
|
+
instance.status != 'terminating' &&
|
202
|
+
instance.status != 'terminated' &&
|
203
|
+
(
|
204
|
+
!instance.appChangeRequest? ||
|
205
|
+
(instance.appChangeRequest &&
|
206
|
+
instance.appChangeRequest.status == 'performed'
|
207
|
+
)
|
208
|
+
)
|
209
|
+
|
210
|
+
isViewChangeGradeShown: (instance) ->
|
211
|
+
(@controlType == 'manage' || @controlType == 'dashboard') &&
|
212
|
+
instance.status != 'terminating' &&
|
213
|
+
instance.status != 'terminated' &&
|
214
|
+
instance.appChangeRequest &&
|
215
|
+
instance.appChangeRequest.status != 'cancelled'
|
216
|
+
|
217
|
+
classForViewChangeButton: (instance) ->
|
218
|
+
if instance.appChangeRequest
|
219
|
+
status = instance.appChangeRequest.status
|
220
|
+
return 'fbtn fbtn-mini fbtn-success' if status == 'performed'
|
221
|
+
return 'fbtn fbtn-mini fbtn-warning' if status == 'pending' || status == 'performing'
|
222
|
+
|
223
|
+
|
224
|
+
viewChangeGradeLabel: (instance) ->
|
225
|
+
if instance.appChangeRequest
|
226
|
+
status = instance.appChangeRequest.status
|
227
|
+
return 'Recent change' if status == 'performed'
|
228
|
+
return 'Change pending' if status == 'pending'
|
229
|
+
return 'Changing' if status == 'performing'
|
230
|
+
|
231
|
+
isChangeLoadingShown: (instance) ->
|
232
|
+
instance.appChangeRequest && instance.appChangeRequest.status == 'performing'
|
233
|
+
|
234
|
+
isManageActionsShown: (instance) ->
|
235
|
+
this.isChangeGradeShown(instance) ||
|
236
|
+
this.isRestartShown(instance) ||
|
237
|
+
this.isDeleteShown(instance)
|
238
|
+
|
239
|
+
openHelpText: (instance) ->
|
240
|
+
msg = "Open your app in a new tab"
|
241
|
+
if instance.ssoEnabled
|
242
|
+
msg += "<br><br><em>You will automatically be logged in via your maestrano account</em>"
|
243
|
+
else if instance.firstCredentials && instance.firstCredentials.login
|
244
|
+
msg += "<br><br>If this is the first time then use"
|
245
|
+
msg += "<br><b class=\"morange\">Login</b>: #{instance.firstCredentials.login}"
|
246
|
+
if instance.firstCredentials.password
|
247
|
+
msg += "<br><b class=\"morange\">Password</b>: #{instance.firstCredentials.password}"
|
248
|
+
else
|
249
|
+
msg += "<br><b class=\"morange\">Password</b>: <em>Leave blank</em>"
|
250
|
+
return msg
|
251
|
+
|
252
|
+
kcPath: (instance) ->
|
253
|
+
"/knowledge_center/apps/#{instance.appId}"
|
254
|
+
|
255
|
+
isOverlayRequired: (instance) ->
|
256
|
+
instance.stack == 'connector'
|
257
|
+
|
258
|
+
isQuickBooksConnectShown: (instance) ->
|
259
|
+
instance.stack == 'connector' && instance.app_nid == 'quickbooks' && !instance.oauth_keys_valid
|
260
|
+
|
261
|
+
isXeroConnectShown: (instance) ->
|
262
|
+
instance.stack == 'connector' && instance.app_nid == 'xero' && !instance.oauth_keys_valid
|
263
|
+
|
264
|
+
isMYOBConnectShown: (instance) ->
|
265
|
+
instance.stack == 'connector' && instance.app_nid == 'myob' && !instance.oauth_keys_valid
|
266
|
+
|
267
|
+
isOauthConnectBtnShown: (instance) ->
|
268
|
+
instance.app_nid != 'office-365' &&
|
269
|
+
instance.stack == 'connector' &&
|
270
|
+
!instance.oauth_keys_valid
|
271
|
+
|
272
|
+
connectToQuickBooks: (instance) ->
|
273
|
+
instance.status = 'updating'
|
274
|
+
intuit.ipp.anywhere.grantUrl = this.quickbooksGrantUrl(instance) + '?popup=true'
|
275
|
+
intuit.ipp.anywhere.controller.onConnectToIntuitClicked()
|
276
|
+
|
277
|
+
isDataSyncShown: (instance) ->
|
278
|
+
instance.stack == 'connector' && instance.oauth_keys_valid
|
279
|
+
|
280
|
+
isDataDisconnectShown: (instance) ->
|
281
|
+
instance.stack == 'connector' && instance.oauth_keys_valid
|
282
|
+
|
283
|
+
quickbooksGrantUrl: (instance) ->
|
284
|
+
arr = $window.location.href.split("/");
|
285
|
+
url = $window.location.protocol + '//' + arr[2]
|
286
|
+
url += this.dataSyncPath(instance)
|
287
|
+
return url
|
288
|
+
|
289
|
+
isMicrosoftSetupShown: (instance) ->
|
290
|
+
instance.stack == 'connector' && instance.appNid == 'office-365' && (moment(instance.createdAt) > moment().subtract({weeks:2}))
|
291
|
+
|
292
|
+
isNewOfficeApp: (instance) ->
|
293
|
+
newApp = (MsgBus.subscribe('params'))().new_app
|
294
|
+
instance.stack == 'connector' && instance.appNid == 'office-365' && newApp && (moment(instance.createdAt) > moment().subtract({minutes:5}))
|
295
|
+
|
296
|
+
microsoftTrialUrl: (instance) ->
|
297
|
+
return instance.microsoftTrialUrl
|
298
|
+
|
299
|
+
companyName: (instance) ->
|
300
|
+
if instance.stack == 'connector' && instance.oauth_keys_valid && instance.oauth_company_name
|
301
|
+
return instance.oauth_company_name
|
302
|
+
false
|
303
|
+
|
304
|
+
connectorVersion: (instance) ->
|
305
|
+
if instance.stack == 'connector' && instance.oauth_keys_valid && instance.connectorVersion
|
306
|
+
return capitalize(instance.connectorVersion)
|
307
|
+
false
|
308
|
+
|
309
|
+
dataSyncPath: (instance) ->
|
310
|
+
"/mnoe/webhook/oauth/#{instance.uid}/sync"
|
311
|
+
|
312
|
+
oAuthConnectPath: (instance)->
|
313
|
+
"/mnoe/webhook/oauth/#{instance.uid}/authorize"
|
314
|
+
|
315
|
+
dataDisconnectPath: (instance) ->
|
316
|
+
"/mnoe/webhook/oauth/#{instance.uid}/disconnect"
|
317
|
+
|
318
|
+
dataDisconnectClick: (instance) ->
|
319
|
+
$window.location.href = this.dataDisconnectPath(instance)
|
320
|
+
|
321
|
+
myobAccountRightConnectPath: (instance) ->
|
322
|
+
"/webhook/myob/#{instance.uid}/authorize?version=account_right"
|
323
|
+
|
324
|
+
myobEssentialsConnectPath: (instance) ->
|
325
|
+
"/webhook/myob/#{instance.uid}/authorize?version=essentials"
|
326
|
+
|
327
|
+
capitalize = (string) ->
|
328
|
+
string = string.replace("_", " ")
|
329
|
+
string.replace /\w\S*/g, (txt) ->
|
330
|
+
txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()
|
331
|
+
|
332
|
+
service.new = (controlType = 'dashboard') ->
|
333
|
+
return new AppsListHelperClass(controlType)
|
334
|
+
|
335
|
+
return service
|
336
|
+
|
337
|
+
])
|