-
-
-
-
-
+
+
diff --git a/editor/modules/map/layers-panel.ts b/editor/modules/map/layers-panel.ts
index aa6412e..acb61c2 100644
--- a/editor/modules/map/layers-panel.ts
+++ b/editor/modules/map/layers-panel.ts
@@ -90,7 +90,9 @@ export class LayersPanel implements OnChanges, AfterViewInit, OnDestroy {
}
private requestLayerPreviews() {
- this.current_map.layers
+ if (this.current_map) {
+ this.current_map.layers
.forEach((_, i) => this.area.layer_index_stream.next(i));
+ }
}
}
diff --git a/editor/rxjs-add.ts b/editor/rxjs-add.ts
index ad97493..8980ef3 100644
--- a/editor/rxjs-add.ts
+++ b/editor/rxjs-add.ts
@@ -3,5 +3,7 @@ import 'rxjs/add/operator/mergeMap';
import 'rxjs/add/operator/switchMap';
import 'rxjs/add/operator/filter';
import 'rxjs/add/operator/share';
+import 'rxjs/add/operator/do';
+import 'rxjs/add/operator/delay';
import 'rxjs/add/observable/of';
import 'rxjs/add/observable/fromEvent';
diff --git a/editor/style.scss b/editor/style.scss
index 96adfa0..51e831a 100644
--- a/editor/style.scss
+++ b/editor/style.scss
@@ -81,3 +81,5 @@ header.navbar.navbar-fixed-top.navbar-empty {
top: $navbar-height + 12px;
height: 56px; // Same for this value
}
+
+.display-none { display: none; }
diff --git a/server/apis/chipsets.ts b/server/apis/chipsets.ts
index ab35249..206f97d 100644
--- a/server/apis/chipsets.ts
+++ b/server/apis/chipsets.ts
@@ -38,19 +38,19 @@ app.post('/api/chipset/upload/', reqAuth, upload.single('chipset'),
app.get('/api/chipset/', reqAuth, (req, res) => {
ChipsetModel.find({})
- .select('name')
+ .select('id')
.exec((err, chipsets) => {
if (err) {
werr(err);
serverError(res, `Couldn't get the list of chipsets.`);
} else {
- res.status(200).json(chipsets.map(c => c.name));
+ res.status(200).json(chipsets.map(c => c.id));
}
});
});
-app.get('/api/chipset/:name/metadata', reqAuth, (req, res) => {
- ChipsetModel.findOne({ name: req.params.name }, (err, chipset) => {
+app.get('/api/chipset/:id/metadata', reqAuth, (req, res) => {
+ ChipsetModel.findById(req.params.id, (err, chipset) => {
if (err || !chipset) {
if (err) werr(err);
notFound(res, req.user);
@@ -60,8 +60,8 @@ app.get('/api/chipset/:name/metadata', reqAuth, (req, res) => {
});
});
-app.get('/api/chipset/:name', reqAuth, (req, res) => {
- ChipsetModel.findOne({ name: req.params.name }, (err, chipset) => {
+app.get('/api/chipset/:id', reqAuth, (req, res) => {
+ ChipsetModel.findById(req.params.id, (err, chipset) => {
if (err || !chipset) {
if (err) werr(err);
notFound(res, req.user);
diff --git a/server/validators/api_map.ts b/server/validators/api_map.ts
index 561f5dc..f1b18f8 100644
--- a/server/validators/api_map.ts
+++ b/server/validators/api_map.ts
@@ -8,7 +8,6 @@ const layerDataSchema = {
minItems: 1,
items: {
type: 'array',
- minItems: 1,
items: {
required: true,
type: 'object',
@@ -54,7 +53,7 @@ export const validateMapNew = validator({
},
comment: {
required: true,
- type: 'number'
+ type: 'string'
}
}
}, {