Skip to content
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.

BB-2240: Custom page editor #556

Merged
merged 13 commits into from
Apr 14, 2020
13 changes: 13 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@
},
"dependencies": {
"@fortawesome/fontawesome-free": "^5.12.0",
"@tinymce/tinymce-react": "^3.5.0",
"@types/react-color": "^3.0.1",
"history": "^4.10.1",
"immutability-helper": "^3.0.1",
"react-color": "^2.18.0"
"react-color": "^2.18.0",
"tinymce": "^5.2.1"
}
}
6 changes: 5 additions & 1 deletion frontend/packages/api_client/src/apis/V2Api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* API for OpenCraft Instance Manager
*
* The version of the OpenAPI document: api
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
Expand Down Expand Up @@ -511,6 +511,10 @@ export class V2Api extends runtime.BaseAPI {
let useForm = false;
// use FormData to transmit files using content-type "multipart/form-data"
useForm = canConsumeForm;
// use FormData to transmit files using content-type "multipart/form-data"
useForm = canConsumeForm;
// use FormData to transmit files using content-type "multipart/form-data"
useForm = canConsumeForm;
giovannicimolin marked this conversation as resolved.
Show resolved Hide resolved
if (useForm) {
formParams = new FormData();
} else {
Expand Down
70 changes: 0 additions & 70 deletions frontend/packages/api_client/src/models/LogoFaviconUpload.ts

This file was deleted.

14 changes: 14 additions & 0 deletions frontend/packages/api_client/src/models/OpenEdXInstanceConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ export interface OpenEdXInstanceConfig {
* @memberof OpenEdXInstanceConfig
*/
readonly id?: number;
/**
*
* @type {string}
* @memberof OpenEdXInstanceConfig
*/
readonly lmsUrl?: string;
/**
*
* @type {string}
* @memberof OpenEdXInstanceConfig
*/
readonly studioUrl?: string;
/**
* The URL students will visit. In the future, you will also have the possibility to use your own domain name. Example: hogwarts.opencraft.hosting
* @type {string}
Expand Down Expand Up @@ -115,6 +127,8 @@ export function OpenEdXInstanceConfigFromJSONTyped(json: any, ignoreDiscriminato
return {

'id': !exists(json, 'id') ? undefined : json['id'],
'lmsUrl': !exists(json, 'lms_url') ? undefined : json['lms_url'],
'studioUrl': !exists(json, 'studio_url') ? undefined : json['studio_url'],
'subdomain': json['subdomain'],
'externalDomain': !exists(json, 'external_domain') ? undefined : json['external_domain'],
'instanceName': json['instance_name'],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
/* tslint:disable */
/* eslint-disable */
/**
* OpenCraft Instance Manager
* API for OpenCraft Instance Manager
*
* The version of the OpenAPI document: api
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import { exists, mapValues } from '../runtime';
import {
StaticContentOverrides,
StaticContentOverridesFromJSON,
StaticContentOverridesFromJSONTyped,
StaticContentOverridesToJSON,
ThemeSchema,
ThemeSchemaFromJSON,
ThemeSchemaFromJSONTyped,
ThemeSchemaToJSON,
} from './';

/**
*
* @export
* @interface OpenEdXInstanceConfigExtended
*/
export interface OpenEdXInstanceConfigExtended {
/**
*
* @type {number}
* @memberof OpenEdXInstanceConfigExtended
*/
readonly id?: number;
/**
* The URL students will visit. In the future, you will also have the possibility to use your own domain name. Example: hogwarts.opencraft.hosting
* @type {string}
* @memberof OpenEdXInstanceConfigExtended
*/
subdomain: string;
/**
* The URL students will visit if you are using an external domain.
* @type {string}
* @memberof OpenEdXInstanceConfigExtended
*/
externalDomain?: string | null;
/**
* The name of your institution, company or project. Example: Hogwarts Online Learning
* @type {string}
* @memberof OpenEdXInstanceConfigExtended
*/
instanceName: string;
/**
* The email your instance of Open edX will be using to send emails, and where your users should send their support requests. This needs to be a valid email.
* @type {string}
* @memberof OpenEdXInstanceConfigExtended
*/
publicContactEmail: string;
/**
* URL to the privacy policy.
* @type {string}
* @memberof OpenEdXInstanceConfigExtended
*/
privacyPolicyUrl?: string;
/**
* The advanced theme allows users to pick a lot more details than the regular theme.Setting this flag will enable the more complex theme editor.
* @type {boolean}
* @memberof OpenEdXInstanceConfigExtended
*/
useAdvancedTheme?: boolean;
/**
*
* @type {ThemeSchema}
* @memberof OpenEdXInstanceConfigExtended
*/
draftThemeConfig?: ThemeSchema;
/**
* Your branding to be displayed throughout your instance. It should be 48px tall. If unset, OpenCraft\'s logo will be used.
* @type {string}
* @memberof OpenEdXInstanceConfigExtended
*/
readonly logo?: string | null;
/**
* This is used as the browser tab icon for your instance\'s pages. If unset, OpenCraft\'s icon will be used.
* @type {string}
* @memberof OpenEdXInstanceConfigExtended
*/
readonly favicon?: string | null;
/**
* This is used as the cover image for the hero section in the instance LMS home page.
* @type {string}
* @memberof OpenEdXInstanceConfigExtended
*/
readonly heroCoverImage?: string | null;
/**
*
* @type {StaticContentOverrides}
* @memberof OpenEdXInstanceConfigExtended
*/
draftStaticContentOverrides?: StaticContentOverrides;
/**
*
* @type {string}
* @memberof OpenEdXInstanceConfigExtended
*/
readonly lmsUrl?: string;
/**
*
* @type {string}
* @memberof OpenEdXInstanceConfigExtended
*/
readonly studioUrl?: string;
}

export function OpenEdXInstanceConfigExtendedFromJSON(json: any): OpenEdXInstanceConfigExtended {
return OpenEdXInstanceConfigExtendedFromJSONTyped(json, false);
}

export function OpenEdXInstanceConfigExtendedFromJSONTyped(json: any, ignoreDiscriminator: boolean): OpenEdXInstanceConfigExtended {
if ((json === undefined) || (json === null)) {
return json;
}
return {

'id': !exists(json, 'id') ? undefined : json['id'],
'subdomain': json['subdomain'],
'externalDomain': !exists(json, 'external_domain') ? undefined : json['external_domain'],
'instanceName': json['instance_name'],
'publicContactEmail': json['public_contact_email'],
'privacyPolicyUrl': !exists(json, 'privacy_policy_url') ? undefined : json['privacy_policy_url'],
'useAdvancedTheme': !exists(json, 'use_advanced_theme') ? undefined : json['use_advanced_theme'],
'draftThemeConfig': !exists(json, 'draft_theme_config') ? undefined : ThemeSchemaFromJSON(json['draft_theme_config']),
'logo': !exists(json, 'logo') ? undefined : json['logo'],
'favicon': !exists(json, 'favicon') ? undefined : json['favicon'],
'heroCoverImage': !exists(json, 'hero_cover_image') ? undefined : json['hero_cover_image'],
'draftStaticContentOverrides': !exists(json, 'draft_static_content_overrides') ? undefined : StaticContentOverridesFromJSON(json['draft_static_content_overrides']),
'lmsUrl': !exists(json, 'lms_url') ? undefined : json['lms_url'],
'studioUrl': !exists(json, 'studio_url') ? undefined : json['studio_url'],
};
}

export function OpenEdXInstanceConfigExtendedToJSON(value?: OpenEdXInstanceConfigExtended | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {

'subdomain': value.subdomain,
'external_domain': value.externalDomain,
'instance_name': value.instanceName,
'public_contact_email': value.publicContactEmail,
'privacy_policy_url': value.privacyPolicyUrl,
'use_advanced_theme': value.useAdvancedTheme,
'draft_theme_config': ThemeSchemaToJSON(value.draftThemeConfig),
'draft_static_content_overrides': StaticContentOverridesToJSON(value.draftStaticContentOverrides),
};
}


Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ import {
* @interface OpenEdXInstanceConfigUpdate
*/
export interface OpenEdXInstanceConfigUpdate {
/**
*
* @type {string}
* @memberof OpenEdXInstanceConfigUpdate
*/
readonly lmsUrl?: string;
/**
*
* @type {string}
* @memberof OpenEdXInstanceConfigUpdate
*/
readonly studioUrl?: string;
/**
* The URL students will visit. In the future, you will also have the possibility to use your own domain name. Example: hogwarts.opencraft.hosting
* @type {string}
Expand Down Expand Up @@ -108,6 +120,8 @@ export function OpenEdXInstanceConfigUpdateFromJSONTyped(json: any, ignoreDiscri
}
return {

'lmsUrl': !exists(json, 'lms_url') ? undefined : json['lms_url'],
'studioUrl': !exists(json, 'studio_url') ? undefined : json['studio_url'],
'subdomain': !exists(json, 'subdomain') ? undefined : json['subdomain'],
'externalDomain': !exists(json, 'external_domain') ? undefined : json['external_domain'],
'instanceName': !exists(json, 'instance_name') ? undefined : json['instance_name'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export interface StaticContentOverrides {
* @type {string}
* @memberof StaticContentOverrides
*/
staticTemplatesPrivacyContent?: string;
staticTemplatePrivacyContent?: string;
/**
*
* @type {string}
Expand Down Expand Up @@ -127,7 +127,7 @@ export function StaticContentOverridesFromJSONTyped(json: any, ignoreDiscriminat
'staticTemplateHonorHeader': !exists(json, 'static_template_honor_header') ? undefined : json['static_template_honor_header'],
'staticTemplateHonorContent': !exists(json, 'static_template_honor_content') ? undefined : json['static_template_honor_content'],
'staticTemplatePrivacyHeader': !exists(json, 'static_template_privacy_header') ? undefined : json['static_template_privacy_header'],
'staticTemplatesPrivacyContent': !exists(json, 'static_templates_privacy_content') ? undefined : json['static_templates_privacy_content'],
'staticTemplatePrivacyContent': !exists(json, 'static_template_privacy_content') ? undefined : json['static_template_privacy_content'],
'homepageOverlayHtml': !exists(json, 'homepage_overlay_html') ? undefined : json['homepage_overlay_html'],
};
}
Expand All @@ -153,7 +153,7 @@ export function StaticContentOverridesToJSON(value?: StaticContentOverrides | nu
'static_template_honor_header': value.staticTemplateHonorHeader,
'static_template_honor_content': value.staticTemplateHonorContent,
'static_template_privacy_header': value.staticTemplatePrivacyHeader,
'static_templates_privacy_content': value.staticTemplatesPrivacyContent,
'static_template_privacy_content': value.staticTemplatePrivacyContent,
'homepage_overlay_html': value.homepageOverlayHtml,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ describe("Console Page", function() {
id: 1,
instanceName: "test",
subdomain: "test",
lmsUrl: "test-url",
studioUrl: "test-url"
},
deployment: {
status: "NO_STATUS",
Expand Down
Loading