Skip to content

Commit

Permalink
if interactiveApi url param, then hide cfm menu
Browse files Browse the repository at this point in the history
The interactieApi url param is added to the URL when a activity player embedded share link is copied
from the CFM share menu.
The CODAP v2 code also checked for older url params `lara` and `launchFromLara`. There are no interactives
in the LARA authoring system which use those older params, so support for them is dropped.
  • Loading branch information
scytacki committed Oct 22, 2024
1 parent 2fb7a23 commit 9b54cf1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
15 changes: 7 additions & 8 deletions v3/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module.exports = {
parserOptions: {
ecmaVersion: 2018,
sourceType: "module",
project: ["./tsconfig.json", "./tsconfig.v2.json", "./cypress/tsconfig.json"]
project: ["./tsconfig.json", "./tsconfig.v2.json", "./cypress/tsconfig.json"],
tsconfigRootDir: __dirname,
},
plugins: ["@typescript-eslint", "json", "react", "react-hooks"],
env: {
Expand Down Expand Up @@ -168,19 +169,17 @@ module.exports = {
},
{ // Lint configs in the base v3 directory
// (Do not add cypress.config.ts, as that was autogenerated)
files: [".eslintrc*.cjs", "./*.config.js", "why-did-you-render.ts"],
env: {
node: true
}
},
{ // webpack configs
files: ["**/webpack.config.js"],
files: ["./*.cjs", "./*.config.js", "why-did-you-render.ts"],
env: {
node: true
},
},
{ // configs that use require statements
files: ["./*.cjs", "./postcss.config.js", "**/webpack.config.js"],
rules: {
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-var-requires": "off",
// This can be used for more strict webpack config linting which matches the webpack examples
// "quotes": ["error", "single", { allowTemplateLiterals: true, avoidEscape: true }],
}
}
Expand Down
2 changes: 1 addition & 1 deletion v3/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
plugins: [
require('autoprefixer') // eslint-disable-line @typescript-eslint/no-require-imports
require('autoprefixer')
]
}
4 changes: 3 additions & 1 deletion v3/src/lib/use-cloud-file-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { appState } from "../models/app-state"
import { createCodapDocument, isCodapDocument } from "../models/codap/create-codap-document"
import { gLocale } from "../utilities/translation/locale"
import { t } from "../utilities/translation/translate"
import { removeDevUrlParams } from "../utilities/url-params"
import { removeDevUrlParams, urlParams } from "../utilities/url-params"

const locales = [
{
Expand Down Expand Up @@ -147,6 +147,8 @@ export function useCloudFileManager(optionsArg: CFMAppOptions) {
useEffect(function initCfm() {

const _options: CFMAppOptions = {
// When running in the Activity Player, hide the hamburger menu
hideMenuBar: urlParams.interactiveApi !== undefined,
ui: {
menuBar: {
info: "Language menu",
Expand Down
6 changes: 6 additions & 0 deletions v3/src/utilities/url-params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ export interface UrlParams {
* value: ignored
*/
ICI?: string | null
/*
* Indicates CODAP is running in the Activity Player. Used by the CFM and to configure
* the CFM.
* value: ignored
*/
interactiveApi?: string | null
/*
* [v2] Specifies the default locale, overriding the browser default.
* value: locale string, e.g. `en-US` or `es`
Expand Down

0 comments on commit 9b54cf1

Please sign in to comment.