Skip to content

Commit

Permalink
Fixes #35978 - Update pf to 2022.16+ release
Browse files Browse the repository at this point in the history
Updates foreman-js(patternfly) to have access to the name prop in Search
  • Loading branch information
MariaAga authored and ekohl committed Feb 10, 2023
1 parent 173ce1c commit fc0ad65
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 17 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@
"create-react-component": "yo react-domain"
},
"dependencies": {
"@theforeman/vendor": "^10.1.0",
"@theforeman/vendor": "^12.0.1",
"graphql-tag": "^2.11.0",
"intl": "~1.2.5",
"jed": "^1.1.1",
"react-intl": "^2.8.0"
},
"devDependencies": {
"@babel/core": "^7.7.0",
"@theforeman/builder": "^10.1.0",
"@theforeman/eslint-plugin-foreman": "^10.1.0",
"@theforeman/stories": "^10.1.0",
"@theforeman/test": "^10.1.0",
"@theforeman/vendor-dev": "^10.1.0",
"@theforeman/builder": "^12.0.1",
"@theforeman/eslint-plugin-foreman": "^12.0.1",
"@theforeman/stories": "^12.0.1",
"@theforeman/test": "^12.0.1",
"@theforeman/vendor-dev": "^12.0.1",
"@types/jest": "<27.0.0",
"argv-parse": "^1.0.1",
"babel-eslint": "^10.0.0",
Expand Down
4 changes: 2 additions & 2 deletions test/integration/config_report_js_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ConfigReportJSTest < IntegrationTestWithJavascript
report
visit config_reports_path
click_link(report.host.name)
has_selector?(".pf-c-search-input__text-input", text: "host = #{report.host.name}", wait: 3)
assert_equal "host = #{report.host.name}", find('.pf-c-search-input__text-input').value
has_selector?(".pf-c-text-input-group__text-input", text: "host = #{report.host.name}", wait: 3)
assert_equal "host = #{report.host.name}", find('.pf-c-text-input-group__text-input').value
end
end
12 changes: 6 additions & 6 deletions test/integration/fact_value_js_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ def setup
within(:xpath, "//tr[contains(.,'#{@fact_name.name}')]") do
click_link(@host.fqdn)
end
has_selector?(".pf-c-search-input__text-input", text: "host = #{@host.fqdn}", wait: 3)
assert_equal "host = #{@host.fqdn}", find('.pf-c-search-input__text-input').value
has_selector?(".pf-c-text-input-group__text-input", text: "host = #{@host.fqdn}", wait: 3)
assert_equal "host = #{@host.fqdn}", find('.pf-c-text-input-group__text-input').value
end
test "fact_name fact links" do
visit fact_values_path
find(:xpath, "//tr[contains(.,'#{@fact_name.name}')]//td[2]//a").click
has_selector?(".pf-c-search-input__text-input", text: "name = #{@fact_name.name}", wait: 3)
assert_equal "name = #{@fact_name.name}", find('.pf-c-search-input__text-input').value
has_selector?(".pf-c-text-input-group__text-input", text: "name = #{@fact_name.name}", wait: 3)
assert_equal "name = #{@fact_name.name}", find('.pf-c-text-input-group__text-input').value
end
test "value fact links" do
visit fact_values_path
click_link(@value.value)
has_selector?(".pf-c-search-input__text-input", text: "facts.#{@fact_name.name} = \"#{@value.value}\"", wait: 3)
assert_equal "facts.#{@fact_name.name} = \"#{@value.value}\"", find('.pf-c-search-input__text-input').value
has_selector?(".pf-c-text-input-group__text-input", text: "facts.#{@fact_name.name} = \"#{@value.value}\"", wait: 3)
assert_equal "facts.#{@fact_name.name} = \"#{@value.value}\"", find('.pf-c-text-input-group__text-input').value
end
end
2 changes: 1 addition & 1 deletion test/integration/search_bar_js_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ class SearchBarTest < IntegrationTestWithJavascript
visit bookmarks_path
# needs to be interactive element
find('table thead').find('a', text: 'Name').send_keys("/")
assert_includes(page.evaluate_script("document.activeElement.classList"), "pf-c-search-input__text-input")
assert_includes(page.evaluate_script("document.activeElement.classList"), "pf-c-text-input-group__text-input")
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ exports[`TaxonomyDropdown rendering rendering 1`] = `
</ContextSelectorFooter>
}
id="organization-dropdown"
isFlipEnabled={true}
isOpen={false}
isPlain={false}
isText={false}
Expand All @@ -214,11 +215,13 @@ exports[`TaxonomyDropdown rendering rendering 1`] = `
onSelect={[Function]}
onToggle={[Function]}
ouiaSafe={true}
removeFindDomNode={false}
screenReaderLabel="Selected Taxonomy:"
searchButtonAriaLabel="Search menu items"
searchInputPlaceholder="Search"
searchInputValue=""
toggleText="org1"
zIndex={9999}
>
<ContextSelectorItem
className="organizations_clear"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const SearchAutocomplete = ({
onSearch,
disabled,
error,
name,
}) => {
const [isAutocompleteOpen, setIsAutocompleteOpen] = useState(false);
const searchWrapperRef = useRef(null);
Expand Down Expand Up @@ -115,6 +116,7 @@ export const SearchAutocomplete = ({
isDisabled={disabled}
placeholder={__('Search')}
resetButtonLabel={__('Reset search')}
name={name}
/>
</div>
);
Expand Down Expand Up @@ -146,10 +148,12 @@ SearchAutocomplete.propTypes = {
onSearch: PropTypes.func,
disabled: PropTypes.bool,
error: PropTypes.string,
name: PropTypes.string,
};

SearchAutocomplete.defaultProps = {
onSearch: null,
disabled: false,
error: null,
name: null,
};
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const SearchBar = ({
initialQuery,
onSearch,
onSearchChange,
name,
}) => {
const [search, setSearch] = useState(initialQuery || searchQuery || '');
const { response, status, setAPIOptions } = useAPI('get', url, {
Expand Down Expand Up @@ -51,6 +52,7 @@ const SearchBar = ({
onSearch={onSearch}
disabled={disabled}
error={error}
name={name}
/>
{!isEmpty(bookmarks) && (
<Bookmarks
Expand Down Expand Up @@ -85,12 +87,14 @@ SearchBar.propTypes = {
initialQuery: PropTypes.string,
onSearch: PropTypes.func,
onSearchChange: PropTypes.func,
name: PropTypes.string,
};

SearchBar.defaultProps = {
initialQuery: '',
onSearch: searchQuery => changeQuery({ search: searchQuery.trim(), page: 1 }),
onSearchChange: noop,
name: null,
};

export default SearchBar;
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@ exports[`RegistrationCommandsPage - Command renders 1`] = `
additionalActions={null}
clickTip="Successfully copied to clipboard!"
entryDelay={300}
exitDelay={1600}
exitDelay={1500}
hoverTip="Copy to clipboard"
isCode={true}
isExpanded={true}
isReadOnly={true}
maxWidth="150px"
onChange={[Function]}
onCopy={[Function]}
ouiaSafe={true}
position="top"
switchDelay={2000}
removeFindDomNode={false}
textAriaLabel="Copyable input"
toggleAriaLabel="Show content"
variant="expansion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ exports[`RegistrationCommandsPage fields - ConfigParams renders 1`] = `
className="without_select2"
id="registration_setup_remote_execution"
isDisabled={false}
isIconSprite={false}
isRequired={true}
onBlur={[Function]}
onChange={[Function]}
Expand Down Expand Up @@ -55,6 +56,7 @@ exports[`RegistrationCommandsPage fields - ConfigParams renders 1`] = `
className="without_select2"
id="registration_setup_insights"
isDisabled={false}
isIconSprite={false}
isRequired={true}
onBlur={[Function]}
onChange={[Function]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ exports[`RegistrationCommandsPage fields - HostGroup renders 1`] = `
className="without_select2"
id="reg_host_group"
isDisabled={false}
isIconSprite={false}
isRequired={false}
onBlur={[Function]}
onChange={[Function]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ exports[`RegistrationCommandsPage fields - OperatingSystem renders 1`] = `
className="without_select2"
id="reg_os"
isDisabled={true}
isIconSprite={false}
isRequired={false}
onBlur={[Function]}
onChange={[Function]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ exports[`RegistrationCommandsPage fields - Taxonomies renders 1`] = `
className="without_select2"
id="reg_organization"
isDisabled={false}
isIconSprite={false}
isRequired={true}
onBlur={[Function]}
onChange={[Function]}
Expand Down Expand Up @@ -44,6 +45,7 @@ exports[`RegistrationCommandsPage fields - Taxonomies renders 1`] = `
className="without_select2"
id="reg_location"
isDisabled={false}
isIconSprite={false}
isRequired={true}
onBlur={[Function]}
onChange={[Function]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ exports[`RegistrationCommandsPage fields - TokenLifeTime renders 1`] = `
<InputGroupText>
<Checkbox
className=""
component="div"
id="reg_unlimited_token_life_time"
isChecked={false}
isDisabled={false}
isRequired={false}
isValid={true}
label="unlimited"
onChange={[Function]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ exports[`render pageLayout w/beforeToolbarComponent 1`] = `
}
}
initialQuery=""
name={null}
onSearch={[MockFunction]}
onSearchChange={[Function]}
/>
Expand Down Expand Up @@ -162,6 +163,7 @@ exports[`render pageLayout w/search 1`] = `
}
}
initialQuery=""
name={null}
onSearch={[MockFunction]}
onSearchChange={[Function]}
/>
Expand Down Expand Up @@ -252,6 +254,7 @@ exports[`render pageLayout w/toolBar 1`] = `
}
}
initialQuery=""
name={null}
onSearch={[MockFunction]}
onSearchChange={[Function]}
/>
Expand Down Expand Up @@ -324,6 +327,7 @@ exports[`render pageLayout with custom breadcrumbs 1`] = `
}
}
initialQuery=""
name={null}
onSearch={[MockFunction]}
onSearchChange={[Function]}
/>
Expand Down Expand Up @@ -396,6 +400,7 @@ exports[`render pageLayout without breadcrumbs 1`] = `
}
}
initialQuery=""
name={null}
onSearch={[MockFunction]}
onSearchChange={[Function]}
/>
Expand Down

0 comments on commit fc0ad65

Please sign in to comment.