Skip to content

Commit 117dbfc

Browse files
committed
more clean up
1 parent d131478 commit 117dbfc

14 files changed

Lines changed: 314 additions & 156 deletions

File tree

.github/workflows/build-lint-test.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v4
1111
- run: |
12-
if [[ ! -z "${GH_PR_NUM}" ]]; then
12+
if [[ ! -z "${GH_PR_NUM}" ]]; then
1313
echo "Checking out PR"
1414
git fetch origin pull/$GH_PR_NUM/head:tmp
1515
git checkout tmp
@@ -19,10 +19,12 @@ jobs:
1919
node-version: '20'
2020
- name: Enable Corepack
2121
shell: bash
22-
run: corepack enable
22+
run: |
23+
corepack enable
24+
corepack prepare yarn@4.10.3 --activate
2325
- uses: actions/cache@v4
2426
id: yarn-cache
25-
name: Cache npm deps
27+
name: Cache yarn deps
2628
with:
2729
path: |
2830
node_modules
@@ -48,7 +50,7 @@ jobs:
4850
steps:
4951
- uses: actions/checkout@v4
5052
- run: |
51-
if [[ ! -z "${GH_PR_NUM}" ]]; then
53+
if [[ ! -z "${GH_PR_NUM}" ]]; then
5254
echo "Checking out PR"
5355
git fetch origin pull/$GH_PR_NUM/head:tmp
5456
git checkout tmp
@@ -58,10 +60,12 @@ jobs:
5860
node-version: '20'
5961
- name: Enable Corepack
6062
shell: bash
61-
run: corepack enable
63+
run: |
64+
corepack enable
65+
corepack prepare yarn@4.10.3 --activate
6266
- uses: actions/cache@v4
6367
id: yarn-cache
64-
name: Cache npm deps
68+
name: Cache yarn deps
6569
with:
6670
path: |
6771
node_modules
@@ -75,9 +79,6 @@ jobs:
7579
with:
7680
path: '.eslintcache'
7781
key: ${{ runner.os }}-lint-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
78-
- name: Enable Corepack
79-
shell: bash
80-
run: corepack enable
8182
- name: ESLint
8283
run: yarn lint:js
8384
- name: MDLint
@@ -91,7 +92,7 @@ jobs:
9192
- uses: actions/checkout@v4
9293
# Yes, we really want to checkout the PR
9394
- run: |
94-
if [[ ! -z "${GH_PR_NUM}" ]]; then
95+
if [[ ! -z "${GH_PR_NUM}" ]]; then
9596
echo "Checking out PR"
9697
git fetch origin pull/$GH_PR_NUM/head:tmp
9798
git checkout tmp
@@ -101,16 +102,16 @@ jobs:
101102
node-version: '20'
102103
- name: Enable Corepack
103104
shell: bash
104-
run: corepack enable
105+
run: |
106+
corepack enable
107+
corepack prepare yarn@4.10.3 --activate
105108
- uses: actions/cache@v4
106109
id: yarn-cache
107-
name: Cache npm deps
110+
name: Cache yarn deps
108111
with:
109112
path: |
110113
node_modules
111114
**/node_modules
112-
~/.cache/Cypress
113-
~/.cache/puppeteer
114115
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
115116
- run: yarn install --immutable
116117
if: steps.yarn-cache.outputs.cache-hit != 'true'
@@ -120,7 +121,6 @@ jobs:
120121
with:
121122
path: |
122123
packages/*/dist
123-
packages/react-styles/css
124124
key: ${{ runner.os }}-dist-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock', 'package.json', 'packages/*/*', '!packages/*/dist', '!packages/*/node_modules') }}
125125
- name: Build dist
126126
run: yarn build
@@ -136,7 +136,7 @@ jobs:
136136
- uses: actions/checkout@v4
137137
# Yes, we really want to checkout the PR
138138
- run: |
139-
if [[ ! -z "${GH_PR_NUM}" ]]; then
139+
if [[ ! -z "${GH_PR_NUM}" ]]; then
140140
echo "Checking out PR"
141141
git fetch origin pull/$GH_PR_NUM/head:tmp
142142
git checkout tmp
@@ -146,15 +146,16 @@ jobs:
146146
node-version: '20'
147147
- name: Enable Corepack
148148
shell: bash
149-
run: corepack enable
149+
run: |
150+
corepack enable
151+
corepack prepare yarn@4.10.3 --activate
150152
- uses: actions/cache@v4
151153
id: yarn-cache
152-
name: Cache npm deps
154+
name: Cache yarn deps
153155
with:
154156
path: |
155157
node_modules
156158
**/node_modules
157-
~/.cache/Cypress
158159
~/.cache/puppeteer
159160
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
160161
- run: yarn install --immutable
@@ -165,7 +166,6 @@ jobs:
165166
with:
166167
path: |
167168
packages/*/dist
168-
packages/react-styles/css
169169
key: ${{ runner.os }}-dist-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock', 'package.json', 'packages/*/*', '!packages/*/dist', '!packages/*/node_modules') }}
170170
- name: Build dist
171171
run: yarn build

