Skip to content

Commit

Permalink
Cherry pick main into V6 (#10828)
Browse files Browse the repository at this point in the history
* fix(TypeaheadSelect): Add callback on clear selection (#10719)

* fix(CodeEditor) resizeObserver resize loop (#10644)

* fix(CodeEditor) resizeObserver resize loop

* yarn

* add debounce

---------

Co-authored-by: Titani <tlabaj@redhat.com>

* cherry pick fix(SimpleSelect,CheckboxSelect): Handle initial selection(s)

* (Drag and drop): Updated example for multi list to use flex

* docs(Table): add Editable Table example

* fix(DragDrop): fix flexgrow type

* feat(MultiTypeaheadSelect): Add MultiTypeaheadSelect to react-templates (#10757)

* feat(MultiTypeaheadSelect): Add MultiTypeaheadSelect to react-templates

* Update packages/react-templates/src/components/Select/MultiTypeaheadSelect.tsx

Co-authored-by: kmcfaul <45077788+kmcfaul@users.noreply.github.com>

---------

Co-authored-by: Titani Labaj <39532947+tlabaj@users.noreply.github.com>
Co-authored-by: kmcfaul <45077788+kmcfaul@users.noreply.github.com>

* fix(TypeaheadSelect): Correctly show the newly selected item on selection (#10792)

* feat(TypeaheadSelect) Add creation options to TypeaheadSelect (#10802)

* update MultiTypeaheadSelect to use label instead of chip

* chore(deps): upgrade eslint-plugin-react to the latest (#10739)

* chore(deps): upgrade `eslint-plugin-markdown` to the latest version (#10738)

Signed-off-by: Jon Koops <jonkoops@gmail.com>

* resolve merge conflicts

* feat(eslint-plugin-patternfly-react): update rules for eslint v9 (#10743)

* resolve conflicts for chore(deps): upgrade ESLint to the latest version

* fix yarn lint issue

* fix yarn lint issue

* fix(TypeaheadSelect): Update input value only when appropriate (#10826)

* fix lint errors and demo-app

---------

Signed-off-by: Jon Koops <jonkoops@gmail.com>
Co-authored-by: Jeff Phillips <jephilli@redhat.com>
Co-authored-by: Dominik Petřík <77832970+Dominik-Petrik@users.noreply.github.com>
Co-authored-by: kmcfaul <45077788+kmcfaul@users.noreply.github.com>
Co-authored-by: Jon Koops <jonkoops@gmail.com>
  • Loading branch information
5 people authored Aug 8, 2024
1 parent 431a35e commit 6c08c96
Show file tree
Hide file tree
Showing 94 changed files with 1,980 additions and 647 deletions.
49 changes: 0 additions & 49 deletions .eslintignore

This file was deleted.

4 changes: 2 additions & 2 deletions .eslintrc-md.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
"react/no-unknown-property": 2,
"react/jsx-no-undef": 2
},
"extends": "plugin:markdown/recommended"
}
"extends": "plugin:markdown/recommended-legacy"
}
152 changes: 0 additions & 152 deletions .eslintrc.json

This file was deleted.

11 changes: 6 additions & 5 deletions .github/split.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
/* eslint-disable no-console */
const fs = require('fs');
const path = require('path');

const BASE_DIR = path.join(__dirname, '../packages/react-integration/cypress/integration');
const WORKER_NUM = +process.env['WORKER_NUM'];
const WORKER_COUNT = +process.env['WORKER_COUNT'];
const WORKER_NUM = +process.env.WORKER_NUM;
const WORKER_COUNT = +process.env.WORKER_COUNT;

const testFiles = fs.readdirSync(BASE_DIR)
const testFiles = fs
.readdirSync(BASE_DIR)
.sort()
.filter((_, i) => i % WORKER_COUNT === WORKER_NUM)
.map(f => path.join(BASE_DIR, f));
.map((f) => path.join(BASE_DIR, f));

console.log(testFiles.join(' '));

57 changes: 30 additions & 27 deletions .github/upload-preview.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console, camelcase */
const path = require('path');
const { Octokit } = require('@octokit/rest');
const octokit = new Octokit({ auth: process.env.GH_PR_TOKEN });
Expand All @@ -12,22 +13,20 @@ const prbranch = process.env.GITHUB_REF.split('/').pop();

const uploadFolder = process.argv[2];
if (!uploadFolder) {
console.log('Usage: upload-preview uploadFolder');
process.exit(1);
}

const uploadFolderName = path.basename(uploadFolder);
let uploadURL = `${repo}-${prnum ? `pr-${prnum}` : prbranch}`.replace(/[\/|\.]/g, '-');
let uploadURL = `${repo}-${prnum ? `pr-${prnum}` : prbranch}`.replace(/[/|.]/g, '-');

switch(uploadFolderName) {
switch (uploadFolderName) {
case 'coverage':
uploadURL += '-a11y.surge.sh';
break;
case 'public':
if (!prnum && prbranch === 'main') {
uploadURL = 'react-staging.patternfly.org';
}
else {
} else {
uploadURL += '.surge.sh';
}
break;
Expand All @@ -54,41 +53,45 @@ function tryAddComment(comment, commentBody) {
}

if (prnum) {
octokit.issues.listComments({
owner,
repo,
issue_number: prnum
})
.then(res => res.data)
.then(comments => {
octokit.issues
.listComments({
owner,
repo,
issue_number: prnum
})
.then((res) => res.data)
.then((comments) => {
let commentBody = '';
const existingComment = comments.find(comment => comment.user.login === 'patternfly-build');
const existingComment = comments.find((comment) => comment.user.login === 'patternfly-build');
if (existingComment) {
commentBody += existingComment.body.trim();
commentBody += '\n\n';
}

if (uploadFolderName === 'public') {
commentBody += tryAddComment(`Preview: https://${uploadURL}`, commentBody);
}
else if (uploadFolderName === 'coverage') {
} else if (uploadFolderName === 'coverage') {
commentBody += tryAddComment(`A11y report: https://${uploadURL}`, commentBody);
}

if (existingComment) {
octokit.issues.updateComment({
owner,
repo,
comment_id: existingComment.id,
body: commentBody
}).then(() => console.log('Updated comment!'));
octokit.issues
.updateComment({
owner,
repo,
comment_id: existingComment.id,
body: commentBody
})
.then(() => console.log('Updated comment!'));
} else {
octokit.issues.createComment({
owner,
repo,
issue_number: prnum,
body: commentBody
}).then(() => console.log('Created comment!'));
octokit.issues
.createComment({
owner,
repo,
issue_number: prnum,
body: commentBody
})
.then(() => console.log('Created comment!'));
}
});
}
36 changes: 36 additions & 0 deletions eslint.config-md.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import markdown from 'eslint-plugin-markdown';
import patternflyReact from 'eslint-plugin-patternfly-react';
import react from 'eslint-plugin-react';
import tseslint from 'typescript-eslint';

export default [
{
ignores: ['.history/*']
},
...markdown.configs.recommended,
{
plugins: {
react,
'patternfly-react': patternflyReact
},
languageOptions: {
parser: tseslint.parser
},
settings: {
react: {
version: 'detect'
}
},
rules: {
'eol-last': 'error',
'spaced-comment': 'error',
'no-unused-vars': 'off',
'no-this-before-super': 'error',
'patternfly-react/import-tokens-icons': 'error',
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'react/no-unknown-property': 'error',
'react/jsx-no-undef': 'error'
}
}
];
Loading

0 comments on commit 6c08c96

Please sign in to comment.