-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enabled one academy feature. (#1054)
- Loading branch information
1 parent
c0e341a
commit d70b1d6
Showing
16 changed files
with
240 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Link } from 'react-router-dom'; | ||
import { Button } from '@openedx/paragon'; | ||
import { FormattedMessage } from '@edx/frontend-platform/i18n'; | ||
import React from 'react'; | ||
import useEnterpriseCustomer from '../app/data/hooks/useEnterpriseCustomer'; | ||
import { useAcademies } from '../app/data'; | ||
|
||
const GoToAcademy = () => { | ||
const { data: academies } = useAcademies(); | ||
const { data: enterpriseCustomer } = useEnterpriseCustomer(); | ||
|
||
return ( | ||
<> | ||
<p> | ||
<FormattedMessage | ||
id="enterprise.dashboard.tab.courses.go.to.academy.message" | ||
defaultMessage="Getting started with edX is easy. Simply find a course from your Academy, request enrollment, and get started on your learning journey." | ||
description="Default message shown to a learner on enterprise dashboard." | ||
/> | ||
</p> | ||
<Button | ||
as={Link} | ||
to={`/${enterpriseCustomer.slug}/academies/${academies[0].uuid}`} | ||
className="btn-brand-primary d-block d-md-inline-block" | ||
> | ||
<FormattedMessage | ||
id="enterprise.dashboard.tab.courses.go.to.academy" | ||
defaultMessage="Go to Academy" | ||
description="Label to go to academy button on enterprise dashboard." | ||
/> | ||
</Button> | ||
</> | ||
); | ||
}; | ||
|
||
export default GoToAcademy; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/components/app/data/services/data/__factories__/academies.factory.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Factory } from 'rosie'; // eslint-disable-line import/no-extraneous-dependencies | ||
import { faker } from '@faker-js/faker'; // eslint-disable-line import/no-extraneous-dependencies | ||
import { camelCaseObject } from '@edx/frontend-platform'; | ||
import { v4 as uuidv4 } from 'uuid'; | ||
|
||
Factory.define('academy') | ||
.attr('uuid', uuidv4()) | ||
.attr('title', faker.lorem.words()) | ||
.attr('short_description', faker.lorem.sentence(50)) | ||
.attr('long_description', faker.lorem.sentence(20)) | ||
.attr('image', faker.image.urlPlaceholder()) | ||
.attr('tags', []); | ||
|
||
export function academyFactory(overrides = {}) { | ||
return camelCaseObject(Factory.build('academy', overrides)); | ||
} | ||
|
||
export function academiesFactory(count = 1, overrides = {}) { | ||
return Array.from({ length: count }, () => academyFactory(overrides)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import './enterpriseCustomerUser.factory'; | ||
|
||
export * from './enterpriseCustomerUser.factory'; | ||
export * from './academies.factory'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.