Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
5d28b25
chore(react): add react-refresh for Fast Refresh
pchunky May 19, 2023
64d7202
refactor(announcements): correctly type `AnnouncementListData`
pchunky May 19, 2023
c4322d9
feat(announcements): add `unread` global announcements
pchunky May 29, 2023
cd0c4a8
refactor(constants): add icons for all course components
pchunky May 29, 2023
c708165
style(sidebar): use standard icons, fix missing item keys
pchunky May 29, 2023
9afc7eb
chore(eslint): disable `import/prefer-default-export`
pchunky May 29, 2023
7e3750a
style(fonts): replace Roboto with Inter
pchunky May 29, 2023
50e7320
style(tailwind): move colour slots to its plugin definition
pchunky May 29, 2023
d04e29e
feat(tailwind): add `bg-fade-to-r`
pchunky May 29, 2023
f80d665
feat(tailwind): add instant borders plugin
pchunky May 29, 2023
2e46e54
feat(tailwind): add primary colour
pchunky May 29, 2023
58e61dd
style: remove persistent custom scrollbar
pchunky May 29, 2023
f16a325
refactor(AssessmentsTable): make `StackedBadges` reusable
pchunky May 29, 2023
8111b95
feat(AssessmentsTable): disable flying action buttons
pchunky May 29, 2023
bfed8af
feat(SearchField): make autofocus work
pchunky May 29, 2023
1d43d67
feat(SearchField): add `noIcon` prop
pchunky May 29, 2023
872c08b
refactor: ProviderWrapper -> Providers
pchunky May 29, 2023
e83379e
chore(deps-dev): bump react-router-dom from 6.3.0 to 6.11.1 in /client
pchunky May 29, 2023
761d4fe
feat(courses): add `/sidebar` endpoint
pchunky May 29, 2023
4529fe4
feat: add endpoint to fetch home data
pchunky May 29, 2023
a026a8b
style(Section): sticks to top 0px of page
pchunky May 29, 2023
642cef8
style(DataTable): remove elevation
pchunky May 29, 2023
b8e564f
feat(router): add Dynamic Nest API
pchunky May 29, 2023
0db886c
feat(app): add `AppContainer`
pchunky May 29, 2023
7146112
feat(courses): add `CourseContainer`
pchunky May 29, 2023
7f78bc0
feat(components): add `Page`, deprecate `PageHeader`
pchunky May 29, 2023
daffaf0
feat(courses): render string url to course logo
pchunky Jun 24, 2023
28b8e6f
feat(app): migrate to new router, combine bundles
pchunky May 29, 2023
55dfb20
refactor(admin): remove sidebar, breadcrumbs from admin pages
pchunky May 29, 2023
5cf7e87
style(controller_helper): remove unused `display_course_user_badge`
pchunky Jun 24, 2023
ab0c29c
style(controller_helper): remove unused `display_course_logo`
pchunky Jun 24, 2023
15b4807
fix(usePrompt): `navigation.block` removed in react-router-dom 6.4.0
pchunky Jun 24, 2023
6ffbcc0
fix(table): cannot type space in search field in prod
pchunky Jun 24, 2023
4b7d266
feat(Footer): add correct copyright build years
pchunky Jun 24, 2023
597fbc3
feat(Footer): add correct links to external pages
pchunky Jun 24, 2023
5e3af60
style(DescriptionCard): extract translation, flatten borders
pchunky Jun 24, 2023
d71e0bf
refactor(admin): clean up system, instance admin components
pchunky Jun 24, 2023
bff1142
feat: migrate more pages to `Page`, fix margin issues
pchunky Jun 24, 2023
97e1c13
fix(PopupNotifier): suppress error on 403 when fetching
pchunky Jun 24, 2023
18cf8fd
fix(AssessmentSessionNew): the `div` doesn't scroll with page
pchunky Jun 24, 2023
6b5e246
test: fix all sidebar tests
pchunky Jun 24, 2023
1c9c12d
test(requests): remove redundant devise_pages_spec
pchunky Jun 24, 2023
0662939
test(requests): remove redundant high_voltage_pages_spec
pchunky Jun 24, 2023
58ed73e
test(log): fix session token not cleared after logout-login
pchunky Jun 24, 2023
f4b4814
test(profile_edit): fix flaky tests
pchunky Jun 24, 2023
7b64612
test(global_announcements): test against announcement content
pchunky Jun 24, 2023
e32201b
test(course_management): test against course titles
pchunky Jun 24, 2023
5c297d3
test(system/admin): do not use xpath
pchunky Jun 24, 2023
07a8891
test(multiple_response_answer): do not use xpath
pchunky Jun 24, 2023
17291d6
test(system/admin): test against announcement contents
pchunky Jun 24, 2023
8fe63ea
test(announcements): test against announcement contents
pchunky Jun 24, 2023
5c6cb86
test(programming_management): select proper case buttons
pchunky Jun 24, 2023
95a26b7
test(manually_graded): select proper case button
pchunky Jun 24, 2023
0781602
test(homepage): select proper case button
pchunky Jun 24, 2023
e4d689a
test(skill_management): select Skill button by caption
pchunky Jun 24, 2023
e4df158
test(multiple_response_management): select delete button by aria-label
pchunky Jun 24, 2023
e76efa1
test(text_response_management): select delete button by aria-label
pchunky Jun 24, 2023
1e817d8
test(course): announcements header now shows only when not empty
pchunky Jun 24, 2023
45218bb
test(factories): fix non-unique assessment tabs cannot be selected
pchunky Jun 24, 2023
7143569
test(course/user_profile): no more manage email subscriptions links
pchunky Jun 24, 2023
e0f1c27
feat(layouts): separate renders for react and static pages
pchunky Jun 24, 2023
adb1532
style(layouts): remove unused sidebar, course layouts
pchunky Jun 24, 2023
e7fe17b
style(views): remove breadcrumbs
pchunky Jun 24, 2023
2f4515c
style(controllers): remove breadcrumbs
pchunky Jun 24, 2023
e239b74
style(locales): remove unused translations
pchunky Jun 24, 2023
22f0fc9
style(components): remove deprecated `PageHeader`
pchunky Jun 24, 2023
a24cc9f
feat(CourseContainer): always scroll up when location changes
pchunky Jun 26, 2023
9e0b166
feat(Link): support routing with `to`
pchunky Jun 26, 2023
b506037
feat: replace all anchors `<a .../>` with `Link`
pchunky Jun 26, 2023
a3ed243
feat(Link): support `ref` assignment
pchunky Jun 26, 2023
357a8e0
feat: replace all React Router's `Link` with our `Link`
pchunky Jun 26, 2023
6409b10
feat: replace remaining `Link`s with our `Link`
pchunky Jun 26, 2023
a27e6cc
test(SubmissionsTable): new `Link` requires `BrowserRouter` context
pchunky Jun 26, 2023
2bcb33b
test(admin): links are no longer `button`s
pchunky Jun 26, 2023
19e8144
test(course_management): fix sometimes cannot find `active_course`
pchunky Jun 26, 2023
1d20dc8
feat(Footer): add latest build time, commit head SHA
pchunky Jun 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@
/coverage/*
/client/coverage/*

# Ignore additional themes
/app/themes/*
!/app/themes/default/*

# Ignore public download/upload folders
/public/downloads/*
/public/uploads/*
Expand Down
3 changes: 0 additions & 3 deletions app/assets/stylesheets/breadcrumbs.scss

This file was deleted.

This file was deleted.

20 changes: 15 additions & 5 deletions app/controllers/announcements_controller.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# frozen_string_literal: true
class AnnouncementsController < ApplicationController
load_resource :announcement, class: GenericAnnouncement.name, only: :mark_as_read,
id_param: :announcement_id

add_breadcrumb :index, :announcements_path
load_resource :announcement, class: GenericAnnouncement.name, only: :mark_as_read, id_param: :announcement_id

def index
respond_to do |format|
format.html
format.json do
@announcements = global_announcements.includes(:creator)
announcements = requesting_unread? ? unread_global_announcements : global_announcements
@announcements = announcements.includes(:creator)
end
end
end
Expand All @@ -20,4 +18,16 @@ def mark_as_read
@announcement.mark_as_read! for: current_user
head :ok
end

protected

def publicly_accessible?
requesting_unread?
end

private

def requesting_unread?
params[:unread] == 'true'
end
end
3 changes: 0 additions & 3 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ class ApplicationController < ActionController::Base
# Custom flash types. We follow Bootstrap's convention.
add_flash_types :success, :info, :warning, :danger

# We allow views to add breadcrumbs
helper_method :add_breadcrumb

include ApplicationControllerMultitenancyConcern
include ApplicationComponentsConcern
include ApplicationInternationalizationConcern
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def sidebar_items
[
{
key: :achievements,
icon: 'trophy',
icon: :achievement,
title: I18n.t('course.achievement.achievements.sidebar_title'),
weight: 4,
path: course_achievements_path(current_course),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def main_sidebar_items
[
{
key: :announcements,
icon: 'bullhorn',
icon: :announcement,
title: settings.title || t('course.announcements.sidebar_title'),
weight: 1,
path: course_announcements_path(current_course),
Expand Down
8 changes: 4 additions & 4 deletions app/controllers/components/course/assessments_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ def assessment_categories
current_course.assessment_categories.select(&:persisted?).map do |category|
{
key: "assessments_#{category.id}",
icon: 'plane', # TODO: category.icon in db that user can select and set
icon: :assessment, # TODO: category.icon in db that user can select and set
title: category.title,
weight: 2,
path: course_assessments_path(current_course, category: category, tab: category.tabs.first),
path: course_assessments_path(current_course, category: category),
unread: 0
}
end
Expand All @@ -38,7 +38,7 @@ def assessment_submissions
[
{
key: :assessments_submissions,
icon: 'upload',
icon: :submission,
title: t('course.assessment.submissions.sidebar_title'),
weight: 3,
path: course_submissions_path(current_course),
Expand All @@ -53,7 +53,7 @@ def admin_sidebar_items
[
{
key: :assessments_skills,
icon: 'bolt',
icon: :skills,
title: t('course.assessment.skills.sidebar_title'),
type: :admin,
weight: 8,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def main_sidebar_items
[
{
key: :discussion_topics,
icon: 'comments',
icon: :comments,
title: settings.title || t('course.discussion.topics.sidebar_title'),
weight: 5,
path: course_topics_path(current_course),
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/components/course/duplication_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def sidebar_items
[
{
key: :duplication,
icon: 'clone',
icon: :duplication,
title: t('layouts.duplication.title'),
type: :admin,
weight: 5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ def sidebar_items

[
{
icon: 'magic',
key: :disburse_experience_points,
icon: :disbursement,
title: t('course.experience_points.disbursement.sidebar_title'),
type: :admin,
weight: 4,
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/components/course/forums_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def main_sidebar_items
[
{
key: :forums,
icon: 'list-ul',
icon: :forum,
title: settings.title || t('course.forum.forums.sidebar_title'),
weight: 10,
path: course_forums_path(current_course),
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/components/course/groups_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def sidebar_items
[
{
key: :groups,
icon: 'share-alt',
icon: :groups,
title: I18n.t('course.groups.sidebar_title'),
type: :admin,
weight: 7,
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/components/course/leaderboard_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def main_sidebar_items
[
{
key: :leaderboard,
icon: 'star',
icon: :leaderboard,
title: settings.title || t('course.leaderboards.sidebar_title'),
weight: 6,
path: course_leaderboard_path(current_course)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def sidebar_items
[
{
key: :learning_map,
icon: 'map',
icon: :map,
title: t('layouts.learning_map.title'),
weight: 5,
path: course_learning_map_path(current_course)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/components/course/lesson_plan_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def main_sidebar_items
[
{
key: :lesson_plan,
icon: 'book',
icon: :lessonPlan,
Comment thread
ekowidianto marked this conversation as resolved.
title: I18n.t('course.lesson_plan.items.sidebar_title'),
weight: 8,
path: course_lesson_plan_path(current_course)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/components/course/levels_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def sidebar_items
[
{
key: :levels,
icon: 'star-half-o',
icon: :levels,
title: I18n.t('course.levels.sidebar_title'),
type: :admin,
weight: 6,
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/components/course/materials_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def main_sidebar_items
[
{
key: :materials,
icon: 'folder-open',
icon: :material,
title: settings.title || t('course.material.sidebar_title'),
weight: 9,
path: course_material_folder_path(current_course, current_course.root_folder),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def sidebar_items
[
{
key: :reference_timelines,
icon: 'random',
icon: :timelines,
type: :admin,
weight: 8,
title: t('layouts.multiple_reference_timelines.timeline_designer'),
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/components/course/settings_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def admin_sidebar_items

[
{
icon: 'gear',
key: :admin,
icon: :settings,
title: t('layouts.course_admin.title'),
type: :admin,
weight: 9,
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/components/course/statistics_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def sidebar_items
[
{
key: :statistics,
icon: 'bar-chart',
icon: :statistics,
title: t('course.statistics.header'),
type: :admin,
weight: 2,
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/components/course/survey_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def sidebar_items
[
{
key: :surveys,
icon: 'pie-chart',
icon: :survey,
title: I18n.t('course.surveys.sidebar_title'),
weight: 11,
path: course_surveys_path(current_course)
Expand Down
5 changes: 3 additions & 2 deletions app/controllers/components/course/users_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def main_sidebar_items
[
{
key: :users,
icon: 'group',
icon: :users,
title: t('course.users.sidebar_title'),
weight: 7,
path: course_users_path(current_course)
Expand All @@ -39,7 +39,8 @@ def admin_sidebar_items

[
{
icon: 'user-plus',
key: :manage_users,
icon: :manageUsers,
title: t('layouts.course_users.title'),
type: :admin,
weight: 1,
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/components/course/videos_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def main_sidebar_items
[
{
key: :videos,
icon: 'video-camera',
icon: :video,
title: settings.title || t('course.video.videos.sidebar_title'),
weight: 12,
path: course_videos_path(current_course, tab: current_course.default_video_tab),
Expand Down
8 changes: 0 additions & 8 deletions app/controllers/concerns/course/users_breadcrumb_concern.rb

This file was deleted.

1 change: 0 additions & 1 deletion app/controllers/course/achievement/controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true
class Course::Achievement::Controller < Course::ComponentController
load_and_authorize_resource :achievement, through: :course, class: Course::Achievement.name
add_breadcrumb :index, :course_achievements_path

helper name

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true
class Course::Admin::AnnouncementSettingsController < Course::Admin::Controller
add_breadcrumb :edit, :course_admin_announcements_path

def edit
respond_to do |format|
format.html { render 'course/admin/index' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true
class Course::Admin::AssessmentSettingsController < Course::Admin::Controller
add_breadcrumb :index, :course_admin_assessments_path

def edit
respond_to do |format|
format.html { render 'course/admin/index' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ class Course::Admin::Assessments::CategoriesController < Course::Admin::Controll
through: :course,
through_association: :assessment_categories,
class: Course::Assessment::Category.name
add_breadcrumb :index, :course_admin_assessments_path

def new
end
Expand Down
7 changes: 0 additions & 7 deletions app/controllers/course/admin/assessments/tabs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ class Course::Admin::Assessments::TabsController < Course::Admin::Controller
through: :category,
class: Course::Assessment::Tab.name

add_breadcrumb :index, :course_admin_assessments_path
before_action :add_category_breadcrumb

def new
end

Expand Down Expand Up @@ -38,10 +35,6 @@ def tab_params
params.require(:tab).permit(:title, :weight)
end

def add_category_breadcrumb
add_breadcrumb @category.title, course_admin_assessments_path(current_course)
end

# @return [Course::AssessmentsComponent]
# @return [nil] If component is disabled.
def component
Expand Down
2 changes: 0 additions & 2 deletions app/controllers/course/admin/codaveri_settings_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true
class Course::Admin::CodaveriSettingsController < Course::Admin::Controller
add_breadcrumb :edit, :course_admin_codaveri_path

def edit
respond_to do |format|
format.html { render 'course/admin/index' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true
class Course::Admin::ComponentSettingsController < Course::Admin::Controller
before_action :load_settings
add_breadcrumb :edit, :course_admin_components_path

def edit
respond_to do |format|
Expand Down
2 changes: 0 additions & 2 deletions app/controllers/course/admin/controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true
class Course::Admin::Controller < Course::ComponentController
add_breadcrumb :admin, :course_admin_path

before_action :authorize_admin

private
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true
class Course::Admin::Discussion::TopicSettingsController < Course::Admin::Controller
add_breadcrumb :edit, :course_admin_topics_path

def edit
respond_to do |format|
format.html { render 'course/admin/index' }
Expand Down
2 changes: 0 additions & 2 deletions app/controllers/course/admin/forum_settings_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true
class Course::Admin::ForumSettingsController < Course::Admin::Controller
add_breadcrumb :edit, :course_admin_forums_path

def edit
respond_to do |format|
format.html { render 'course/admin/index' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true
class Course::Admin::LeaderboardSettingsController < Course::Admin::Controller
add_breadcrumb :edit, :course_admin_leaderboard_path

def edit
respond_to do |format|
format.html { render 'course/admin/index' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true
class Course::Admin::LessonPlanSettingsController < Course::Admin::Controller
before_action :load_item_settings
add_breadcrumb :edit, :course_admin_lesson_plan_path

def edit
respond_to do |format|
Expand Down
2 changes: 0 additions & 2 deletions app/controllers/course/admin/material_settings_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true
class Course::Admin::MaterialSettingsController < Course::Admin::Controller
add_breadcrumb :edit, :course_admin_materials_path

def edit
respond_to do |format|
format.html { render 'course/admin/index' }
Expand Down
Loading