Skip to content

Commit

Permalink
Apply folders by features to part of components/ folder (oppia#6863)
Browse files Browse the repository at this point in the history
* Button directives

* ck editor helpers

* common-layout-directives/common-elements

* common-layout-directives/navigation-bars

* entity-creation-services

* forms

* Relax lint

* Fix lint

Fix lint

* Fix CODEOWNERS

* Relax HTML naming

* Fix lint

* Fix lint

* Merge develop

* Fix backend test

* Fix backend for good

* Address comments
  • Loading branch information
YashJipkate authored and seanlip committed Jun 8, 2019
1 parent bff341b commit 0644835
Show file tree
Hide file tree
Showing 148 changed files with 701 additions and 404 deletions.
55 changes: 32 additions & 23 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
/core/controllers/collection*.py @kevinlee12
/core/domain/collection*.py @kevinlee12
/core/storage/collection/ @kevinlee12
/core/templates/dev/head/components/CollectionCreationService*.ts @kevinlee12
/core/templates/dev/head/components/entity-creation-services/collection-creation.service*.ts @kevinlee12
/core/templates/dev/head/domain/collection/ @kevinlee12
/core/templates/dev/head/pages/collection_editor/ @kevinlee12
/core/templates/dev/head/pages/collection_player/ @kevinlee12
Expand Down Expand Up @@ -102,9 +102,9 @@
/core/domain/summary_services*.py @aks681
/core/domain/value_generators_domain*.py @seanlip
/core/storage/exploration/ @aks681
/core/templates/dev/head/components/ExplorationCreationService*.ts @DubeySandeep
/core/templates/dev/head/components/HintAndSolutionButtonsDirective*.ts @aks681
/core/templates/dev/head/components/hint_and_solution_buttons_directive.html @aks681
/core/templates/dev/head/components/entity-creation-services/exploration-creation.service*.ts @DubeySandeep
/core/templates/dev/head/components/button-directives/hint-and-solution-buttons.directive*.ts @aks681
/core/templates/dev/head/components/button-directives/hint-and-solution-buttons.directive.html @aks681
/core/templates/dev/head/components/state/ @aks681
/core/templates/dev/head/components/StateGraphLayoutService*.ts @DubeySandeep
/core/templates/dev/head/components/version_diff_visualization_directive.html @DubeySandeep
Expand All @@ -127,6 +127,8 @@

# Forms pages.
/core/templates/dev/head/components/forms/ @DubeySandeep
/core/templates/dev/head/components/common-layout-directives/common-elements/confirmation-modal.template.html @DubeySandeep
/core/templates/dev/head/components/ck-editor-helpers/customize-rte-component-modal.template.html @DubeySandeep
/core/templates/dev/head/services/SchemaDefaultValueService.ts @DubeySandeep
/core/templates/dev/head/services/SchemaUndefinedLastElementService.ts @DubeySandeep

Expand All @@ -141,15 +143,22 @@


# Global components and filters.
/core/templates/dev/head/components/alerts/ @ankita240796
/core/templates/dev/head/components/attribution_guide/ @ankita240796
/core/templates/dev/head/components/background/ @ankita240796
/core/templates/dev/head/components/embed_modal/ @ankita240796
/core/templates/dev/head/components/loading/ @ankita240796
/core/templates/dev/head/components/common-layout-directives/common-elements/alert-message.directive.ts @ankita240796
/core/templates/dev/head/components/common-layout-directives/common-elements/attribution-guide.directive.html @ankita240796
/core/templates/dev/head/components/common-layout-directives/common-elements/attribution-guide.directive.ts @ankita240796
/core/templates/dev/head/components/common-layout-directives/common-elements/background-banner.directive.ts @ankita240796
/core/templates/dev/head/components/common-layout-directives/common-elements/background-banner.directive.html @ankita240796
/core/templates/dev/head/components/button-directives/exploration-embed-button.service.ts @ankita240796
/core/templates/dev/head/components/button-directives/exploration-embed-button.directive.html @ankita240796
/core/templates/dev/head/components/common-layout-directives/common-elements/loading-dots.directive.ts @ankita240796
/core/templates/dev/head/components/common-layout-directives/common-elements/loading-dots.directive.html @ankita240796
/core/templates/dev/head/components/common-layout-directives/common-elements/promo-bar.directive.ts @ankita240796
/core/templates/dev/head/components/common-layout-directives/common-elements/promo-bar.directive.html @ankita240796
/core/templates/dev/head/components/common-layout-directives/common-elements/sharing-links.directive.html @ankita240796
/core/templates/dev/head/components/common-layout-directives/common-elements/sharing-links.directive.ts @ankita240796
/core/templates/dev/head/components/button-directives/social-buttons.directive.ts @ankita240796
/core/templates/dev/head/components/button-directives/social-buttons.directive.html @ankita240796
/core/templates/dev/head/components/profile_link/ @ankita240796
/core/templates/dev/head/components/promo/ @ankita240796
/core/templates/dev/head/components/share/ @ankita240796
/core/templates/dev/head/components/social_buttons/ @ankita240796
/core/templates/dev/head/components/summary_tile/ @ankita240796
/core/templates/dev/head/directives/FocusOnDirective*.ts @ankita240796
/core/templates/dev/head/directives/AngularHtmlBindDirective*.ts @ankita240796
Expand Down Expand Up @@ -205,7 +214,7 @@
/core/domain/stats*.py @brianrodri
/core/domain/visualization_registry*.py @brianrodri
/core/storage/statistics/ @brianrodri
/core/templates/dev/head/components/confirmation_modal_directive.html @brianrodri
/core/templates/dev/head/components/common-layout-directives/common-elements/confirmation-modal.template.html @brianrodri
/core/templates/dev/head/domain/statistics/ @brianrodri
/core/templates/dev/head/pages/exploration_editor/improvements_tab/ @brianrodri
/core/templates/dev/head/pages/exploration_editor/statistics_tab/ @brianrodri
Expand All @@ -232,9 +241,9 @@

# Navigation bar project.
/core/templates/dev/head/domain/sidebar/ @nithusha21
/core/templates/dev/head/components/create_button/ @nithusha21
/core/templates/dev/head/components/side_navigation_bar/ @nithusha21
/core/templates/dev/head/components/top_navigation_bar/ @nithusha21
/core/templates/dev/head/components/button-directives/create-activity-button.directive.ts @nithusha21
/core/templates/dev/head/components/button-directives/create-activity-button.directive.html @nithusha21
/core/templates/dev/head/components/common-layout-directives/navigation-bars/ @nithusha21
/core/templates/dev/head/services/NavigationService*.ts @nithusha21


Expand All @@ -244,7 +253,7 @@
/core/controllers/question*.py @aks681
/core/domain/question*.py @aks681
/core/storage/question/ @aks681
/core/templates/dev/head/components/QuestionCreationService*.ts @aks681
/core/templates/dev/head/components/entity-creation-services/question-creation.service.ts @aks681
/core/templates/dev/head/components/score_ring/ @vinitamurthi
/core/templates/dev/head/domain/question/ @aks681
/core/templates/dev/head/pages/practice_session/ @vinitamurthi
Expand All @@ -257,7 +266,7 @@
/core/controllers/skill*.py @aks681
/core/domain/skill*.py @aks681
/core/storage/skill/ @aks681
/core/templates/dev/head/components/SkillCreationService*.ts @aks681
/core/templates/dev/head/components/entity-creation-services/skill-creation.service.ts @aks681
/core/templates/dev/head/components/SummaryListHeaderDirective*.ts @aks681
/core/templates/dev/head/components/summary_list_header_directive.html @aks681
/core/templates/dev/head/domain/skill/ @aks681
Expand All @@ -267,7 +276,7 @@
/core/controllers/story*.py @aks681
/core/domain/story*.py @aks681
/core/storage/story/ @aks681
/core/templates/dev/head/components/StoryCreationService.ts @aks681
/core/templates/dev/head/components/entity-creation-services/story-creation.service.ts @aks681
/core/templates/dev/head/domain/story/ @aks681
/core/templates/dev/head/pages/story_editor/ @aks681

Expand All @@ -278,7 +287,7 @@
/core/domain/subtopic_page_services*.py @aks681
/core/domain/topic*.py @aks681
/core/storage/topic/ @aks681
/core/templates/dev/head/components/TopicCreationService.ts @aks681
/core/templates/dev/head/components/entity-creation-services/topic-creation.service.ts.ts @aks681
/core/templates/dev/head/domain/topic/ @aks681
/core/templates/dev/head/domain/topic_viewer @aks681
/core/templates/dev/head/pages/topic_editor/ @aks681
Expand Down Expand Up @@ -339,12 +348,12 @@

# Rich text editor team.
/core/domain/rte_component_registry*.py @AllanYangZhou @bansalnitish
/core/templates/dev/head/components/CkEditorRteDirective.ts @AllanYangZhou @bansalnitish
/core/templates/dev/head/components/ck-editor-helpers/ck-editor-rte.directive.ts @AllanYangZhou @bansalnitish
/core/templates/dev/head/directives/MathjaxBindDirective.ts @AllanYangZhou @bansalnitish
/core/templates/dev/head/mathjaxConfig.ts @AllanYangZhou @bansalnitish
/extensions/rich_text_components/ @AllanYangZhou @bansalnitish
/core/templates/dev/head/components/CkEditorWidgetsInitializer.ts @AllanYangZhou @bansalnitish
/core/templates/dev/head/components/rich_text_components.html @AllanYangZhou @bansalnitish
/core/templates/dev/head/components/ck-editor-helpers/ck-editor-widgets.initializer.ts @AllanYangZhou @bansalnitish
/core/templates/dev/head/components/ck-editor-helpers/rich-text-components.template.html @AllanYangZhou @bansalnitish
/core/templates/dev/head/services/AutoplayedVideosService*.ts @AllanYangZhou @bansalnitish
/core/templates/dev/head/services/RteHelperService*.ts @AllanYangZhou @bansalnitish
/extensions/ckeditor_plugins/ @AllanYangZhou @bansalnitish
Expand Down
4 changes: 2 additions & 2 deletions core/domain/rte_component_registry_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ def test_html_contains_all_imports(self):
generated_html = '\n'.join(html_script_tags)

rtc_html_file = os.path.join(
feconf.FRONTEND_TEMPLATES_DIR, 'components',
'rich_text_components.html')
feconf.FRONTEND_TEMPLATES_DIR, 'components', 'ck-editor-helpers',
'rich-text-components.template.html')
with open(rtc_html_file, 'r') as f:
rtc_html_file_contents = f.read()

