Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update dependencies and replace SCSS variables with CSS #4

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// eslint-disable-next-line import/no-extraneous-dependencies
const { createConfig } = require('@edx/frontend-build');
const { createConfig } = require('@openedx/frontend-build');

module.exports = createConfig('eslint');
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,3 @@ jobs:
run: npm run build
- name: i18n_extract
run: npm run i18n_extract
- name: Coverage
uses: codecov/codecov-action@v3
19,912 changes: 9,650 additions & 10,262 deletions package-lock.json

Large diffs are not rendered by default.

23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@edx/frontend-component-header",
"version": "1.0.0-semantically-released",
"name": "@raccoongang/frontend-component-header",
"version": "5.0.2-tokens.4",
"description": "The standard header for Open edX",
"main": "dist/index.js",
"publishConfig": {
Expand All @@ -12,7 +12,8 @@
"lint": "fedx-scripts eslint --ext .js --ext .jsx .",
"snapshot": "fedx-scripts jest --updateSnapshot",
"start": "fedx-scripts webpack-dev-server --progress",
"test": "fedx-scripts jest --coverage"
"test": "fedx-scripts jest --coverage",
"replace-variables": "paragon replace-variables -p src -t usage"
},
"files": [
"/dist"
Expand All @@ -24,21 +25,21 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/openedx/frontend-component-header.git"
"url": "git+https://github.com/raccoongang/frontend-component-header.git"
},
"author": "edX",
"license": "AGPL-3.0",
"bugs": {
"url": "https://github.com/openedx/frontend-component-header/issues"
"url": "https://github.com/raccoongang/frontend-component-header/issues"
},
"homepage": "https://github.com/openedx/frontend-component-header#readme",
"homepage": "https://github.com/raccoongang/frontend-component-header#readme",
"devDependencies": {
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.2",
"@edx/browserslist-config": "^1.1.1",
"@edx/frontend-platform": "6.2.0",
"@edx/frontend-platform": "npm:@raccoongang/[email protected]",
"@edx/reactifex": "^2.1.1",
"@openedx/frontend-build": "13.0.27",
"@openedx/paragon": "22.0.0",
"@openedx/frontend-build": "npm:@raccoongang/frontend-build@13.1.4-tokens.2",
"@openedx/paragon": "^23.0.0",
"@testing-library/dom": "9.3.4",
"@testing-library/jest-dom": "5.17.0",
"@testing-library/react": "10.4.9",
Expand Down Expand Up @@ -66,10 +67,10 @@
"react-transition-group": "4.4.5"
},
"peerDependencies": {
"@edx/frontend-platform": "^7.0.0",
"@edx/frontend-platform": "^7.0.0 || ^7.1.2-tokens.1",
"prop-types": "^15.5.10",
"react": "^16.9.0 || ^17.0.0",
"react-dom": "^16.9.0 || ^17.0.0",
"@openedx/paragon": ">= 21.5.7 < 23.0.0"
"@openedx/paragon": ">= 21.5.7 < 24.0.0 || ^23.0.0-alpha.1"
}
}
10 changes: 5 additions & 5 deletions src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ $white: #fff;

.site-header-desktop {
box-shadow: 0 1px 0 0 rgba(0,0,0,.1);
background: $white;
background: var(--pgn-color-white);
.nav-link {
text-decoration: none;
}
Expand Down Expand Up @@ -99,13 +99,13 @@ $white: #fff;
.nav-link:focus,
.nav-link.active,
.expanded .nav-link {
background: $component-active-bg;
color: $component-active-color;
background: var(--pgn-color-bg-active);
color: var(--pgn-color-active);
}
.menu {
position: static;
.menu-content {
border-top: solid 2px $component-active-bg;
border-top: solid 2px var(--pgn-color-bg-active);
left: 0;
right: 0;
box-shadow: 0 1px 2px rgba(0,0,0,.25);
Expand All @@ -116,6 +116,6 @@ $white: #fff;
}
}
.search-input {
border-radius: $rounded-pill;
border-radius: var(--pgn-size-rounded-pill);
}
}
14 changes: 9 additions & 5 deletions src/learning-header/LearningHeader.test.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import {
authenticatedUser, initializeMockApp, render, screen,
authenticatedUser, initializeMockApp, render, screen, waitFor,
} from '../setupTest';
import { LearningHeader as Header } from '../index';

Expand All @@ -11,8 +11,10 @@ describe('Header', () => {
});

it('displays user button', () => {
render(<Header />);
expect(screen.getByText(authenticatedUser.username)).toBeInTheDocument();
render(<Header showUserDropdown />);
waitFor(() => {
expect(screen.getByText(authenticatedUser.username)).toBeInTheDocument();
});
});

it('displays course data', () => {
Expand All @@ -23,7 +25,9 @@ describe('Header', () => {
};
render(<Header {...courseData} />);

expect(screen.getByText(`${courseData.courseOrg} ${courseData.courseNumber}`)).toBeInTheDocument();
expect(screen.getByText(courseData.courseTitle)).toBeInTheDocument();
waitFor(() => {
expect(screen.getByText(`${courseData.courseOrg} ${courseData.courseNumber}`)).toBeInTheDocument();
expect(screen.getByText(courseData.courseTitle)).toBeInTheDocument();
});
});
});
10 changes: 5 additions & 5 deletions src/studio-header/StudioHeader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ $white: #FFFFFF;

height: 3.75rem;
box-shadow: 0 1px 0 0 rgb(0 0 0 / .1);
background: $white;
background: var(--pgn-color-white);

.btn-outline-primary {
border-color: $white;
border-color: var(--pgn-color-white);
}

.logo {
Expand All @@ -19,8 +19,8 @@ $white: #FFFFFF;
position: relative;
top: -.05em;
height: 1.75rem;
padding: $spacer 0;
margin-right: $spacer;
padding: var(--pgn-spacing-spacer-base) 0;
margin-right: var(--pgn-spacing-spacer-base);

img {
display: block;
Expand All @@ -31,7 +31,7 @@ $white: #FFFFFF;
.course-title-lockup {
@media only screen and (min-width: 769px) {
padding: .5rem;
padding-right: $spacer;
padding-right: var(--pgn-spacing-spacer-base);
border-right: 1px solid #E5E5E5;
width: 70%;
}
Expand Down
Loading