mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -05:00
Merge branch 'dev/Warn_when_a_depended-on_System_is_missing' of git://github.com/gintau/codecombat into gintau-dev/Warn_when_a_depended-on_System_is_missing
This commit is contained in:
commit
b316a3e078
3 changed files with 15 additions and 1 deletions
|
@ -3,6 +3,7 @@ template = require 'templates/editor/components/main'
|
|||
|
||||
Level = require 'models/Level'
|
||||
LevelComponent = require 'models/LevelComponent'
|
||||
LevelSystem = require 'models/LevelSystem'
|
||||
ComponentsCollection = require 'collections/ComponentsCollection'
|
||||
ComponentConfigView = require './config'
|
||||
|
||||
|
@ -157,6 +158,18 @@ module.exports = class ThangComponentEditView extends CocoView
|
|||
@reportChanges()
|
||||
|
||||
onAddComponentEnterPressed: (node) =>
|
||||
extantSystems =
|
||||
(@supermodel.getModelByOriginalAndMajorVersion LevelSystem, sn.original, sn.majorVersion).attributes.name.toLowerCase() for idx, sn of @level.get('systems')
|
||||
requireSystem = node.data.system.toLowerCase()
|
||||
|
||||
if requireSystem not in extantSystems
|
||||
warn_element = 'Component <b>' + node.data.name + '</b> requires system <b>' + requireSystem + '</b> which is currently not specified in this level.'
|
||||
noty({
|
||||
text: warn_element,
|
||||
layout: 'bottomLeft',
|
||||
type: 'warning'
|
||||
})
|
||||
|
||||
currentSelection = @addComponentsTreema?.getLastSelectedTreema()?.data._id
|
||||
|
||||
id = node.data._id
|
||||
|
|
|
@ -34,7 +34,7 @@ module.exports = class LevelComponentEditView extends View
|
|||
schema = _.cloneDeep LevelComponent.schema.attributes
|
||||
schema.properties = _.pick schema.properties, (value, key) => key in @editableSettings
|
||||
schema.required = _.intersection schema.required, @editableSettings
|
||||
|
||||
|
||||
treemaOptions =
|
||||
supermodel: @supermodel
|
||||
schema: schema
|
||||
|
|
1
vendor/scripts/jquery.noty.packaged.min.js
vendored
Normal file
1
vendor/scripts/jquery.noty.packaged.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue