-
-
- Cornerstone Instance URL
+
-
+ Your Cornerstone instance URL. Make sure to include the protocol (ie https/http)
+ {state.invalidFields.cornerstoneBaseUrl && (
+ }>
+ Cornerstone Instance URL is required.
+
+ )}
+
diff --git a/src/components/LmsConfigurations/DegreedIntegrationConfigForm.jsx b/src/components/LmsConfigurations/DegreedIntegrationConfigForm.jsx
index 9ba5208a45..fec960bcb7 100644
--- a/src/components/LmsConfigurations/DegreedIntegrationConfigForm.jsx
+++ b/src/components/LmsConfigurations/DegreedIntegrationConfigForm.jsx
@@ -2,8 +2,9 @@ import React, { useState } from 'react';
import PropTypes from 'prop-types';
import isEmpty from 'lodash/isEmpty';
import {
- ValidationFormGroup, Input, StatefulButton, Icon,
+ Form, StatefulButton, Icon,
} from '@edx/paragon';
+import { Error } from '@edx/paragon/icons';
import { snakeCaseFormData } from '../../utils';
import LmsApiService from '../../data/services/LmsApiService';
import StatusAlert from '../StatusAlert';
@@ -19,6 +20,46 @@ export const REQUIRED_DEGREED_CONFIG_FIELDS = [
'key',
];
+const DEGREED_FIELDS = [
+ {
+ key: 'degreedCompanyId',
+ invalidMessage: 'Degreed Organization Code is required.',
+ helpText: 'The organization code provided to you by Degreed.',
+ label: 'Degreed Organization Code',
+ },
+ {
+ key: 'degreedBaseUrl',
+ invalidMessage: 'Degreed Instance URL is required.',
+ helpText: 'Your Degreed instance URL. Make sure to include the protocol (ie https/http)',
+ label: 'Degreed Instance URL',
+ },
+ {
+ key: 'key',
+ invalidMessage: 'Degreed API Client ID required.',
+ helpText: 'The API Client ID used to make calls to Degreed on behalf of the customer.',
+ label: 'API Client ID',
+ },
+ {
+ key: 'secret',
+ invalidMessage: 'Degreed API Client Secret required.',
+ helpText: 'The API Client Secret used to make calls to Degreed on behalf of the customer.',
+ label: 'API Client Secret',
+ },
+ {
+ key: 'degreedUserId',
+ invalidMessage: 'The Degreed User ID is required to access Degreed via Oauth.',
+ helpText: 'The Degreed User ID provided to the content provider by Degreed.',
+ label: 'Degreed User ID',
+ },
+ {
+ key: 'degreedUserPassword',
+ invalidMessage: 'The Degreed User Password is required to access Degreed via Oauth.',
+ helpText: 'The Degreed User Password provided to the content provider by Degreed.',
+ label: 'Degreed User Password',
+ type: 'password',
+ },
+];
+
function configFormReducer(state, action) {
switch (action.type) {
case 'PENDING': {
@@ -184,135 +225,42 @@ function DegreedIntegrationConfigForm({ enterpriseId, config }) {
diff --git a/src/components/LmsConfigurations/MoodleIntegrationConfigForm.jsx b/src/components/LmsConfigurations/MoodleIntegrationConfigForm.jsx
index f7495ae560..c4ccc3105d 100644
--- a/src/components/LmsConfigurations/MoodleIntegrationConfigForm.jsx
+++ b/src/components/LmsConfigurations/MoodleIntegrationConfigForm.jsx
@@ -2,8 +2,9 @@ import React from 'react';
import PropTypes from 'prop-types';
import isEmpty from 'lodash/isEmpty';
import {
- ValidationFormGroup, Input, StatefulButton, Icon,
+ Form, StatefulButton, Icon,
} from '@edx/paragon';
+import { Error } from '@edx/paragon/icons';
import { snakeCaseFormData } from '../../utils';
import LmsApiService from '../../data/services/LmsApiService';
import StatusAlert from '../StatusAlert';
@@ -15,6 +16,48 @@ export const REQUIRED_MOODLE_CONFIG_FIELDS = [
'serviceShortName',
];
+const MOODLE_FIELDS = [
+ {
+ key: 'moodleBaseUrl',
+ invalidMessage: 'Moodle Instance URL is required.',
+ helpText: 'Your Moodle instance URL. Make sure to include the protocol (ie https/http)',
+ label: 'Moodle Instance URL',
+ },
+ {
+ key: 'serviceShortName',
+ invalidMessage: 'Webservice name is required.',
+ helpText: 'This should match the webservice\'s short name in Moodle.',
+ label: 'Webservice\'s Short Name',
+ },
+ {
+ key: 'categoryId',
+ helpText: 'The category id all edX courses will be added under. Default is 1 (Miscellaneous)',
+ type: 'number',
+ label: 'Moodle Category ID',
+ },
+ {
+ key: 'username',
+ invalidMessage: 'A username and password must be provided when a token is not. However, you should not provide both user credentials and token.',
+ helpText: 'The Webservice\'s username in Moodle. You must provide this and password or a token',
+ label: 'Webservice Username',
+ invalidAdditionalCondition: 'duplicateCreds',
+ },
+ {
+ key: 'password',
+ invalidMessage: 'A username and password must be provided when a token is not. However, you should not provide both user credentials and token.',
+ helpText: 'The Webservice\'s password in Moodle. You must provide this and username or a token',
+ label: 'Webservice Password',
+ invalidAdditionalCondition: 'duplicateCreds',
+ },
+ {
+ key: 'token',
+ invalidMessage: 'A token must be provided when username/password is not. However, you should not provide both user credentials and token.',
+ helpText: 'The Webservice user\'s auth token. Use this in place of a username/password.',
+ label: 'Webservice Auth Token',
+ invalidAdditionalCondition: 'duplicateCreds',
+ },
+];
+
class MoodleIntegrationConfigForm extends React.Component {
state = {
invalidFields: {},
@@ -137,133 +180,45 @@ class MoodleIntegrationConfigForm extends React.Component {
>