Expand Down
24 changes: 16 additions & 8 deletions core/templates/dev/head/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,22 @@ require('services/stateful/BackgroundMaskService.ts');
require('services/stateful/FocusManagerService.ts');
require('services/SiteAnalyticsService.ts');

require('components/alerts/AlertMessageDirective.ts');
require('components/create_button/CreateActivityButtonDirective.ts');

require('components/forms/ObjectEditorDirective.ts');
require('components/promo/PromoBarDirective.ts');
require('components/side_navigation_bar/SideNavigationBarDirective.ts');
require('components/social_buttons/SocialButtonsDirective.ts');
require('components/top_navigation_bar/TopNavigationBarDirective.ts');
require(
'components/common-layout-directives/common-elements/' +
'alert-message.directive.ts');
require('components/button-directives/create-activity-button.directive.ts');

require('components/forms/custom-forms-directives/object-editor.directive.ts');
require(
'components/common-layout-directives/common-elements/' +
'promo-bar.directive.ts');
require(
'components/common-layout-directives/navigation-bars/' +
'side-navigation-bar.directive.ts');
require('components/button-directives/social-buttons.directive.ts');
require(
'components/common-layout-directives/navigation-bars/' +
'top-navigation-bar.directive.ts');

require('domain/sidebar/SidebarStatusService.ts');
require('domain/user/UserInfoObjectFactory.ts');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
* versions of an exploration.
*/

