Skip to content

Commit 6ad582d

Browse files
TCA-584 #comment This commit adds support for the UI to tell the API to generate alternate versions of images. #time 1h
1 parent ef04a4b commit 6ad582d

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src-ts/tools/learn/learn-config/learn-config.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export interface LearnConfigModel {
22
API: string
3+
CERT_ALT_PARAMS: { [key: string]: string }
34
CERT_DOMAIN: string
45
CERT_ELEMENT_SELECTOR: {
56
attribute: string,

src-ts/tools/learn/learn-config/learn.default.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import { LearnConfigModel } from './learn-config.model'
22

33
export const LearnConfigDefault: LearnConfigModel = {
44
API: 'http://localhost:3001/v5/learning-paths',
5+
CERT_ALT_PARAMS: {
6+
'view-port': 'large-container',
7+
},
58
CERT_DOMAIN: 'https://certificate.topcoder-dev.com',
69
CERT_ELEMENT_SELECTOR: {
710
attribute: 'data-id',

src-ts/tools/learn/learn-lib/user-certifications-provider/user-certifications-functions/user-certification-progress.store.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { logInfo } from '../../../../../lib'
21
import { LearnConfig } from '../../../learn-config'
32
import { getUserCertificateUrl } from '../../../learn.routes'
43
import { learnUrlGet, learnXhrGetAsync, learnXhrPostAsync, learnXhrPutAsync } from '../../functions'
@@ -16,15 +15,15 @@ export function completeCourse(
1615
): Promise<LearnUserCertificationProgress> {
1716

1817
// construct the certificate params
18+
const certificateAlternateParams: { [key: string]: string } = LearnConfig.CERT_ALT_PARAMS
1919
const certificateElement: string = `[${LearnConfig.CERT_ELEMENT_SELECTOR.attribute}=${LearnConfig.CERT_ELEMENT_SELECTOR.value}]`
2020
const certificateUrl: string = getUserCertificateUrl(provider, certification, handle)
2121

22-
logInfo(`Completing course w certificate URL = ${certificateUrl}`)
23-
2422
return updateAsync(
2523
certificationProgressId,
2624
UserCertificationUpdateProgressActions.completeCertificate,
2725
{
26+
certificateAlternateParams,
2827
certificateElement,
2928
certificateUrl,
3029
}

0 commit comments

Comments
 (0)