Skip to content
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

Fixed issue: Unknown shape type found #998

Merged
merged 1 commit into from
Dec 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions cvat/apps/engine/static/engine/js/shapeCreator.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,17 @@ class ShapeCreatorView {
this._labelSelector.attr('title', `
${shortkeys['change_default_label'].view_value} - ${shortkeys['change_default_label'].description}`);

let labels = window.cvat.labelsInfo.labels();
for (let labelId in labels) {
let option = $(`<option value=${labelId}> ${labels[labelId].normalize()} </option>`);
option.appendTo(this._labelSelector);
const labels = window.cvat.labelsInfo.labels();
const labelsKeys = Object.keys(labels);
for (let i = 0; i < labelsKeys.length; i += 1) {
this._labelSelector.append(
// eslint-disable-next-line
$(`<option value=${labelsKeys[i]}> ${labels[labelsKeys[i]].normalize()} </option>`)
);
}
this._labelSelector.val(labelsKeys[0]);

this._typeSelector.val('box');
this._typeSelector.on('change', (e) => {
// FIXME: In the future we have to make some generic solution
const mode = this._modeSelector.prop('value');
Expand Down
2 changes: 1 addition & 1 deletion cvat/apps/engine/templates/engine/annotation.html
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@
<option value="interpolation" class="regular"> Interpolation </option>
</select>
<select id="shapeTypeSelector" class="regular h2">
<option value="box" class="regular"> Box </option>
<option value="box" class="regular" selected> Box </option>
<option value="polygon" class="regular"> Polygon </option>
<option value="polyline" class="regular"> Polyline </option>
<option value="points" class="regular"> Points </option>
Expand Down