require('components/loading/LoadingDotsDirective.ts');
require(
'components/common-layout-directives/common-elements/' +
'loading-dots.directive.ts');

require('domain/utilities/UrlInterpolationService.ts');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* @fileoverview Directive for the Create Exploration/Collection button.
*/

require('components/CollectionCreationService.ts');
require('components/ExplorationCreationService.ts');
require('components/entity-creation-services/collection-creation.service.ts');
require('components/entity-creation-services/exploration-creation.service.ts');
require('domain/utilities/BrowserCheckerService.ts');
require('services/contextual/UrlService.ts');
require('services/SiteAnalyticsService.ts');
Expand All @@ -30,7 +30,7 @@ oppia.directive('createActivityButton', [
scope: {},
bindToController: {},
templateUrl: UrlInterpolationService.getDirectiveTemplateUrl(
'/components/create_button/create_activity_button_directive.html'),
'/components/button-directives/create-activity-button.directive.html'),
controllerAs: '$ctrl',
controller: [
'$timeout', '$window', '$uibModal',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ oppia.factory('ExplorationEmbedButtonService', [
$uibModal.open({
backdrop: true,
templateUrl: UrlInterpolationService.getDirectiveTemplateUrl(
'/components/embed_modal/' +
'embed_exploration_modal_directive.html'),
'/components/button-directives/' +
'exploration-embed-button.directive.html'),
resolve: {
explorationId: function() {
return explorationId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ oppia.directive('hintAndSolutionButtons', [
scope: {},
bindToController: {},
templateUrl: UrlInterpolationService.getDirectiveTemplateUrl(
'/components/hint_and_solution_buttons_directive.html'),
'/components/button-directives/' +
'hint-and-solution-buttons.directive.html'),
controllerAs: '$ctrl',
controller: [
'$scope', '$rootScope', 'HintsAndSolutionManagerService',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ oppia.directive('socialButtons', [
scope: {},
bindToController: {},
templateUrl: UrlInterpolationService.getDirectiveTemplateUrl(
'/components/social_buttons/' +
'social_buttons_directive.html'),
'/components/button-directives/social-buttons.directive.html'),
controllerAs: '$ctrl',
controller: [function() {
var ctrl = this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ oppia.directive('attributionGuide', [
scope: {},
bindToController: {},
templateUrl: UrlInterpolationService.getDirectiveTemplateUrl(
'/components/attribution_guide/' +
'attribution_guide_directive.html'),
'/components/common-layout-directives/common-elements/' +
'attribution-guide.directive.html'),
controllerAs: '$ctrl',
controller: [
'BrowserCheckerService', 'UrlService', function(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ oppia.directive('backgroundBanner', [
scope: {},
bindToController: {},
templateUrl: UrlInterpolationService.getDirectiveTemplateUrl(
'/components/background/background_banner_directive.html'),
'/components/common-layout-directives/common-elements/' +
'background-banner.directive.html'),
controllerAs: '$ctrl',
controller: [
function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ oppia.directive('loadingDots', [
scope: {},
bindToController: {},
templateUrl: UrlInterpolationService.getDirectiveTemplateUrl(
'/components/loading/loading_dots_directive.html'),
'/components/common-layout-directives/common-elements/' +
'loading-dots.directive.html'),
controllerAs: '$ctrl',
controller: [function() {}]
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ oppia.directive('promoBar', [
scope: {},
bindToController: {},
templateUrl: UrlInterpolationService.getDirectiveTemplateUrl(
'/components/promo/' +
'promo_bar_directive.html'),
'/components/common-layout-directives/common-elements/' +
'promo-bar.directive.html'),
controllerAs: '$ctrl',
controller: [
function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @fileoverview Directive for the Social Sharing Links.
*/

require('components/embed_modal/ExplorationEmbedButtonService.ts');
require('components/button-directives/exploration-embed-button.service.ts');
require('domain/utilities/UrlInterpolationService.ts');
require('services/HtmlEscaperService.ts');
require('services/SiteAnalyticsService.ts');
Expand All @@ -35,8 +35,8 @@ oppia.directive('sharingLinks', [
getCollectionId: '&collectionId'
},
templateUrl: UrlInterpolationService.getDirectiveTemplateUrl(
'/components/share/' +
'sharing_links_directive.html'),
'/components/common-layout-directives/common-elements/' +
'sharing-links.directive.html'),
controllerAs: '$ctrl',
controller: [
'$window', 'HtmlEscaperService',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ oppia.directive('sideNavigationBar', [
scope: {},
bindToController: {},
templateUrl: UrlInterpolationService.getDirectiveTemplateUrl(
'/components/side_navigation_bar/' +
'side_navigation_bar_directive.html'),
'/components/common-layout-directives/navigation-bars/' +
'side-navigation-bar.directive.html'),
controllerAs: '$ctrl',
controller: ['$timeout', function($timeout) {
var ctrl = this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ oppia.directive('topNavigationBar', [
scope: {},
bindToController: {},
templateUrl: UrlInterpolationService.getDirectiveTemplateUrl(
'/components/top_navigation_bar/' +
'top_navigation_bar_directive.html'),
'/components/common-layout-directives/navigation-bars/' +
'top-navigation-bar.directive.html'),
controllerAs: '$ctrl',
controller: [
'$scope', '$http', '$window', '$timeout', '$translate',
Expand Down
6 changes: 4 additions & 2 deletions core/templates/dev/head/components/forms/FormBuilderSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
* @fileoverview Tests for the form builders.
*/

require('components/forms/ApplyValidationDirective.ts');
require(
'components/forms/custom-forms-directives/apply-validation.directive.ts');
require('filters/convert-html-to-unicode.filter.ts');
require('filters/convert-unicode-to-html.filter.ts');
require('filters/convert-unicode-with-params-to-html.filter.ts');
require('components/forms/RequireIsFloatDirective.ts');
require(
'components/forms/custom-forms-directives/require-is-float.directive.ts');
require('components/forms/validators/IsAtLeastFilter.ts');
require('components/forms/validators/IsAtMostFilter.ts');
require('components/forms/validators/IsFloatFilter.ts');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ oppia.directive('audioFileUploader', [
onFileCleared: '=',
},
templateUrl: UrlInterpolationService.getDirectiveTemplateUrl(
'/components/forms/audio_file_uploader_directive.html'),
'/components/forms/custom-forms-directives/' +
'audio-file-uploader.directive.html'),
link: function(scope: ICustomScope, elt) {
var ALLOWED_AUDIO_FILE_TYPES = ['audio/mp3', 'audio/mpeg'];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ oppia.directive('htmlSelect', [
selection: '='
},
templateUrl: UrlInterpolationService.getDirectiveTemplateUrl(
'/components/forms/html_select_directive.html'),
'/components/forms/custom-forms-directives/html-select.directive.html'),
controller: ['$scope', function($scope) {
$scope.select = function(id) {
$scope.selection = id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ oppia.directive('imageUploader', [
width: '@'
},
templateUrl: UrlInterpolationService.getDirectiveTemplateUrl(
'/components/forms/image_uploader_directive.html'),
'/components/forms/custom-forms-directives/' +
'image-uploader.directive.html'),
link: function(scope: ICustomScope, elt) {
var onDragEnd = function(e) {
e.preventDefault();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ oppia.directive('select2Dropdown', [
width: '@'
},
templateUrl: UrlInterpolationService.getDirectiveTemplateUrl(
'/components/forms/select2_dropdown_directive.html'),
'/components/forms/custom-forms-directives/' +
'select2-dropdown.directive.html'),
controller: ['$scope', '$element', function($scope, $element) {
$scope.newChoiceValidator = new RegExp($scope.newChoiceRegex);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ oppia.directive('schemaBasedBoolEditor', [
labelForFocusTarget: '&'
},
templateUrl: UrlInterpolationService.getDirectiveTemplateUrl(
'/components/forms/schema_editors/' +
'schema_based_bool_editor_directive.html'),
'/components/forms/' +
'schema-based-editors/schema-based-bool-editor.directive.html'),
restrict: 'E'
};
}]);
Loading

0 comments on commit 0644835

Please sign in to comment.