Skip to content

Commit

Permalink
Remove CKEditor-5 Initialisation (oppia#7432)
Browse files Browse the repository at this point in the history
* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Initial

* Line break check

* Revert Package-lock

* Package-lock check-1

* Empty commit

* Revert package-lock.json

* Check package-lock.json

* Resolve merge conflicts

* Remove ck-5 files

* test

* Fix-1
  • Loading branch information
Nisheal John authored and seanlip committed Aug 27, 2019
1 parent 9f127ab commit adabccf
Showing 17 changed files with 1,455 additions and 4,265 deletions.
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -383,7 +383,6 @@

# Rich text editor team.
/core/templates/dev/head/components/ck-editor-helpers/ck-editor-4-rte.directive.ts @aks681
/core/templates/dev/head/components/ck-editor-helpers/ck-editor-5-rte.directive.ts @aks681 @NishealJ
/core/templates/dev/head/directives/mathjax-bind.directive.ts @aks681
/core/templates/dev/head/mathjaxConfig.ts @aks681
/core/templates/dev/head/components/ck-editor-helpers/ck-editor-4-widgets.initializer.ts @aks681
4 changes: 0 additions & 4 deletions assets/constants.ts
Original file line number Diff line number Diff line change
@@ -17,10 +17,6 @@ export = {
// Whether to allow custom event reporting to Google Analytics.
"CAN_SEND_ANALYTICS_EVENTS": false,

// This specifies the current editor in use and used to switch
// between CK4 & CK5.
"CURRENT_RTE_IS_CKEDITOR_4": true,

"ALL_CATEGORIES": ["Algebra", "Algorithms", "Architecture", "Arithmetic",
"Art", "Astronomy", "Biology", "Business", "Calculus", "Chemistry",
"Combinatorics", "Computing", "Economics", "Education", "Engineering",

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<!-- label-for-focus-target feature is removed since CKEditor has a
focusManager to manage the focus activity automatically. -->
<ck-editor-5-rte ng-if="!$ctrl.isDisabled() && !$ctrl.currentRteIsCKEditor4" ng-model="$ctrl.localValue"
ui-config="$ctrl.uiConfig()">
</ck-editor-5-rte>
<ck-editor-4-rte ng-if="!$ctrl.isDisabled() && $ctrl.currentRteIsCKEditor4" ng-model="$ctrl.localValue"
<ck-editor-4-rte ng-if="!$ctrl.isDisabled()" ng-model="$ctrl.localValue"
ui-config="$ctrl.uiConfig()">
</ck-editor-4-rte>

Original file line number Diff line number Diff line change
@@ -17,7 +17,6 @@
*/

require('components/ck-editor-helpers/ck-editor-4-rte.directive.ts');
require('components/ck-editor-helpers/ck-editor-5-rte.directive.ts');
require('components/ck-editor-helpers/ck-editor-4-widgets.initializer.ts');

require('domain/utilities/UrlInterpolationService.ts');
@@ -37,10 +36,6 @@ angular.module('oppia').directive('schemaBasedHtmlEditor', [
'/components/forms/schema-based-editors/' +
'schema-based-html-editor.directive.html'),
controllerAs: '$ctrl',
controller: ['$scope', 'CURRENT_RTE_IS_CKEDITOR_4',
function($scope, CURRENT_RTE_IS_CKEDITOR_4) {
var ctrl = this;
ctrl.currentRteIsCKEditor4 = CURRENT_RTE_IS_CKEDITOR_4;
}]
controller: [function() {}]
};
}]);
Original file line number Diff line number Diff line change
@@ -17,7 +17,6 @@
*/

