Skip to content

Commit 090b677

Browse files
committed
[smarcet] - #10167
* survey data tagging / edition [spalenque] - #13074 * merge tags feature [spalenque] - #13075 * stats revamp
1 parent 8a14dd6 commit 090b677

60 files changed

Lines changed: 3197 additions & 196 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,7 @@ auth.json
8888
autocomplete/
8989
*.patch
9090
*.mo
91-
blog
91+
blog
92+
db.ini
93+
env/
94+
*.pyc

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
"jquery-ui": "~1.11.4",
2424
"jquery-validate": "~1.14.0",
2525
"bootstrap": "3.3.6",
26-
"fontawesome": "4.5.0",
27-
"bootstrap-tagsinput": "0.7.1",
26+
"fontawesome": "4.7.0",
27+
"bootstrap-tagsinput": "0.8.0",
2828
"bootstrap-datepicker": "~1.4.0",
2929
"pwstrength-bootstrap": "~1.2.7",
3030
"jquery-cookie": "~1.4.1",

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
],
1010
"require": {
1111
"php": ">=5.3.2",
12-
"silverstripe/cms": "3.1.19",
13-
"silverstripe/framework": "3.1.19",
12+
"silverstripe/cms": "3.1.20",
13+
"silverstripe/framework": "3.1.20",
1414
"ezyang/htmlpurifier": "dev-master",
1515
"undefinedoffset/sortablegridfield": "0.5.4",
1616
"tractorcow/silverstripe-colorpicker": "3.0.*@dev",

marketplace/code/ui/admin/SangriaPageMarketPlaceExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public function ViewOpenStackProductsByRegion(){
165165
Requirements::clear();
166166
// css
167167

168-
Requirements::css('marketplace/ui/source/css/sangria.css');
168+
Requirements::css('sangria/ui/source/css/sangria.css');
169169
Requirements::css("themes/openstack/bower_assets/bootstrap/dist/css/bootstrap.min.css");
170170
Requirements::css("themes/openstack/bower_assets/fontawesome/css/font-awesome.min.css");
171171
Requirements::css('//fonts.googleapis.com/css?family=Open+Sans:300,400,700');

marketplace/ui/source/js/sangria-marketplace-openstack-powered-products/store.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,9 @@ import thunk from 'redux-thunk';
1717
import {openStackPoweredProducts} from './reducers';
1818
import { genericReducers } from "~core-utils/reducers";
1919

20-
/*const createStoreWithMiddleware = applyMiddleware(
21-
thunk,
22-
)(createStore);*/
23-
2420
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
2521

2622
let reducer = reduceReducers(openStackPoweredProducts, genericReducers);
2723
const store = createStore(reducer, composeEnhancers(applyMiddleware(thunk)));
2824

29-
//const store = createStoreWithMiddleware(openStackPoweredProducts);
30-
3125
export default store;

openstack/code/utils/apis/AbstractRestfulJsonApi.php

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,28 @@
1919
abstract class AbstractRestfulJsonApi extends Controller
2020
{
2121

22+
private static $api_prefix = null;
23+
24+
/**
25+
* @return bool
26+
*/
27+
protected function isApiCall()
28+
{
29+
$class = get_class($this);
30+
$request = $this->getRequest();
31+
32+
if (is_null($request)) {
33+
return false;
34+
}
35+
36+
$api_prefix = Config::inst()->get($class, 'api_prefix', Config::UNINHERITED);
37+
38+
if(!empty($api_prefix))
39+
return strpos(strtolower($request->getURL()), $api_prefix) !== false;
40+
41+
return false;
42+
}
43+
2244
/**
2345
* @param string $action
2446
* @return CachedMethod
@@ -158,11 +180,6 @@ public function __construct()
158180
register_shutdown_function(array($this, 'shutdown_function'));
159181
}
160182

161-
/**
162-
* @return mixed
163-
*/
164-
abstract protected function isApiCall();
165-
166183
/**
167184
* @param $realm
168185
* @return SS_HTTPResponse

package.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,23 @@
1515
},
1616
"dependencies": {
1717
"amdefine": "^1.0.0",
18+
"babel-cli": "^6.24.1",
1819
"babel-polyfill": "^6.16.0",
20+
"bootstrap": "3.3.6",
21+
"bootstrap-3-typeahead": "^4.0.2",
22+
"bootstrap-tagsinput": "^0.7.1",
23+
"chart.js": "^2.6.0",
1924
"classnames": "^2.2.5",
25+
"font-awesome": "^4.7.0",
2026
"has-flag": "^2.0.0",
27+
"jquery": "^3.2.1",
2128
"mousetrap": "^1.6.0",
29+
"randomcolor": "^0.5.3",
2230
"react": "^15.4.1",
31+
"react-chartjs2": "^1.1.2",
32+
"react-confirm-bootstrap": "^3.1.4",
2333
"react-dom": "^15.4.1",
34+
"react-modal-bootstrap": "^1.1.1",
2435
"react-redux": "^5.0.5",
2536
"reduce-reducers": "^0.1.2",
2637
"redux-thunk": "^2.2.0",
@@ -37,7 +48,6 @@
3748
"license": "Apache-2.0",
3849
"devDependencies": {
3950
"autoprefixer-loader": "^3.2.0",
40-
"babel": "^6.5.2",
4151
"babel-core": "^6.14.0",
4252
"babel-loader": "^6.2.5",
4353
"babel-polyfill": "^6.16.0",
@@ -46,9 +56,12 @@
4656
"babel-preset-stage-2": "^6.18.0",
4757
"babel-preset-stage-3": "^6.17.0",
4858
"bower": "^1.7.9",
59+
"browser-sync-webpack-plugin": "^1.1.4",
4960
"css-loader": "^0.25.0",
61+
"expose-loader": "^0.7.3",
5062
"extract-text-webpack-plugin": "^1.0.1",
5163
"file-loader": "^0.9.0",
64+
"imports-loader": "^0.7.1",
5265
"json-loader": "^0.5.4",
5366
"less": "^2.7.1",
5467
"less-loader": "^2.2.3",

sangria/_config/routes.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
Name: sangriaroutes
3+
After: 'framework/routes#coreroutes'
4+
---
5+
Director:
6+
rules:
7+
'api/v1/sangria': 'SangriaApi'

sangria/code/SangriaPage.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,19 @@ function init()
4343
Security::permissionFailure();
4444
}
4545
parent::init();
46+
47+
Requirements::css('fonts.googleapis.com/css?family=PT+Sans&subset=latin');
48+
Requirements::css('themes/openstack/css/blueprint/screen.css', 'screen, projection');
49+
Requirements::css('themes/openstack/css/blueprint/print.css', 'print');
50+
Requirements::css('themes/openstack/css/dropdown.css', 'screen, projection, print');
51+
4652
Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
53+
Requirements::css("themes/openstack/javascript/datetimepicker/jquery.datetimepicker.css");
54+
Requirements::css("themes/openstack/css/deployment.survey.page.css");
55+
4756
Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js');
4857
Requirements::javascript('themes/openstack/javascript/jquery.tablednd.js');
49-
Requirements::css("themes/openstack/javascript/datetimepicker/jquery.datetimepicker.css");
5058
Requirements::javascript("themes/openstack/javascript/datetimepicker/jquery.datetimepicker.js");
51-
Requirements::css("themes/openstack/css/deployment.survey.page.css");
5259
Requirements::javascript("themes/openstack/javascript/deployment.survey.filters.js");
5360

5461
self::$default_start_date = date('Y/m/d', strtotime('-1 months')) . ' 00:00';

sangria/code/SangriaPageViewCurrentStoriesExtension.php

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,23 @@
1919
final class SangriaPageViewCurrentStoriesExtension extends Extension
2020
{
2121

22+
static $allowed_actions = [
23+
'ViewCurrentStories',
24+
'UpdateStories',
25+
'SetAdminSS',
26+
'UnPublishFromUserStories',
27+
];
28+
2229
public function onBeforeInit()
2330
{
2431

25-
Config::inst()->update(get_class($this), 'allowed_actions', array(
26-
'ViewCurrentStories',
27-
'UpdateStories',
28-
'SetAdminSS',
29-
'UnPublishFromUserStories',
30-
));
31-
32-
Config::inst()->update(get_class($this->owner), 'allowed_actions', array(
33-
'ViewCurrentStories',
34-
'UpdateStories',
35-
'SetAdminSS',
36-
'UnPublishFromUserStories',
37-
));
32+
Config::inst()->update(get_class($this), 'allowed_actions', self::$allowed_actions);
33+
34+
Config::inst()->update(get_class($this->owner), 'allowed_actions', self::$allowed_actions);
3835
}
3936

4037
public function ViewCurrentStories(){
41-
Requirements::javascript("themes/openstack/javascript/sangria/view.current.stories.js");
38+
Requirements::javascript("sangria/ui/source/UserStories.js");
4239
return $this->owner->Customise(array())->renderWith(array('SangriaPage_ViewCurrentStories','SangriaPage','SangriaPage'));
4340
}
4441

0 commit comments

Comments
 (0)