.github/workflows/build.yml

Lines changed: 0 additions & 58 deletions
This file was deleted.

.github/workflows/pr-preview.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
### WARNING -- this file was generated by generate-workflows
31
name: pr-preview
42
on: pull_request_target
53
jobs:
@@ -23,19 +21,17 @@ jobs:
2321
git rev-parse origin/main..HEAD
2422
git log origin/main..HEAD --format="%b"
2523
26-
# Yes, we really want to checkout the PR
27-
# Injected by generate-workflows.js
2824
- uses: actions/setup-node@v4
2925
with:
3026
node-version: '20'
31-
- name: Enable Corepack and install correct Yarn version
27+
- name: Enable Corepack
3228
shell: bash
3329
run: |
3430
corepack enable
3531
corepack prepare yarn@4.10.3 --activate
3632
- uses: actions/cache@v4
3733
id: yarn-cache
38-
name: Load yarn deps from cache
34+
name: Cache yarn deps
3935
with:
4036
path: |
4137
node_modules

.github/workflows/release.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ jobs:
1919
node-version: '20'
2020
- name: Enable Corepack
2121
shell: bash
22-
run: corepack enable
22+
run: |
23+
corepack enable
24+
corepack prepare yarn@4.10.3 --activate
2325
- uses: actions/cache@v4
2426
id: yarn-cache
25-
name: Cache npm deps
27+
name: Cache yarn deps
2628
with:
2729
path: |
2830
node_modules
2931
**/node_modules
30-
~/.cache/Cypress
31-
~/.cache/puppeteer
3232
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
3333
- run: yarn install --immutable
3434
if: steps.yarn-cache.outputs.cache-hit != 'true'
@@ -38,7 +38,6 @@ jobs:
3838
with:
3939
path: |
4040
packages/*/dist
41-
packages/react-styles/css
4241
key: ${{ runner.os }}-dist-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock', 'package.json', 'packages/*/*', '!packages/*/dist', '!packages/*/node_modules') }}
4342
- name: Build dist
4443
run: yarn build

babel.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ module.exports = {
22
presets: [
33
['@babel/preset-env', { targets: { node: 'current' } }],
44
['@babel/preset-react', { runtime: 'automatic' }],
5-
'@babel/preset-flow',
65
'@babel/preset-typescript'
76
]
87
};

packages/module/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"@babel/plugin-proposal-private-methods": "^7.18.6",
4646
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
4747
"@patternfly/documentation-framework": "^6.24.2",
48-
"@patternfly/patternfly": "^6.5.0-prerelease.33",
48+
"@patternfly/patternfly": "^6.4.0",
4949
"@patternfly/patternfly-a11y": "^5.1.0",
5050
"@patternfly/react-code-editor": "^6.3.1",
5151
"@patternfly/react-table": "^6.3.1",

