Compare commits

...

18 Commits

Author SHA1 Message Date
Adam Stankiewicz
2e52d4c24f fix: wip 2023-12-09 15:48:14 -05:00
Adam Stankiewicz
0536f88041 Merge branch 'master' into ags/design-tokens-poc 2023-12-09 15:39:37 -05:00
Adam Stankiewicz
cf3139001a chore: wip 2023-12-05 09:02:02 -05:00
Adam Stankiewicz
1fe2c28932 fix: profile scss clean up with docs 2023-06-08 09:54:46 -04:00
Adam Stankiewicz
f7226b1d12 chore: update gitignore 2023-06-08 09:38:11 -04:00
Adam Stankiewicz
c5d65ccf5c fix: use brandVersion in PARAGON_THEME_URLs 2023-06-05 01:04:56 -04:00
Adam Stankiewicz
99e0b57312 chore: update package-lock.json 2023-06-04 17:20:19 -04:00
Adam Stankiewicz
051b265854 chore: update package-lock.json 2023-06-04 17:18:57 -04:00
Adam Stankiewicz
104b9c6010 fix: update env.config.js 2023-06-04 17:15:35 -04:00
Adam Stankiewicz
f31faa1e11 fix: add env.config.example.js 2023-06-04 17:13:59 -04:00
Adam Stankiewicz
9a7a58b539 fix: use brandOverrides 2023-06-04 17:12:20 -04:00
Adam Stankiewicz
dc9aac20ab chore: add env.config.js 2023-06-02 14:14:46 -04:00
Adam Stankiewicz
340daf90e1 fix: updates 2023-05-29 18:45:26 -04:00
Adam Stankiewicz
6993a0a345 Merge branch 'master' into ags/design-tokens-poc 2023-05-29 16:27:13 -04:00
Adam Stankiewicz
fdddf6efa7 fix: update 2023-05-29 16:22:36 -04:00
Adam Stankiewicz
7b3763a7a1 fix: updates 2023-05-29 15:45:23 -04:00
Adam Stankiewicz
b6d2f840a8 fix: updates 2023-05-28 11:46:07 -04:00
Adam Stankiewicz
3415211566 chore: wip 2023-02-27 15:11:59 -05:00
9 changed files with 4746 additions and 5342 deletions

View File

@@ -1,7 +1,7 @@
NODE_ENV='development'
PORT=1995
ACCESS_TOKEN_COOKIE_NAME='edx-jwt-cookie-header-payload'
BASE_URL='localhost:1995'
BASE_URL='http://localhost:1995'
CREDENTIALS_BASE_URL='http://localhost:18150'
CSRF_TOKEN_API_PATH='/csrf/api/v1/token'
ECOMMERCE_BASE_URL='http://localhost:18130'
@@ -24,7 +24,7 @@ LOGO_TRADEMARK_URL=https://edx-cdn.org/v3/default/logo-trademark.svg
LOGO_WHITE_URL=https://edx-cdn.org/v3/default/logo-white.svg
FAVICON_URL=https://edx-cdn.org/v3/default/favicon.ico
COLLECT_YEAR_OF_BIRTH=true
APP_ID=''
MFE_CONFIG_API_URL=''
APP_ID='profile'
MFE_CONFIG_API_URL='http://localhost:18000/api/mfe_config/v1'
SEARCH_CATALOG_URL='http://localhost:18000/courses'
ENABLE_SKILLS_BUILDER_PROFILE=''

7
.gitignore vendored
View File

@@ -14,6 +14,7 @@ temp/babel-plugin-react-intl
### Emacs ###
*~
/temp
/.vscode
/module.config.js
temp
.vscode
module.config.js
.env.config.js

22
env.config.example.js Normal file
View File

@@ -0,0 +1,22 @@
const config = {
PARAGON_THEME_URLS: {
core: {
urls: {
default: 'https://cdn.jsdelivr.net/npm/@edx/paragon@$paragonVersion/dist/core.min.css',
brandOverride: 'https://cdn.jsdelivr.net/npm/@edx/brand-edx.org@$brandVersion/dist/core.min.css',
},
},
variants: {
light: {
urls: {
default: 'https://cdn.jsdelivr.net/npm/@edx/paragon@$paragonVersion/dist/light.min.css',
brandOverride: 'https://cdn.jsdelivr.net/npm/@edx/brand-edx.org@$brandVersion/dist/light.min.css',
},
default: true,
dark: false,
},
},
},
};
export default config;

22
env.config.js Normal file
View File

