Skip to content

Commit

Permalink
Merge branch 'Simon-Initiative:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
dtiwarATS authored Dec 16, 2024
2 parents af98bf8 + 88650d4 commit c4cc85f
Show file tree
Hide file tree
Showing 430 changed files with 11,976 additions and 8,251 deletions.
3 changes: 0 additions & 3 deletions assets/src/apps/authoring/Authoring.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { AuthoringFlowchartPageEditor } from './AuthoringFlowchartPageEditor';
import { ReadOnlyWarning } from './ReadOnlyWarning';
import { ModalContainer } from './components/AdvancedAuthoringModal';
import { FlowchartEditor } from './components/Flowchart/FlowchartEditor';
import KeepAlive from './components/Flowchart/KeepAlive';
import { onboardWizardComplete } from './components/Flowchart/flowchart-actions/onboard-wizard-complete';
import { OnboardWizard } from './components/Flowchart/onboard-wizard/OnboardWizard';
import DiagnosticsWindow from './components/Modal/DiagnosticsWindow';
Expand Down Expand Up @@ -299,8 +298,6 @@ const Authoring: React.FC<AuthoringProps> = (props: AuthoringProps) => {
{shouldShowOnboarding && (
<OnboardWizard onSetupComplete={onOnboardComplete} initialTitle={props.content.title} />
)}

<KeepAlive />
</ModalContainer>
</ErrorBoundary>
</AppsignalContext.Provider>
Expand Down
82 changes: 0 additions & 82 deletions assets/src/apps/authoring/components/Flowchart/KeepAlive.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion assets/src/components/common/UserAccountMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export const UserAccountMenu = ({
<DropdownItem>
<div className="py-1">
Dark Mode
<DarkModeSelector showLabels={false} />
<DarkModeSelector />
</div>
</DropdownItem>

Expand Down
4 changes: 2 additions & 2 deletions assets/src/components/messages/CreateAccountPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ export function CreateAccountPopup(props: CreateAccountPopupProps): JSX.Element

<div className="flex-grow-1"></div>
<a
href={`/course/create_account?section=${props.sectionSlug}`}
href={`/users/register?section=${props.sectionSlug}`}
className="btn btn-sm btn-outline-primary ml-1"
>
Create account
</a>
<a
href={`/course/signin?section=${props.sectionSlug}`}
href={`/users/log_in?section=${props.sectionSlug}`}
className="btn btn-sm btn-primary ml-1"
>
Sign in
Expand Down
15 changes: 2 additions & 13 deletions assets/src/components/misc/DarkModeSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,9 @@ export const getModeFromLocalStorage = () => {
return localStorage.theme;
};

const maybeLabel = (label: string, showLabel: boolean) =>
showLabel ? <span className="ml-1">{label}</span> : undefined;
export interface DarkModeSelectorProps {}

export interface DarkModeSelectorProps {
showLabels?: boolean;
}

export const DarkModeSelector = ({ showLabels = true }: DarkModeSelectorProps) => {
export const DarkModeSelector = (_props: DarkModeSelectorProps) => {
const [mode, setMode] = useState<Mode>(getModeFromLocalStorage());

const onSelect = (mode: Mode) => () => {
Expand Down Expand Up @@ -97,8 +92,6 @@ export const DarkModeSelector = ({ showLabels = true }: DarkModeSelectorProps) =
d="M14 3.07191C15.2162 3.77405 16.2261 4.78396 16.9282 6.00011C17.6304 7.21626 18 8.59582 18 10.0001C18 11.4044 17.6303 12.7839 16.9282 14.0001C16.226 15.2162 15.2161 16.2261 13.9999 16.9283C12.7837 17.6304 11.4042 18 9.99987 18C8.59557 18 7.21602 17.6303 5.99987 16.9281C4.78372 16.226 3.77383 15.216 3.07171 13.9999C2.36958 12.7837 1.99996 11.4041 2 9.99986L2.004 9.74066C2.0488 8.35906 2.45084 7.01265 3.17091 5.83268C3.89099 4.65271 4.90452 3.67946 6.11271 3.00781C7.3209 2.33616 8.68252 1.98903 10.0648 2.00026C11.4471 2.0115 12.8029 2.38071 14 3.07191ZM6.8 4.4575C5.57991 5.16199 4.62639 6.24939 4.08731 7.55104C3.54823 8.8527 3.45373 10.2959 3.81847 11.6567C4.1832 13.0175 4.98678 14.22 6.10458 15.0776C7.22238 15.9351 8.59192 16.3999 10.0008 16.3998L10 3.5999C8.87655 3.59995 7.77291 3.89573 6.8 4.4575Z"
/>
</svg>

{maybeLabel('Auto', showLabels)}
</ToggleOption>
<ToggleOption id="light" checked={isChecked(mode, 'light')} onChange={onSelect('light')}>
<svg
Expand Down Expand Up @@ -126,8 +119,6 @@ export const DarkModeSelector = ({ showLabels = true }: DarkModeSelectorProps) =
strokeLinejoin="round"
/>
</svg>

{maybeLabel('Light', showLabels)}
</ToggleOption>
<ToggleOption id="dark" checked={isChecked(mode, 'dark')} onChange={onSelect('dark')}>
<div className="dark:stroke-[#B8B4BF] stroke-black/70 hover:stroke-black hover:dark:stroke-white">
Expand All @@ -149,8 +140,6 @@ export const DarkModeSelector = ({ showLabels = true }: DarkModeSelectorProps) =
/>
</svg>
</div>

{maybeLabel('Dark', showLabels)}
</ToggleOption>
</ThreeStateToggle>
);
Expand Down
2 changes: 2 additions & 0 deletions assets/src/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { MonacoEditor } from './monaco_editor';
import { PointMarkers } from './point_markers';
import { ProjectsTypeahead } from './projects_typeahead';
import { ReactToLiveView } from './react_to_liveview';
import { Recaptcha } from './recaptcha';
import { ResizeListener } from './resize_listener';
import { ReviewActivity } from './review_activity';
import { Scroller } from './scroller';
Expand Down Expand Up @@ -91,4 +92,5 @@ export const Hooks = {
EvaluateMathJaxExpressions,
ReactToLiveView,
DisableSubmitted,
Recaptcha,
};
11 changes: 11 additions & 0 deletions assets/src/hooks/recaptcha.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { isDarkMode } from 'utils/browser';

const grecaptcha = (window as any).grecaptcha;

export const Recaptcha = {
mounted() {
const theme = this.el.getAttribute('data-theme') || (isDarkMode() ? 'dark' : 'light');

grecaptcha.render(this.el.id, { theme });
},
};
1 change: 0 additions & 1 deletion assets/src/phoenix/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ declare global {
finalize: typeof finalize;
CreateAccountPopup: (node: any, props: any) => void;
};
keepAlive: () => void;
}
}

Expand Down
42 changes: 0 additions & 42 deletions assets/src/phoenix/keep-alive.ts

This file was deleted.

12 changes: 12 additions & 0 deletions assets/tailwind.theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,18 @@ module.exports = {
},
},
},
google: {
'text-gray': '#3c4043',
'button-blue': '#1a73e8',
'button-blue-hover': '#5195ee',
'button-dark': '#202124',
'button-dark-hover': '#555658',
'button-border-light': '#dadce0',
'logo-blue': '#4285f4',
'logo-green': '#34a853',
'logo-yellow': '#fbbc05',
'logo-red': '#ea4335',
},
},
extend: {
fontFamily: {
Expand Down
7 changes: 3 additions & 4 deletions assets/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const populateEntries = () => {
cashnetclient: ['./src/payment/cashnet/client.ts'],
timezone: ['./src/phoenix/timezone.ts'],
dark: ['./src/phoenix/dark.ts'],
keepalive: ['./src/phoenix/keep-alive.ts'],
delivery_adaptive_themes_default_light: ['./styles/adaptive/light.scss'],
delivery_adaptive_themes_flowchart: ['./styles/adaptive/flowchart.scss'],
};
Expand Down Expand Up @@ -78,9 +77,9 @@ const populateEntries = () => {
if (
Object.keys(merged).length !=
Object.keys(initialEntries).length +
2 * foundActivities.length +
2 * foundParts.length +
styleSheets.length
2 * foundActivities.length +
2 * foundParts.length +
styleSheets.length
) {
throw new Error(
'Encountered a possible naming collision in activity or part manifests. Aborting.',
Expand Down
21 changes: 5 additions & 16 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ config :oli,
node_js_pool_size: String.to_integer(System.get_env("NODE_JS_POOL_SIZE", "2")),
screen_idle_timeout_in_seconds:
String.to_integer(System.get_env("SCREEN_IDLE_TIMEOUT_IN_SECONDS", "1800")),
always_use_persistent_login_sessions: false,
log_incomplete_requests: true

config :oli, :xapi_upload_pipeline,
Expand Down Expand Up @@ -175,7 +174,8 @@ config :oli, Oban,
project_export: 3,
analytics_export: 3,
datashop_export: 3,
objectives: 3
objectives: 3,
mailer: 10
]

config :ex_money,
Expand Down Expand Up @@ -217,7 +217,9 @@ config :lti_1p3,
ags_line_item_prefix: "oli-torus-"

config :ex_aws,
region: {:system, "AWS_REGION"}
access_key_id: [{:system, "AWS_ACCESS_KEY_ID"}, :instance_role],
secret_access_key: [{:system, "AWS_SECRET_ACCESS_KEY"}, :instance_role],
region: [{:system, "AWS_REGION"}, :instance_role]

# Configures Elixir's Logger
config :logger, :console,
Expand All @@ -240,11 +242,6 @@ if Mix.env() == :dev do
clear: true
end

# Configure Mnesia directory (used by pow persistent sessions)
config :mnesia,
dir: to_charlist(System.get_env("MNESIA_DIR", ".mnesia")),
dump_log_write_threshold: 10000

config :appsignal, :config, revision: System.get_env("SHA", default_sha)

# Configure Privacy Policies link
Expand All @@ -266,14 +263,6 @@ config :ex_json_schema,
# Configure if age verification checkbox appears on learner account creation
config :oli, :age_verification, is_enabled: System.get_env("IS_AGE_VERIFICATION_ENABLED", "")

config :oli, :auth_providers,
google_client_id: System.get_env("GOOGLE_CLIENT_ID", ""),
google_client_secret: System.get_env("GOOGLE_CLIENT_SECRET", ""),
author_github_client_id: System.get_env("AUTHOR_GITHUB_CLIENT_ID", ""),
author_github_client_secret: System.get_env("AUTHOR_GITHUB_CLIENT_SECRET", ""),
user_github_client_id: System.get_env("USER_GITHUB_CLIENT_ID", ""),
user_github_client_secret: System.get_env("USER_GITHUB_CLIENT_SECRET", "")

# Configure libcluster for horizontal scaling
# Take into account that different strategies could use different config options
config :libcluster,
Expand Down
6 changes: 1 addition & 5 deletions config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ config :oli,
),
favicons: System.get_env("BRANDING_FAVICONS_DIR", "/branding/dev/favicons")
],
always_use_persistent_login_sessions:
get_env_as_boolean.("ALWAYS_USE_PERSISTENT_LOGIN_SESSIONS", "false"),
log_incomplete_requests: get_env_as_boolean.("LOG_INCOMPLETE_REQUESTS", "true")

config :oli, :vendor_property,
Expand All @@ -52,9 +50,7 @@ config :oli, Oli.Repo,
log: String.to_existing_atom(System.get_env("DEV_DB_LOG_LEVEL", "debug"))

# Configure email for development
config :oli, Oli.Mailer, adapter: Bamboo.LocalAdapter

config :oli, OliWeb.Pow.Mailer, adapter: Bamboo.LocalAdapter
config :oli, Oli.Mailer, adapter: Swoosh.Adapters.Local

config :oli,
ecl_username: System.get_env("ECL_USERNAME", ""),
Expand Down
4 changes: 1 addition & 3 deletions config/prod.exs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ config :oli, OliWeb.Endpoint, cache_static_manifest: "priv/static/cache_manifest
config :logger, level: :info

# Configure email for production
config :oli, Oli.Mailer, adapter: Bamboo.SesAdapter

config :oli, OliWeb.Pow.Mailer, adapter: Bamboo.SesAdapter
config :oli, Oli.Mailer, adapter: Swoosh.Adapters.ExAwsAmazonSES

# ## SSL Support
#
Expand Down
Loading

0 comments on commit c4cc85f

Please sign in to comment.