packages/module/src/WidgetLayout/GridLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ const GridLayout = ({
269269
if (!widget) {
270270
return null;
271271
}
272-
const config = widgetMapping[widgetType]?.config;
272+
const config = widget.config;
273273
return (
274274
<div key={layoutItem.i} data-grid={layoutItem} className={`pf-v6-widget-columns-${layoutItem.w} pf-v6-widget-rows-${layoutItem.h}`}>
275275
<GridTile

packages/module/src/WidgetLayout/GridTile.tsx

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {
99
DropdownList,
1010
Flex,
1111
FlexItem,
12-
HelperText,
13-
HelperTextItem,
1412
Icon,
1513
MenuToggle,
1614
MenuToggleElement,
@@ -120,18 +118,14 @@ const GridTile = ({
120118
analytics?.('widget-layout.widget-remove', { widgetType });
121119
}}
122120
icon={
123-
<Icon className="pf-v6-widget-grid-tile__remove-icon" status={widgetConfig.static ? undefined : 'danger'}>
121+
<Icon status={widgetConfig.static ? undefined : 'danger'}>
124122
<MinusCircleIcon />
125123
</Icon>
126124
}
127125
isDisabled={widgetConfig.static}
126+
description="All 'removed' widgets can be added back by clicking the 'Add widgets' button."
128127
>
129128
Remove
130-
<HelperText>
131-
<HelperTextItem className="pf-v6-widget-grid-tile__remove-helper-text">
132-
{"All 'removed' widgets can be added back by clicking the 'Add widgets' button."}
133-
</HelperTextItem>
134-
</HelperText>
135129
</DropdownItem>
136130
</>
137131
);
@@ -170,7 +164,7 @@ const GridTile = ({
170164
analytics?.('widget-layout.widget-move', { widgetType });
171165
}}
172166
onMouseUp={() => setIsDragging(false)}
173-
className={clsx('pf-v6-widget-drag-handle', {
167+
className={clsx({
174168
'pf-v6-widget-drag-handle--dragging': isDragging,
175169
})}
176170
>
@@ -188,7 +182,7 @@ const GridTile = ({
188182
'pf-v6-widget-grid-tile--static': widgetConfig.static,
189183
})}
190184
>
191-
<CardHeader className="pf-v6-widget-grid-tile__header" actions={{ actions: headerActions }}>
185+
<CardHeader className="pf-v6-widget-grid-tile__header" actions={{ actions: headerActions, hasNoOffset: true }}>
192186
<Flex>
193187
<Flex className="pf-v6-widget-header-layout">
194188
{widgetConfig?.config?.icon && (
@@ -216,6 +210,7 @@ const GridTile = ({
216210
component="a"
217211
href={linkHref}
218212
target={linkTarget}
213+
{...(linkTarget === '_blank' && { rel: 'noopener noreferrer' })}
219214
>
220215
{headerLink.title}
221216
</Button>

packages/module/src/WidgetLayout/WidgetDrawer.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const WidgetWrapper = ({ widgetType, config, onDragStart, onDragEnd }: {
4343
}) => {
4444
const headerActions = (
4545
<Tooltip content={<p>Drag to add widget</p>}>
46-
<Icon className="pf-v6-widget-drawer__drag-handle">
46+
<Icon>
4747
<GripVerticalIcon />
4848
</Icon>
4949
</Tooltip>
@@ -75,7 +75,7 @@ const WidgetWrapper = ({ widgetType, config, onDragStart, onDragEnd }: {
7575
className="pf-v6-widget-grid-tile"
7676
ouiaId={`add-widget-card-${config?.title || widgetType}`}
7777
>
78-
<CardHeader className="pf-v6-widget-drawer__header" actions={{ actions: headerActions }}>
78+
<CardHeader className="pf-v6-widget-drawer__header" actions={{ actions: headerActions, hasNoOffset: true }}>
7979
<Flex className="pf-v6-widget-header-layout">
8080
{config?.icon && (
8181
<Icon size="md">
@@ -119,9 +119,9 @@ const WidgetDrawer = ({
119119
<Title headingLevel="h2" size="md" className="pf-v6-widget-drawer__title">
120120
{instructionText || (
121121
<>
122-
{defaultInstructionText.split('icon').map((part, i) =>
123-
i === 0 ? part : (
124-
<React.Fragment key={i}>
122+
{defaultInstructionText.split('icon').map((part, index) =>
123+
index === 0 ? part : (
124+
<React.Fragment key={`icon-${index}`}>
125125
<GripVerticalIcon />
126126
{part}
127127
</React.Fragment>
@@ -144,8 +144,8 @@ const WidgetDrawer = ({
144144
</SplitItem>
145145
</Split>
146146
<Gallery className="pf-v6-widget-gallery" hasGutter>
147-
{filteredWidgetMapping.map(([type, widget], i) => (
148-
<GalleryItem key={i}>
147+
{filteredWidgetMapping.map(([type, widget]) => (
148+
<GalleryItem key={type}>
149149
<WidgetWrapper
150150
widgetType={type}
151151
config={widget.config}

0 commit comments

Comments
 (0)