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

Improved the JSON authoring view #1207

Merged
merged 8 commits into from
May 24, 2018
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,11 @@ class AuthoringToolController {
} else {
this.projectTitle = null;
}
this.turnOffJSONValidMessage();
}

turnOffJSONValidMessage() {
this.$rootScope.$broadcast('setIsJSONValid', { isJSONValid: null });
}

/**
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ class ToolbarController {
}
this.globalMessage = params.globalMessage;
});
this.$rootScope.$on('setIsJSONValid', (event, params) => {
this.isJSONValid = params.isJSONValid;
});
}

toggleMenu() {
Expand Down Expand Up @@ -39,6 +42,8 @@ const Toolbar = {
<span class="toolbar__title" ng-if="!$ctrl.showStepTools">{{ $ctrl.viewName }}</span>
<step-tools ng-if="$ctrl.showStepTools" show-position="$ctrl.numberProject"></step-tools>
<div flex></div>
<span ng-if="$ctrl.isJSONValid === true" style="color: green; font-size: 14px">{{ 'jsonValid' | translate }}</span>
<span ng-if="$ctrl.isJSONValid === false" style="color: red; font-size: 14px">{{ 'jsonInvalid' | translate }}</span>
<div style="width: 40px; height: 40px;">
<md-progress-circular ng-if="$ctrl.isProgressIndicatorVisible"
md-mode="indeterminate"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/main/webapp/wise5/authoringTool/i18n/i18n_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@
"isVisitable": "Is Visitable",
"isVisited": "Is Visited",
"json": "JSON",
"jsonInvalid": "JSON Invalid",
"jsonValid": "JSON Valid",
"labelLink": "Label (Link)",
"labelPlural": "Label (Plural)",
"labelSingular": "Label (Singular)",
Expand Down Expand Up @@ -224,6 +226,7 @@
"projectCreatedOn": "Project created on ",
"projectHome": "Project Home",
"projectJSON": "Project JSON",
"jsonInvalidErrorMessage": "The JSON is invalid. Invalid JSON will not be saved.\nClick \"OK\" to revert back to the last valid JSON.\nClick \"Cancel\" to keep the invalid JSON open so you can fix it.",
"projectsList": "Projects List",
"projectStyles": "Project Styles",
"projectStructure": "Project Structure",
Expand Down
4 changes: 3 additions & 1 deletion src/main/webapp/wise5/authoringTool/node/node.html
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,9 @@ <h6 ng-if='projectController.isGroupNode(nodeAuthoringController.nodeId)'>{{ 'ed
<h6 ng-if='!projectController.isGroupNode(nodeAuthoringController.nodeId)'>{{ 'editStepJSON' | translate }}</h6>
<md-input-container style='width: 100%;'>
<textarea ng-model='nodeAuthoringController.authoringNodeContentJSONString'
style='width: 90%; border: 1px solid black;'></textarea>
ng-change='nodeAuthoringController.autoSaveJSON()'
ng-model-options='{ debounce: 1000 }'
style='width: 90%; border: 1px solid black;'></textarea>
</md-input-container>
</div>
</div>
Expand Down
Loading