baseUrl: '<%= BUILD_PATH %>/js/'
preserveLicenseComments: false
- issues: options:
- name: 'apps/issues/app-new'
- out: '<%= ASSETS_PATH %>/js/apps/issues/app-new.js'
-
issuesContext: options:
name: 'apps/issues/app-context'
out: '<%= ASSETS_PATH %>/js/apps/issues/app-context.js'
'build-app:computation'
'build-app:drilldown'
'build-app:groups'
+ 'build-app:issues'
'build-app:maintenance'
'build-app:markdown'
'build-app:measures'
# widgets
'build-widget:issue-filter'
# other
- 'requirejs:issues'
'requirejs:issuesContext'
'requirejs:selectList'
]
+++ /dev/null
-define([
- './models/state',
- './layout',
- './models/issues',
- 'components/navigator/models/facets',
- './models/filters',
- './controller',
- './router',
- './workspace-list-view',
- './workspace-header-view',
- './facets-view',
- './filters-view',
- './helpers/format-facet-value'
-], function (State, Layout, Issues, Facets, Filters, Controller, Router, WorkspaceListView, WorkspaceHeaderView,
- FacetsView, FiltersView) {
-
- var $ = jQuery,
- App = new Marionette.Application(),
- init = function (options) {
- this.state = new State();
- this.list = new Issues();
- this.facets = new Facets();
- this.filters = new Filters();
-
- this.layout = new Layout({ app: this, el: options.el });
- this.layout.render();
- $('#footer').addClass('search-navigator-footer');
-
- this.controller = new Controller({ app: this });
-
- this.issuesView = new WorkspaceListView({
- app: this,
- collection: this.list
- });
- this.layout.workspaceListRegion.show(this.issuesView);
- this.issuesView.bindScrollEvents();
-
- this.workspaceHeaderView = new WorkspaceHeaderView({
- app: this,
- collection: this.list
- });
- this.layout.workspaceHeaderRegion.show(this.workspaceHeaderView);
-
- this.facetsView = new FacetsView({
- app: this,
- collection: this.facets
- });
- this.layout.facetsRegion.show(this.facetsView);
-
- this.filtersView = new FiltersView({
- app: this,
- collection: this.filters
- });
- this.layout.filtersRegion.show(this.filtersView);
-
- this.controller.fetchFilters().done(function () {
- key.setScope('list');
- App.router = new Router({ app: App });
- Backbone.history.start();
- });
- };
-
- App.on('start', function (options) {
- $.when(window.requestMessages()).done(function () {
- init.call(App, options);
- });
- });
-
- return App;
-
-});
--- /dev/null
+define([
+ './models/state',
+ './layout',
+ './models/issues',
+ 'components/navigator/models/facets',
+ './models/filters',
+ './controller',
+ './router',
+ './workspace-list-view',
+ './workspace-header-view',
+ './facets-view',
+ './filters-view',
+ './helpers/format-facet-value'
+], function (State, Layout, Issues, Facets, Filters, Controller, Router, WorkspaceListView, WorkspaceHeaderView,
+ FacetsView, FiltersView) {
+
+ var $ = jQuery,
+ App = new Marionette.Application(),
+ init = function (options) {
+ this.state = new State();
+ this.list = new Issues();
+ this.facets = new Facets();
+ this.filters = new Filters();
+
+ this.layout = new Layout({ app: this, el: options.el });
+ this.layout.render();
+ $('#footer').addClass('search-navigator-footer');
+
+ this.controller = new Controller({ app: this });
+
+ this.issuesView = new WorkspaceListView({
+ app: this,
+ collection: this.list
+ });
+ this.layout.workspaceListRegion.show(this.issuesView);
+ this.issuesView.bindScrollEvents();
+
+ this.workspaceHeaderView = new WorkspaceHeaderView({
+ app: this,
+ collection: this.list
+ });
+ this.layout.workspaceHeaderRegion.show(this.workspaceHeaderView);
+
+ this.facetsView = new FacetsView({
+ app: this,
+ collection: this.facets
+ });
+ this.layout.facetsRegion.show(this.facetsView);
+
+ this.filtersView = new FiltersView({
+ app: this,
+ collection: this.filters
+ });
+ this.layout.filtersRegion.show(this.filtersView);
+
+ this.controller.fetchFilters().done(function () {
+ key.setScope('list');
+ App.router = new Router({ app: App });
+ Backbone.history.start();
+ });
+ };
+
+ App.on('start', function (options) {
+ $.when(window.requestMessages()).done(function () {
+ init.call(App, options);
+ });
+ });
+
+ return App;
+
+});
<% content_for :extra_script do %>
<script>
- require(['apps/issues/app-new'], function (App) {
+ require(['apps/issues/app'], function (App) {
App.start({ el: '#content' });
});
</script>
--- /dev/null
+{
+ "filter": {
+ "id": 31,
+ "name": "Critical and Blocker Issues",
+ "shared": true,
+ "query": "resolved=false|severities=BLOCKER,CRITICAL",
+ "canModify": true
+ }
+}
],
functionalSuites: [
- 'test/medium/users.spec'
+ 'test/medium/users.spec',
+ 'test/medium/issues.spec'
],
tunnel: tunnel,
--- /dev/null
+define(function (require) {
+ var bdd = require('intern!bdd');
+ require('../helpers/test-page');
+
+ bdd.describe('Issues Page', function () {
+ bdd.describe('Saved Searches', function () {
+ bdd.it('should show list of saved searches', function () {
+ return this.remote
+ .get(require.toUrl('test/medium/base.html'))
+ .setFindTimeout(5000)
+ .mockFromString('/api/l10n/index', '{}')
+ .mockFromFile('/api/issue_filters/app', 'issues-spec/app.json')
+ .mockFromFile('/api/issues/search', 'issues-spec/search.json')
+ .startApp('issues')
+ .assertElementCount('.js-filter', 2)
+ .assertElementCount('.js-filter[data-id="31"]', 1)
+ .assertElementCount('.js-filter[data-id="32"]', 1);
+ });
+
+ bdd.it('should load a saved search', function () {
+ return this.remote
+ .get(require.toUrl('test/medium/base.html'))
+ .setFindTimeout(5000)
+ .mockFromString('/api/l10n/index', '{}')
+ .mockFromFile('/api/issue_filters/app', 'issues-spec/app.json')
+ .mockFromFile('/api/issues/search', 'issues-spec/search.json')
+ .mockFromFile('/api/issue_filters/show/31', 'issues-spec/filter.json')
+ .startApp('issues')
+ .clickElement('.search-navigator-filters-show-list')
+ .clickElement('.js-filter[data-id="31"]')
+ .assertElementCount('.js-filter-copy', 1)
+ .assertElementCount('.js-filter-edit', 1)
+ .assertElementInclude('.issues-filters-name', 'Critical and Blocker Issues')
+ .assertElementCount('.js-facet.active[data-value="BLOCKER"]', 1)
+ .assertElementCount('.js-facet.active[data-value="CRITICAL"]', 1)
+ .assertElementCount('.js-facet.active[data-unresolved]', 1);
+ });
+
+ bdd.it('should load a saved search and then resets it by new search', function () {
+ return this.remote
+ .get(require.toUrl('test/medium/base.html'))
+ .setFindTimeout(5000)
+ .mockFromString('/api/l10n/index', '{}')
+ .mockFromFile('/api/issue_filters/app', 'issues-spec/app.json')
+ .mockFromFile('/api/issues/search', 'issues-spec/search.json')
+ .mockFromFile('/api/issue_filters/show/31', 'issues-spec/filter.json')
+ .startApp('issues')
+ .clickElement('.search-navigator-filters-show-list')
+ .clickElement('.js-filter[data-id="31"]')
+ .assertElementCount('.js-filter-copy', 1)
+ .assertElementCount('.js-filter-edit', 1)
+ .assertElementInclude('.issues-filters-name', 'Critical and Blocker Issues')
+ .assertElementCount('.js-facet.active[data-value="BLOCKER"]', 1)
+ .assertElementCount('.js-facet.active[data-value="CRITICAL"]', 1)
+ .assertElementCount('.js-facet.active[data-unresolved]', 1)
+ .clickElement('.js-new-search')
+ .assertElementCount('.js-facet[data-value="BLOCKER"]:not(.active)', 1)
+ .assertElementCount('.js-facet[data-value="CRITICAL"]:not(.active)', 1)
+ .assertElementCount('.js-facet.active[data-unresolved]', 1)
+ .assertElementNotInclude('.issues-filters-name', 'Critical and Blocker Issues');
+ });
+ });
+ });
+
+});