TEZ-3020. Tez UI 2: Add entity blueprint (sree)
Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/72a10602 Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/72a10602 Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/72a10602 Branch: refs/heads/TEZ-2980 Commit: 72a10602bf08076a1a5fd292601ba45314fb07c4 Parents: 95c13aa Author: Sreenath Somarajapuram <s...@apache.org> Authored: Wed Dec 30 20:51:21 2015 +0530 Committer: Sreenath Somarajapuram <s...@apache.org> Committed: Thu Feb 25 03:31:59 2016 +0530 ---------------------------------------------------------------------- TEZ-2980-CHANGES.txt | 1 + tez-ui2/src/main/webapp/app/entities/entity.js | 22 +++++++++++ .../main/webapp/app/initializers/entities.js | 28 ++++++++++++++ tez-ui2/src/main/webapp/blueprints/.jshintrc | 6 +++ .../files/tests/unit/entities/__name__-test.js | 30 +++++++++++++++ .../main/webapp/blueprints/entity-test/index.js | 35 +++++++++++++++++ .../entity/files/app/entities/__name__.js | 22 +++++++++++ .../src/main/webapp/blueprints/entity/index.js | 31 +++++++++++++++ tez-ui2/src/main/webapp/package.json | 2 + .../tests/unit/initializers/entities-test.js | 40 ++++++++++++++++++++ 10 files changed, 217 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tez/blob/72a10602/TEZ-2980-CHANGES.txt ---------------------------------------------------------------------- diff --git a/TEZ-2980-CHANGES.txt b/TEZ-2980-CHANGES.txt index e3fece1..da361d6 100644 --- a/TEZ-2980-CHANGES.txt +++ b/TEZ-2980-CHANGES.txt @@ -5,3 +5,4 @@ ALL CHANGES: TEZ-3018. Tez UI 2: Add config.env TEZ-3019. Tez UI 2: Replace BaseURL with Host TEZ-2984. Tez UI 2: Create abstract classes + TEZ-3020. Tez UI 2: Add entity blueprint http://git-wip-us.apache.org/repos/asf/tez/blob/72a10602/tez-ui2/src/main/webapp/app/entities/entity.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/entities/entity.js b/tez-ui2/src/main/webapp/app/entities/entity.js new file mode 100644 index 0000000..3d858c8 --- /dev/null +++ b/tez-ui2/src/main/webapp/app/entities/entity.js @@ -0,0 +1,22 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Ember from 'ember'; + +export default Ember.ObjectProxy.extend({ +}); http://git-wip-us.apache.org/repos/asf/tez/blob/72a10602/tez-ui2/src/main/webapp/app/initializers/entities.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/initializers/entities.js b/tez-ui2/src/main/webapp/app/initializers/entities.js new file mode 100644 index 0000000..86d796c --- /dev/null +++ b/tez-ui2/src/main/webapp/app/initializers/entities.js @@ -0,0 +1,28 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import registerWithContainer from "ember-cli-auto-register/register"; + +export function initialize(application) { + registerWithContainer("entity", application); +} + +export default { + name: 'entities', + initialize +}; http://git-wip-us.apache.org/repos/asf/tez/blob/72a10602/tez-ui2/src/main/webapp/blueprints/.jshintrc ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/blueprints/.jshintrc b/tez-ui2/src/main/webapp/blueprints/.jshintrc new file mode 100644 index 0000000..33f4f6f --- /dev/null +++ b/tez-ui2/src/main/webapp/blueprints/.jshintrc @@ -0,0 +1,6 @@ +{ + "predef": [ + "console" + ], + "strict": false +} http://git-wip-us.apache.org/repos/asf/tez/blob/72a10602/tez-ui2/src/main/webapp/blueprints/entity-test/files/tests/unit/entities/__name__-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/blueprints/entity-test/files/tests/unit/entities/__name__-test.js b/tez-ui2/src/main/webapp/blueprints/entity-test/files/tests/unit/entities/__name__-test.js new file mode 100644 index 0000000..179c5e5 --- /dev/null +++ b/tez-ui2/src/main/webapp/blueprints/entity-test/files/tests/unit/entities/__name__-test.js @@ -0,0 +1,30 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('entitie:<%= dasherizedModuleName %>', '<%= friendlyTestDescription %>', { + // Specify the other units that are required for this test. + // needs: ['entitie:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let adapter = this.subject(); + assert.ok(adapter); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/72a10602/tez-ui2/src/main/webapp/blueprints/entity-test/index.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/blueprints/entity-test/index.js b/tez-ui2/src/main/webapp/blueprints/entity-test/index.js new file mode 100644 index 0000000..d89d9cd --- /dev/null +++ b/tez-ui2/src/main/webapp/blueprints/entity-test/index.js @@ -0,0 +1,35 @@ +/*jshint node:true*/ + +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +var testInfo = require('ember-cli-test-info'); + +module.exports = { + description: 'Generate an entity unit test.', + + locals: function(options) { + return { + friendlyTestDescription: testInfo.description(options.entity.name, "Unit", "Entity") + }; + }, + + // afterInstall: function(options) { + // // Perform extra work here. + // } +}; http://git-wip-us.apache.org/repos/asf/tez/blob/72a10602/tez-ui2/src/main/webapp/blueprints/entity/files/app/entities/__name__.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/blueprints/entity/files/app/entities/__name__.js b/tez-ui2/src/main/webapp/blueprints/entity/files/app/entities/__name__.js new file mode 100644 index 0000000..334868e --- /dev/null +++ b/tez-ui2/src/main/webapp/blueprints/entity/files/app/entities/__name__.js @@ -0,0 +1,22 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Entity from './entity'; + +export default Entity.extend({ +}); http://git-wip-us.apache.org/repos/asf/tez/blob/72a10602/tez-ui2/src/main/webapp/blueprints/entity/index.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/blueprints/entity/index.js b/tez-ui2/src/main/webapp/blueprints/entity/index.js new file mode 100644 index 0000000..24e25ef --- /dev/null +++ b/tez-ui2/src/main/webapp/blueprints/entity/index.js @@ -0,0 +1,31 @@ +/*jshint node:true*/ + +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module.exports = { + description: 'Generate and entity', + + locals: function(options) { + return {}; + } + + // afterInstall: function(options) { + // // Perform extra work here. + // } +}; http://git-wip-us.apache.org/repos/asf/tez/blob/72a10602/tez-ui2/src/main/webapp/package.json ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/package.json b/tez-ui2/src/main/webapp/package.json index da85316..c5ab3d0 100644 --- a/tez-ui2/src/main/webapp/package.json +++ b/tez-ui2/src/main/webapp/package.json @@ -25,6 +25,7 @@ "broccoli-asset-rev": "^2.2.0", "ember-cli": "1.13.13", "ember-cli-app-version": "^1.0.0", + "ember-cli-auto-register": "^1.1.0", "ember-cli-babel": "^5.1.5", "ember-cli-content-security-policy": "0.4.0", "ember-cli-dependency-checker": "^1.1.0", @@ -33,6 +34,7 @@ "ember-cli-qunit": "^1.0.4", "ember-cli-release": "0.2.8", "ember-cli-sri": "^1.2.0", + "ember-cli-test-info": "^1.0.0", "ember-cli-uglify": "^1.2.0", "ember-data": "2.1.0", "ember-disable-proxy-controllers": "^1.0.1", http://git-wip-us.apache.org/repos/asf/tez/blob/72a10602/tez-ui2/src/main/webapp/tests/unit/initializers/entities-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/initializers/entities-test.js b/tez-ui2/src/main/webapp/tests/unit/initializers/entities-test.js new file mode 100644 index 0000000..ea54a11 --- /dev/null +++ b/tez-ui2/src/main/webapp/tests/unit/initializers/entities-test.js @@ -0,0 +1,40 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Ember from 'ember'; +import EntitiesInitializer from '../../../initializers/entities'; +import { module, test } from 'qunit'; + +let application; + +module('Unit | Initializer | entities', { + beforeEach() { + Ember.run(function() { + application = Ember.Application.create(); + application.deferReadiness(); + }); + } +}); + +// Replace this with your real tests. +test('it works', function(assert) { + EntitiesInitializer.initialize(application); + + // you would normally confirm the results of the initializer here + assert.ok(true); +});