require('components/ck-editor-helpers/ck-editor-4-rte.directive.ts');
require('components/ck-editor-helpers/ck-editor-5-rte.directive.ts');
require('components/ck-editor-helpers/ck-editor-4-widgets.initializer.ts');
require('directives/angular-html-bind.directive.ts');
require('directives/mathjax-bind.directive.ts');
Original file line number Diff line number Diff line change
@@ -21,7 +21,6 @@ require(
require('domain/skill/RubricObjectFactory.ts');
require('domain/utilities/UrlInterpolationService.ts');
require('components/ck-editor-helpers/ck-editor-4-rte.directive.ts');
require('components/ck-editor-helpers/ck-editor-5-rte.directive.ts');
require('components/ck-editor-helpers/ck-editor-4-widgets.initializer.ts');
require('components/forms/custom-forms-directives/image-uploader.directive.ts');

Original file line number Diff line number Diff line change
@@ -19,10 +19,7 @@ <h3>Review Suggestion</h3>
</angular-html-bind>
</div>
<div ng-show="suggestionEditorIsShown">
<ck-editor-5-rte ng-if="!currentRteIsCKEditor4" ng-model="suggestionData.newSuggestionHtml">
</ck-editor-5-rte>
<ck-editor-4-rte ng-if="currentRteIsCKEditor4" ng-model="suggestionData.newSuggestionHtml">
</ck-editor-4-rte>
<ck-editor-4-rte ng-model="suggestionData.newSuggestionHtml"></ck-editor-4-rte>
<input type="text" class="form-control oppia-review-message" ng-model="summaryMessage" placeholder="Summarize your new changes">
</div>
</div>
Original file line number Diff line number Diff line change
@@ -16,7 +16,6 @@
* @fileoverview Service to display suggestion modal in creator view.
*/
require('components/ck-editor-helpers/ck-editor-4-rte.directive.ts');
require('components/ck-editor-helpers/ck-editor-5-rte.directive.ts');
require('components/ck-editor-helpers/ck-editor-4-widgets.initializer.ts');

require('domain/utilities/UrlInterpolationService.ts');
@@ -67,14 +66,14 @@ angular.module('oppia').factory('SuggestionModalForCreatorDashboardService', [
},
controller: [
'$log', '$scope', '$uibModalInstance', 'SuggestionModalService',
'canReviewActiveThread', 'description', 'CURRENT_RTE_IS_CKEDITOR_4',
'newContent', 'oldContent', 'stateName', 'suggestionIsHandled',
'suggestionStatus', 'suggestionType',
'canReviewActiveThread', 'description', 'newContent', 'oldContent',
'stateName', 'suggestionIsHandled', 'suggestionStatus',
'suggestionType',
function(
$log, $scope, $uibModalInstance, SuggestionModalService,
canReviewActiveThread, description, CURRENT_RTE_IS_CKEDITOR_4,
newContent, oldContent, stateName, suggestionIsHandled,
suggestionStatus, suggestionType
canReviewActiveThread, description, newContent, oldContent,
stateName, suggestionIsHandled, suggestionStatus,
suggestionType
) {
$scope.isNotHandled = !suggestionIsHandled;
$scope.canReject = $scope.isNotHandled;
@@ -94,8 +93,6 @@ angular.module('oppia').factory('SuggestionModalForCreatorDashboardService', [
$scope.errorMessage = '';
}

$scope.currentRteIsCKEditor4 = CURRENT_RTE_IS_CKEDITOR_4;

$scope.oldContent = oldContent;
$scope.newContent = newContent;
$scope.stateName = stateName;
Original file line number Diff line number Diff line change
@@ -17,7 +17,6 @@
*/

require('components/ck-editor-helpers/ck-editor-4-rte.directive.ts');
require('components/ck-editor-helpers/ck-editor-5-rte.directive.ts');
require('components/ck-editor-helpers/ck-editor-4-widgets.initializer.ts');

require('domain/utilities/UrlInterpolationService.ts');
@@ -42,12 +41,12 @@ angular.module('oppia').factory('SuggestionModalForExplorationPlayerService', [
resolve: {},
controller: [
'$scope', '$timeout', '$uibModalInstance', 'ExplorationEngineService',
'CURRENT_RTE_IS_CKEDITOR_4', 'PlayerPositionService',
'PlayerTranscriptService', 'SuggestionModalService',
'PlayerPositionService', 'PlayerTranscriptService',
'SuggestionModalService',
function(
$scope, $timeout, $uibModalInstance, ExplorationEngineService,
CURRENT_RTE_IS_CKEDITOR_4, PlayerPositionService,
PlayerTranscriptService, SuggestionModalService) {
PlayerPositionService, PlayerTranscriptService,
SuggestionModalService) {
var stateName = PlayerPositionService.getCurrentStateName();
var displayedCard = PlayerTranscriptService.getCard(
PlayerPositionService.getDisplayedCardIndex());
@@ -67,8 +66,6 @@ angular.module('oppia').factory('SuggestionModalForExplorationPlayerService', [
SuggestionModalService.cancelSuggestion($uibModalInstance);
};

$scope.currentRteIsCKEditor4 = CURRENT_RTE_IS_CKEDITOR_4;

$scope.submitSuggestion = function() {
var data = {
target_id: ExplorationEngineService.getExplorationId(),
Original file line number Diff line number Diff line change
@@ -4,10 +4,7 @@ <h3>Suggest a Change</h3>

<div class="modal-body protractor-test-exploration-suggestion-modal">
<!-- ng-model needs to bind to a property of an object on the scope (the property cannot sit directly on the scope). -->
<ck-editor-5-rte ng-if="!currentRteIsCKEditor4" ng-show="showEditor" ng-model="suggestionData.suggestionHtml">
</ck-editor-5-rte>
<ck-editor-4-rte ng-if="currentRteIsCKEditor4" ng-show="showEditor" ng-model="suggestionData.suggestionHtml">
</ck-editor-4-rte>
<ck-editor-4-rte ng-show="showEditor" ng-model="suggestionData.suggestionHtml"></ck-editor-4-rte>
<br>
Briefly describe your changes (required):
<input type="text" ng-model="description" class="protractor-test-suggestion-description-input" style="width: 100%">
Original file line number Diff line number Diff line change
@@ -16,7 +16,6 @@
* @fileoverview Primary controller for the skill editor page.
*/


require('interactions/interactionsQuestionsRequires.ts');
require('objects/objectComponentsRequires.ts');

1 change: 0 additions & 1 deletion core/tests/protractor/accessibility.js
Original file line number Diff line number Diff line change
@@ -49,7 +49,6 @@ describe('Cache Slugs', function() {
it('should check that errors get logged for missing resources', function() {
browser.get('/console_errors');
var expectedErrors = [
'ckeditor-duplicated-modules',
'http://localhost:9001/build/fail/logo/288x128_logo_white.png'
];
general.checkConsoleErrorsExist(expectedErrors);
10 changes: 0 additions & 10 deletions core/tests/protractor_utils/general.js
Original file line number Diff line number Diff line change
@@ -42,16 +42,6 @@ var checkForConsoleErrors = function(errorsToIgnore) {
});
}

// Since we are in the process of upgrading CKeditor-4 to Ckeditor-5,
// we are observing consoles errors for duplicated modules
// (for more details,
// please refer to https://github.com/ckeditor/ckeditor5/issues/1821)
// and therefore, we need to filter such logs until we've upgraded to
// CKEditor-5 completely.
browserLogs = browserLogs.filter(function(browserLog) {
return !(browserLog.message.includes('ckeditor-duplicated-modules'));
});

for (var i = 0; i < browserLogs.length; i++) {
if (browserLogs[i].level.value > CONSOLE_LOG_THRESHOLD) {
var errorFatal = true;
Loading

0 comments on commit adabccf

Please sign in to comment.