-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added BackgroundLayer model #581
Open
viatkinviatkin
wants to merge
17
commits into
develop
Choose a base branch
from
add_backgroundLayer
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
75f0ed7
Added BackgroundLayer model
4a56a73
fixed jscs errors
515c396
Без сериализатора
318e90b
Fixed serializers, background-layer component rework
e6567bf
Old integration tests have been removed
2c3df39
Fixed packages protocol settings(github update 15.03)
2a5fa70
canceled integration test changes
dd91be6
canceled base logic changes of map-tools/background-layers
719a45f
removed filtering for background maplayers
c06a42f
added ru locales and model projections
666dc8c
Merge branch 'develop' into add_backgroundLayer
ae74111
fix jscs
92782da
removed filter model.hieararchy to otherLayers and backgroundLayers
ae0bc9b
removed securityKey field
205100a
backgroundLayers are loaded synchronously with the map model
a14aeeb
jscs error correction
4b3241e
changed backgroundLayer path in flexberry-maplayer-actions-handler
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
addon/locales/en/models/new-platform-flexberry-g-i-s-background-layer.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
export default { | ||
projections: { | ||
BackgroundLayerE: { | ||
}, | ||
BackgroundLayerL: { | ||
name: { | ||
__caption__: 'name' | ||
}, | ||
description: { | ||
__caption__: 'description' | ||
}, | ||
keyWords: { | ||
__caption__: 'keyWords' | ||
}, | ||
anyText: { | ||
__caption__: 'anyText' | ||
}, | ||
index: { | ||
__caption__: 'index' | ||
}, | ||
visibility: { | ||
__caption__: 'visibility' | ||
}, | ||
type: { | ||
__caption__: 'type' | ||
}, | ||
settings: { | ||
__caption__: 'settings' | ||
}, | ||
scale: { | ||
__caption__: 'scale' | ||
}, | ||
coordinateReferenceSystem: { | ||
__caption__: 'coordinateReferenceSystem' | ||
}, | ||
boundingBox: { | ||
__caption__: 'boundingBox' | ||
}, | ||
public: { | ||
__caption__: 'public' | ||
}, | ||
owner: { | ||
__caption__: 'owner' | ||
}, | ||
securityKey: { | ||
__caption__: 'securityKey' | ||
} | ||
} | ||
} | ||
}; |
50 changes: 50 additions & 0 deletions
50
addon/locales/ru/models/new-platform-flexberry-g-i-s-background-layer.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
export default { | ||
projections: { | ||
BackgroundLayerE: { | ||
}, | ||
BackgroundLayerL: { | ||
name: { | ||
__caption__: '' | ||
}, | ||
description: { | ||
__caption__: '' | ||
}, | ||
keyWords: { | ||
__caption__: '' | ||
}, | ||
anyText: { | ||
__caption__: '' | ||
}, | ||
index: { | ||
__caption__: '' | ||
}, | ||
visibility: { | ||
__caption__: '' | ||
}, | ||
type: { | ||
__caption__: '' | ||
}, | ||
settings: { | ||
__caption__: '' | ||
}, | ||
scale: { | ||
__caption__: '' | ||
}, | ||
coordinateReferenceSystem: { | ||
__caption__: '' | ||
}, | ||
boundingBox: { | ||
__caption__: '' | ||
}, | ||
public: { | ||
__caption__: '' | ||
}, | ||
owner: { | ||
__caption__: '' | ||
}, | ||
securityKey: { | ||
__caption__: '' | ||
} | ||
} | ||
} | ||
}; |
85 changes: 85 additions & 0 deletions
85
addon/mixins/regenerated/models/new-platform-flexberry-g-i-s-background-layer.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import Ember from 'ember'; | ||
import DS from 'ember-data'; | ||
import { attr } from 'ember-flexberry-data/utils/attributes'; | ||
|
||
export let Model = Ember.Mixin.create({ | ||
name: DS.attr('string'), | ||
description: DS.attr('string'), | ||
keyWords: DS.attr('string'), | ||
/** | ||
Non-stored property. | ||
|
||
@property anyText | ||
*/ | ||
anyText: DS.attr('string'), | ||
/** | ||
Method to set non-stored property. | ||
Please, use code below in model class (outside of this mixin) otherwise it will be replaced during regeneration of models. | ||
Please, implement 'anyTextCompute' method in model class (outside of this mixin) if you want to compute value of 'anyText' property. | ||
|
||
@method _anyTextCompute | ||
@private | ||
@example | ||
```javascript | ||
_anyTextChanged: Ember.on('init', Ember.observer('anyText', function() { | ||
Ember.run.once(this, '_anyTextCompute'); | ||
})) | ||
``` | ||
*/ | ||
_anyTextCompute: function() { | ||
let result = (this.anyTextCompute && typeof this.anyTextCompute === 'function') ? this.anyTextCompute() : null; | ||
this.set('anyText', result); | ||
}, | ||
index: DS.attr('number'), | ||
visibility: DS.attr('boolean', { defaultValue: true }), | ||
type: DS.attr('string'), | ||
settings: DS.attr('string'), | ||
scale: DS.attr('number'), | ||
coordinateReferenceSystem: DS.attr('string'), | ||
boundingBox: DS.attr('string'), | ||
public: DS.attr('boolean'), | ||
owner: DS.attr('string'), | ||
securityKey: DS.attr('string'), | ||
createTime: DS.attr('date'), | ||
creator: DS.attr('string'), | ||
editTime: DS.attr('date'), | ||
editor: DS.attr('string'), | ||
getValidations: function () { | ||
let parentValidations = this._super(); | ||
let thisValidations = { | ||
}; | ||
return Ember.$.extend(true, {}, parentValidations, thisValidations); | ||
}, | ||
init: function () { | ||
this.set('validations', this.getValidations()); | ||
this._super.apply(this, arguments); | ||
} | ||
}); | ||
|
||
export let defineNamespace = function (modelClass) { | ||
modelClass.reopenClass({ | ||
namespace: 'NewPlatform.Flexberry.GIS', | ||
}); | ||
}; | ||
|
||
export let defineProjections = function (modelClass) { | ||
modelClass.defineProjection('BackgroundLayerE', 'new-platform-flexberry-g-i-s-background-layer', { | ||
}); | ||
|
||
modelClass.defineProjection('BackgroundLayerL', 'new-platform-flexberry-g-i-s-background-layer', { | ||
name: attr('', { index: 0 }), | ||
description: attr('', { index: 1 }), | ||
keyWords: attr('', { index: 2 }), | ||
anyText: attr('', { index: 3 }), | ||
index: attr('', { index: 4 }), | ||
visibility: attr('', { index: 5 }), | ||
type: attr('', { index: 6 }), | ||
settings: attr('', { index: 7 }), | ||
scale: attr('', { index: 8 }), | ||
coordinateReferenceSystem: attr('', { index: 9 }), | ||
boundingBox: attr('', { index: 10 }), | ||
public: attr('', { index: 11 }), | ||
owner: attr('', { index: 12 }), | ||
securityKey: attr('', { index: 13 }) | ||
}); | ||
}; |
22 changes: 22 additions & 0 deletions
22
addon/mixins/regenerated/serializers/new-platform-flexberry-g-i-s-background-layer.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import Ember from 'ember'; | ||
|
||
/** | ||
Mixin containing initializetion logic for background layer serializer. | ||
|
||
@class NewPlatformFlexberyGISBackgroundLayerSerializerMixin | ||
@extends <a href="http://emberjs.com/api/classes/Ember.Mixin.html">Ember.Mixin</a> | ||
*/ | ||
export let Serializer = Ember.Mixin.create({ | ||
getAttrs: function () { | ||
let parentAttrs = this._super(); | ||
let attrs = { | ||
|
||
}; | ||
|
||
return Ember.$.extend(true, {}, parentAttrs, attrs); | ||
}, | ||
init: function () { | ||
this.set('attrs', this.getAttrs()); | ||
this._super(...arguments); | ||
} | ||
}); |
16 changes: 16 additions & 0 deletions
16
addon/models/new-platform-flexberry-g-i-s-background-layer.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { | ||
defineNamespace, | ||
defineProjections, | ||
Model as BackgroundLayerMixin | ||
} from '../mixins/regenerated/models/new-platform-flexberry-g-i-s-background-layer'; | ||
|
||
import EmberFlexberryDataModel from 'ember-flexberry-data/models/model'; | ||
import OfflineModelMixin from 'ember-flexberry-data/mixins/offline-model'; | ||
|
||
let Model = EmberFlexberryDataModel.extend(OfflineModelMixin, BackgroundLayerMixin, { | ||
}); | ||
|
||
defineNamespace(Model); | ||
defineProjections(Model); | ||
|
||
export default Model; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
addon/serializers/new-platform-flexberry-g-i-s-background-layer.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import FlexberryData from 'ember-flexberry-data'; | ||
import { Serializer as BackgroundLayerSerializer } from '../mixins/regenerated/serializers/new-platform-flexberry-g-i-s-background-layer'; | ||
|
||
/** | ||
Background layer serializer. | ||
|
||
@class NewPlatformFlexberryGISBackgroundLayerSerializer | ||
@extends OdataSerializer | ||
@uses NewPlatformFlexberryGISBackgroundLayerSerializerMixin | ||
*/ | ||
export default FlexberryData.Serializer.Odata.extend(BackgroundLayerSerializer, { | ||
/** | ||
* Field name where object identifier is kept. | ||
*/ | ||
primaryKey: '__PrimaryKey' | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from 'ember-flexberry-gis/models/new-platform-flexberry-g-i-s-background-layer'; |
1 change: 1 addition & 0 deletions
1
app/serializers/new-platform-flexberry-g-i-s-background-layer.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from 'ember-flexberry-gis/serializers/new-platform-flexberry-g-i-s-background-layer'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
tests/unit/models/new-platform-flexberry-g-i-s-background-layer-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { moduleForModel, test } from 'ember-qunit'; | ||
|
||
moduleForModel('new-platform-flexberry-g-i-s-background-layer', 'Unit | Model | new-platform-flexberry-g-i-s-background-layer', { | ||
// Specify the other units that are required for this test. | ||
needs: [ | ||
'model:custom-inflector-rules', | ||
'model:new-platform-flexberry-g-i-s-background-layer', | ||
'model:new-platform-flexberry-g-i-s-layer-link', | ||
'model:new-platform-flexberry-g-i-s-layer-metadata', | ||
'model:new-platform-flexberry-g-i-s-link-metadata', | ||
'model:new-platform-flexberry-g-i-s-link-parameter', | ||
'model:new-platform-flexberry-g-i-s-map-layer', | ||
'model:new-platform-flexberry-g-i-s-map-object-setting', | ||
'model:new-platform-flexberry-g-i-s-map', | ||
'model:new-platform-flexberry-g-i-s-parameter-metadata' | ||
] | ||
}); | ||
|
||
test('it exists', function(assert) { | ||
let model = this.subject(); | ||
|
||
// let store = this.store(); | ||
assert.ok(!!model); | ||
}); |
30 changes: 30 additions & 0 deletions
30
tests/unit/serializers/new-platform-flexberry-g-i-s-background-layer-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { moduleForModel, test } from 'ember-qunit'; | ||
|
||
moduleForModel('new-platform-flexberry-g-i-s-background-layer', 'Unit | Serializer | new-platform-flexberry-g-i-s-background-layer', { | ||
// Specify the other units that are required for this test. | ||
needs: [ | ||
'serializer:new-platform-flexberry-g-i-s-background-layer', | ||
'transform:file', | ||
'transform:decimal', | ||
'transform:json', | ||
|
||
'model:custom-inflector-rules', | ||
'model:new-platform-flexberry-g-i-s-layer-link', | ||
'model:new-platform-flexberry-g-i-s-layer-metadata', | ||
'model:new-platform-flexberry-g-i-s-link-metadata', | ||
'model:new-platform-flexberry-g-i-s-link-parameter', | ||
'model:new-platform-flexberry-g-i-s-map-layer', | ||
'model:new-platform-flexberry-g-i-s-map-object-setting', | ||
'model:new-platform-flexberry-g-i-s-map', | ||
'model:new-platform-flexberry-g-i-s-parameter-metadata' | ||
] | ||
}); | ||
|
||
// Replace this with your real tests. | ||
test('it serializes records', function(assert) { | ||
let record = this.subject(); | ||
|
||
let serializedRecord = record.serialize(); | ||
|
||
assert.ok(serializedRecord); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тут весь этот метод был добавлен для того чтобы подложки была возможность отфильтровать - посмотри ПР где он добавлен, и убери его совсем.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Исправлено