@@ -0,0 +1,22 @@
module.exports = {
PARAGON_THEME_URLS: {
core: {
urls: {
default: 'https://cdn.jsdelivr.net/npm/@edx/paragon@alpha/dist/core.min.css',
brandOverride: 'https://cdn.jsdelivr.net/npm/@edx/brand-edx.org@alpha/dist/core.min.css',
},
},
defaults: {
light: 'light',
dark: 'dark',
},
variants: {
light: {
urls: {
default: 'https://cdn.jsdelivr.net/npm/@edx/paragon@$paragonVersion/dist/light.min.css',
brandOverride: 'https://cdn.jsdelivr.net/npm/@edx/brand-edx.org@$brandVersion/dist/light.min.css',
},
},
},
},
};

9939
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -15,8 +15,9 @@
"snapshot": "fedx-scripts jest --updateSnapshot",
"start": "fedx-scripts webpack-dev-server --progress",
"test": "TZ=UTC fedx-scripts jest --coverage --passWithNoTests",
"stubs": "pact-stub-service ./src/pacts/frontend-app-profile-edx-platform.json --port 18000"
"replace-scss-with-css": "replace-scss-with-css"
},
"stubs": "pact-stub-service ./src/pacts/frontend-app-profile-edx-platform.json --port 18000",
"bugs": {
"url": "https://github.com/openedx/frontend-app-profile/issues"
},
@@ -28,11 +29,11 @@
"extends @edx/browserslist-config"
],
"dependencies": {
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.2",
"@edx/brand": "npm:@edx/brand-edx.org@2.2.0-alpha.16",
"@edx/frontend-component-footer": "12.6.0",
"@edx/frontend-component-header": "4.10.1",
"@edx/frontend-platform": "5.6.1",
"@edx/paragon": "^20.44.0",
"@edx/paragon": "21.0.0-alpha.40",
"@fortawesome/fontawesome-svg-core": "1.2.36",
"@fortawesome/free-brands-svg-icons": "5.15.4",
"@fortawesome/free-regular-svg-icons": "5.15.4",
@@ -65,8 +66,8 @@
"devDependencies": {
"@commitlint/cli": "17.8.1",
"@commitlint/config-angular": "17.8.1",
"@edx/browserslist-config": "^1.1.1",
"@edx/frontend-build": "13.0.8",
"@edx/browserslist-config": "1.2.0",
"@edx/frontend-build": "github:openedx/frontend-build#ags/2321",
"@edx/reactifex": "2.2.0",
"@testing-library/react": "12.1.5",
"@wojtekmaj/enzyme-adapter-react-17": "0.8.0",

View File

@@ -1,7 +1,42 @@
@import "~@edx/brand/paragon/fonts";
@import "~@edx/brand/paragon/variables";
@import "~@edx/paragon/scss/core/core";
@import "~@edx/brand/paragon/overrides";
/**
* 1. Remove the prior @edx/paragon and @edx/brand imports:
*/
// @import "~@edx/brand/paragon/fonts";
// @import "~@edx/brand/paragon/variables";
// @import "~@edx/paragon/scss/core/core";
// @import "~@edx/brand/paragon/overrides";
/**
* 2. If using externally hosted CSS, include just the @custom-media breakpoints from @edx/paragon and
* @edx/brand. These will allow the use of CSS media queries such as `@media(--min-pgn-size-breakpoint-md) { ... }`
* throughout your MFE styles.
*
* Note: the @edx/brand breakpoints must be imported _after_ the @edx/paragon breakpoints.
*/
@use "@edx/paragon/styles/css/core/custom-media-breakpoints.css" as paragonCustomMediaBreakpoints;
@use "@edx/brand/paragon/css/core/custom-media-breakpoints.css" as brandCustomMediaBreakpoints;
/**
* 2(a). If using locally installed CSS, include the core.min.css and light.min.css files from @edx/paragon
* and @edx/brand.
*
* Note: the light.min.css file should be imported _after_ the core.min.css file. Also, the @edx/brand files should be
* imported _after_ the @edx/paragon files.
*/
// @use "@edx/paragon/dist/core.min.css";
// @use "@edx/paragon/dist/light.min.css";
// @use "@edx/brand/dist/core.min.css";
// @use "@edx/brand/dist/light.min.css";
/**
* Note: `@edx/frontend-component-header` uses SCSS variables/mixins that are no longer available when using
* already compiled @edx/paragon and @edx/brand CSS styles. For this demo, the `node_module/@edx/frontend-component-header`
* styles were modified to use Paragon's new CSS variables instead.
*
* See https://github.com/openedx/paragon/issues/2348 for more details.
*/
@import "~@edx/frontend-component-header/dist/index";
@import "~@edx/frontend-component-footer/dist/footer";

View File

@@ -6,7 +6,7 @@ import { sendTrackingLogEvent } from '@edx/frontend-platform/analytics';
import { ensureConfig, getConfig } from '@edx/frontend-platform';
import { AppContext } from '@edx/frontend-platform/react';
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
import { Alert, Hyperlink } from '@edx/paragon';
import { Alert, Button, Hyperlink } from '@edx/paragon';
// Actions
import {
@@ -62,6 +62,7 @@ class ProfilePage extends React.Component {
this.handleOpen = this.handleOpen.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
this.handleChange = this.handleChange.bind(this);
this.handleToggleParagonThemeVariant = this.handleToggleParagonThemeVariant.bind(this);
}
componentDidMount() {
@@ -95,6 +96,11 @@ class ProfilePage extends React.Component {
this.props.updateDraft(name, value);
}
handleToggleParagonThemeVariant() {
const nextThemeVariant = this.context.paragonTheme.state.themeVariant === 'light' ? 'dark' : 'light';
this.context.paragonTheme.setThemeVariant(nextThemeVariant);
}
isYOBDisabled() {
const { yearOfBirth } = this.props;
const currentYear = new Date().getFullYear();
@@ -309,6 +315,9 @@ class ProfilePage extends React.Component {
{...commonFormProps}
/>
)}
<Button onClick={this.handleToggleParagonThemeVariant}>
Toggle theme
</Button>
</div>
</div>
</div>
@@ -374,7 +383,7 @@ ProfilePage.propTypes = {
// Learning Goal form data
learningGoal: PropTypes.string,
visibilityLearningGoal: PropTypes.string.isRequired,
visibilityLearningGoal: PropTypes.string,
// Other data we need
profileImage: PropTypes.shape({
@@ -419,6 +428,7 @@ ProfilePage.defaultProps = {
draftSocialLinksByPlatform: {},
bio: null,
learningGoal: null,
visibilityLearningGoal: null,
languageProficiencies: [],
courseCertificates: null,
requiresParentalConsent: null,

View File

@@ -28,7 +28,7 @@
position: absolute;
left: 1.5rem;
top: 5.25rem;
color: $gray-500;
color: var(--pgn-color-gray-500);
line-height: 0.9rem;
font-size: 0.8rem;
font-style: normal;
@@ -42,12 +42,12 @@
.icon-visibility-off {
height: 1rem;
color: $gray-500;
color: var(--pgn-color-gray-500);
}
.profile-page {
.edit-section-header {
@extend .h6;
font-size: var(--pgn-typography-font-size-h6);
display: block;
font-weight: normal;
letter-spacing: 0;
@@ -55,11 +55,11 @@
}
label.edit-section-header {
margin-bottom: $spacer * .5;
margin-bottom: var(--pgn-spacing-spacer-2);
}
.profile-avatar-wrap {
@include media-breakpoint-up(md) {
@media (--min-pgn-size-breakpoint-md) {
max-width: 12rem;
margin-right: 0;
margin-top: -8rem;
@@ -77,25 +77,25 @@
align-items: center;
border-radius: 50%;
@include media-breakpoint-up(md) {
@media (--min-pgn-size-breakpoint-md) {
background: linear-gradient(to top, rgba(0,0,0,.65) 4rem, rgba(0,0,0,0) 4rem);
align-items: flex-end;
}
.btn {
text-decoration: none;
@include media-breakpoint-up(md) {
@media (--min-pgn-size-breakpoint-md) {
margin-bottom: 1.2rem;
}
}
.dropdown {
@include media-breakpoint-up(md) {
@media (--min-pgn-size-breakpoint-md) {
margin-bottom: 1.2rem;
}
.btn {
color: $white;
color: var(--pgn-color-white);
background: transparent;
border-color: transparent;
margin: 0;
@@ -108,7 +108,7 @@
height: 5rem;
position: relative;
@include media-breakpoint-up(md) {
@media (--min-pgn-size-breakpoint-md) {
width: 12rem;
height: 12rem;
}
@@ -128,7 +128,7 @@
border-radius:0;
transition: opacity 200ms ease;
@include media-breakpoint-up(md) {
@media (--min-pgn-size-breakpoint-md) {
height: 4rem;
}
@@ -142,7 +142,7 @@
position: relative;
.certificate-title {
font-family: $font-family-serif;
font-family: var(--pgn-typography-font-family-serif);
font-weight: 400;
}