Skip to content

Commit a31bfb8

Browse files
committed
Standardize wizard page selector names to be prefix with 'anaconda-screen'
Do this because now we are exposing the selector IDs for use by anaconda.conf, for hidden_webui_pages option. Since this is part of an API now, we need to be consistent with the naming of the page IDs.
1 parent 23e934e commit a31bfb8

22 files changed

+87
-87
lines changed

src/components/installation/InstallationProgress.jsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,27 +46,27 @@ import "./InstallationProgress.scss";
4646

4747
const _ = cockpit.gettext;
4848
const N_ = cockpit.noop;
49-
const idPrefix = "installation-progress";
49+
const SCREEN_ID = "";
5050

5151
const progressSteps = [
5252
{
5353
description: _("Storage configuration: Storage is currently being configured."),
54-
id: "installation-progress-step-storage",
54+
id: {SCREEN_ID + "-step-storage"},
5555
title: _("Storage configuration"),
5656
},
5757
{
5858
description: _("Software installation: Storage configuration complete. The software is now being installed onto your device."),
59-
id: "installation-progress-step-payload",
59+
id: {SCREEN_ID + "-step-payload"},
6060
title: _("Software installation"),
6161
},
6262
{
6363
description: _("System configuration: Software installation complete. The system is now being configured."),
64-
id: "installation-progress-step-configuration",
64+
id: {SCREEN_ID + "-step-configuration"},
6565
title: _("System configuration"),
6666
},
6767
{
6868
description: _("Finalizing: The system configuration is complete. Finalizing installation may take a few moments."),
69-
id: "installation-progress-step-boot-loader",
69+
id: {SCREEN_ID + "-step-boot-loader"},
7070
title: _("Finalization"),
7171
},
7272
];
@@ -160,7 +160,7 @@ const InstallationProgress = ({ onCritFail }) => {
160160
}
161161

162162
return (
163-
<Flex direction={{ default: "column" }} className={idPrefix + "-status " + idPrefix + "-status-" + status}>
163+
<Flex direction={{ default: "column" }} className={SCREEN_ID + "-status " + idPrefix + "-status-" + status}>
164164
<EmptyStatePanel
165165
icon={icon}
166166
loading={!icon}
@@ -200,7 +200,7 @@ const InstallationProgress = ({ onCritFail }) => {
200200
return (
201201
<ProgressStep
202202
aria-label={ariaLabel}
203-
id={idPrefix + "-step-" + index}
203+
id={SCREEN_ID + "-step-" + index}
204204
isCurrent={index === currentProgressStep}
205205
icon={phaseIcon}
206206
titleId={progressStep.id}
@@ -240,7 +240,7 @@ const InstallationProgress = ({ onCritFail }) => {
240240
export class Page {
241241
constructor () {
242242
this.component = InstallationProgress;
243-
this.id = "installation-progress";
243+
this.id = SCREEN_ID;
244244
this.isFinal = true;
245245
}
246246
}

src/components/installation/InstallationProgress.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
width: 100%;
33
}
44

5-
.installation-progress-status {
5+
.anaconda-screen-progress-status {
66
&-success .pf-v5-c-empty-state__icon {
77
color: var(--pf-v5-global--success-color--100);
88
}

src/components/localization/InstallationLanguage.jsx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import { LanguageContext } from "../../contexts/Common.jsx";
5050
import "./InstallationLanguage.scss";
5151

5252
const _ = cockpit.gettext;
53+
const SCREEN_ID = "anaconda-screen-language";
5354

5455
const getLanguageEnglishName = lang => lang["english-name"].v;
5556
const getLanguageNativeName = lang => lang["native-name"].v;
@@ -82,7 +83,6 @@ class LanguageSelector extends React.Component {
8283

8384
renderOptions (filter) {
8485
const { commonLocales, languages } = this.props;
85-
const idPrefix = this.props.idPrefix;
8686

8787
const filtered = [];
8888
const filterLow = filter.toLowerCase();
@@ -114,7 +114,7 @@ class LanguageSelector extends React.Component {
114114

115115
return (
116116
<MenuItem
117-
id={`${idPrefix}-${prefix}-${getLocaleId(locale).split(".UTF-8")[0]}`}
117+
id={`${SCREEN_ID}-${prefix}-${getLocaleId(locale).split(".UTF-8")[0]}`}
118118
isSelected={isSelected}
119119
key={`${prefix}-${getLocaleId(locale)}`}
120120
itemId={getLocaleId(locale)}
@@ -159,7 +159,7 @@ class LanguageSelector extends React.Component {
159159
<React.Fragment key="group-common-languages">
160160
<MenuGroup
161161
label={_("Suggested languages")}
162-
id={idPrefix + "-common-languages"}
162+
id={SCREEN_ID + "-common-languages"}
163163
labelHeadingLevel="h3"
164164
>
165165
{suggestedItems}
@@ -184,7 +184,7 @@ class LanguageSelector extends React.Component {
184184
filtered.push(
185185
<MenuGroup
186186
label={_("Additional languages")}
187-
id={`${idPrefix}-additional-languages`}
187+
id={`${SCREEN_ID}-additional-languages`}
188188
labelHeadingLevel="h3"
189189
key="group-additional-languages"
190190
>
@@ -197,7 +197,7 @@ class LanguageSelector extends React.Component {
197197
if (filter && filtered.length === 0) {
198198
return [
199199
<MenuItem
200-
id={`${idPrefix}-search-no-result`}
200+
id={`${SCREEN_ID}-search-no-result`}
201201
isDisabled
202202
key="no-result"
203203
>
@@ -256,7 +256,7 @@ class LanguageSelector extends React.Component {
256256

257257
return (
258258
<>
259-
<TextInputGroup className="installation-language-search">
259+
<TextInputGroup className="anaconda-screen-language-search">
260260
<TextInputGroupMain
261261
icon={<SearchIcon />}
262262
value={this.state.search}
@@ -276,8 +276,8 @@ class LanguageSelector extends React.Component {
276276
)}
277277
</TextInputGroup>
278278
<Menu
279-
className="installation-language-menu"
280-
id={this.props.idPrefix + "-language-menu"}
279+
className="anaconda-screen-language-menu"
280+
id={SCREEN_ID + "-language-menu"}
281281
isScrollable
282282
isPlain
283283
onSelect={handleOnSelect}
@@ -294,7 +294,7 @@ class LanguageSelector extends React.Component {
294294
}
295295
}
296296

297-
const InstallationLanguage = ({ idPrefix, setIsFormValid, setStepNotification }) => {
297+
const InstallationLanguage = ({ setIsFormValid, setStepNotification }) => {
298298
const { commonLocales, language, languages } = useContext(LanguageContext);
299299

300300
useEffect(() => {
@@ -312,7 +312,6 @@ const InstallationLanguage = ({ idPrefix, setIsFormValid, setStepNotification })
312312
<FormGroup>
313313
<LanguageSelector
314314
id="language-selector"
315-
idPrefix={idPrefix}
316315
languages={languages}
317316
commonLocales={commonLocales}
318317
language={language}
@@ -329,7 +328,7 @@ const InstallationLanguage = ({ idPrefix, setIsFormValid, setStepNotification })
329328
export class Page {
330329
constructor () {
331330
this.component = InstallationLanguage;
332-
this.id = "installation-language";
331+
this.id = SCREEN_ID;
333332
this.label = _("Welcome");
334333
}
335334
}

src/components/localization/InstallationLanguage.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
.installation-language-menu.pf-v5-c-menu.pf-m-scrollable {
1+
.anaconda-screen-language-menu.pf-v5-c-menu.pf-m-scrollable {
22
max-width: 400px;
33
// heading: 84, footer: 44, content (about from header): 158, necessary padding underneath: 8px,
44
// 50px magic number
55
--pf-v5-c-menu__content--MaxHeight: calc(100vh - 84px - 44px - 158px - 8px - 50px);
66
}
77

8-
.installation-language-search {
8+
.anaconda-screen-language-search {
99
margin-bottom: var(--pf-v5-global--spacer--sm);
1010
max-width: 400px;
1111
}
1212

13-
.installation-language-menu {
13+
.anaconda-screen-language-menu {
1414
border: var(--pf-v5-global--BorderWidth--sm) solid var(--pf-v5-global--BorderColor--100);
1515
}
1616

@@ -21,7 +21,7 @@ to prevent surprises elsewhere. However, if we use the widget elsewhere,
2121
it would also need this fix, so this is definitely a fix for PF
2222
overrides, not a local fix.
2323
*/
24-
#installation-language-language-menu {
24+
#anaconda-screen-language-language-menu {
2525
// Oddly, the spacing here isn't consistent with the reference on the website;
2626
// it should be balanced on the top and bottom, not all just on the top
2727
.pf-v5-c-menu__group-title {

src/components/review/Hostname.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import { setHostname } from "../../apis/network.js";
3838
import { NetworkContext } from "../../contexts/Common.jsx";
3939

4040
const _ = cockpit.gettext;
41-
const idPrefix = "installation-review";
41+
const SCREEN_ID = "anaconda-screen-review";
4242

4343
const ChangeHostname = ({ initHostname }) => {
4444
const [currentHostname, setCurrentHostname] = useState(initHostname);
@@ -162,7 +162,7 @@ export const HostnameRow = () => {
162162
<DescriptionListTerm>
163163
{_("Hostname")}
164164
</DescriptionListTerm>
165-
<DescriptionListDescription id={idPrefix + "-target-system-hostname"}>
165+
<DescriptionListDescription id={SCREEN_ID + "-target-system-hostname"}>
166166
<Flex
167167
spaceItems={{ default: "spaceItemsMd" }}
168168
alignItems={{ default: "alignItemsCenter" }}>

src/components/review/ReviewConfiguration.jsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import { StorageReview, StorageReviewNote } from "./StorageReview.jsx";
4040
import "./ReviewConfiguration.scss";
4141

4242
const _ = cockpit.gettext;
43-
const idPrefix = "installation-review";
43+
const SCREEN_ID = "anaconda-screen-review";
4444

4545
const ReviewDescriptionList = ({ children }) => {
4646
return (
@@ -89,7 +89,7 @@ const ReviewConfiguration = ({ setIsFormValid }) => {
8989
<ReviewDescriptionList>
9090
<ReviewDescriptionList>
9191
<ReviewDescriptionListItem
92-
id={`${idPrefix}-target-operating-system`}
92+
id={`${SCREEN_ID}-target-operating-system`}
9393
term={_("Operating system")}
9494
description={osRelease.PRETTY_NAME}
9595
/>
@@ -100,15 +100,15 @@ const ReviewConfiguration = ({ setIsFormValid }) => {
100100
<ReviewDescriptionList>
101101
<ReviewDescriptionList>
102102
<ReviewDescriptionListItem
103-
id={`${idPrefix}-target-system-language`}
103+
id={`${SCREEN_ID}-target-system-language`}
104104
term={_("Language")}
105105
description={language ? language["native-name"].v : localizationData.language}
106106
/>
107107
</ReviewDescriptionList>
108-
{!hiddenScreens.includes("accounts") &&
108+
{!hiddenScreens.includes("anaconda-screen-accounts") &&
109109
<ReviewDescriptionList>
110110
<ReviewDescriptionListItem
111-
id={`${idPrefix}-target-system-account`}
111+
id={`${SCREEN_ID}-target-system-account`}
112112
term={_("Account")}
113113
description={accounts.fullName ? `${accounts.fullName} (${accounts.userName})` : accounts.userName}
114114
/>
@@ -123,14 +123,14 @@ const ReviewConfiguration = ({ setIsFormValid }) => {
123123
<ReviewDescriptionList>
124124
<ReviewDescriptionList>
125125
<ReviewDescriptionListItem
126-
id={`${idPrefix}-target-system-mode`}
126+
id={`${SCREEN_ID}-target-system-mode`}
127127
term={_("Installation type")}
128128
description={scenarioLabel}
129129
/>
130130
</ReviewDescriptionList>
131131
<ReviewDescriptionList>
132132
<ReviewDescriptionListItem
133-
id={`${idPrefix}-target-storage`}
133+
id={`${SCREEN_ID}-target-storage`}
134134
term={_("Storage")}
135135
description={
136136
<Stack hasGutter>
@@ -198,7 +198,7 @@ const CustomFooter = ({ setIsFormValid }) => {
198198
const confirmationCheckbox = (
199199
!installationIsClean &&
200200
<Checkbox
201-
id={idPrefix + "-next-confirmation-checkbox"}
201+
id={SCREEN_ID + "-next-confirmation-checkbox"}
202202
label={scenarioConfirmationLabel}
203203
isChecked={isConfirmed}
204204
onChange={(_event, checked) => setIsConfirmed(checked)}
@@ -214,15 +214,15 @@ const CustomFooter = ({ setIsFormValid }) => {
214214
footerHelperText={confirmationCheckbox}
215215
nextButtonText={buttonLabel}
216216
nextButtonVariant={!installationIsClean ? "warning" : "primary"}
217-
onNext={() => cockpit.location.go(["installation-progress"])}
217+
onNext={() => cockpit.location.go(["anaconda-screen-progress"])}
218218
/>
219219
);
220220
};
221221

222222
export class Page {
223223
constructor () {
224224
this.component = ReviewConfiguration;
225-
this.id = idPrefix;
225+
this.id = SCREEN_ID;
226226
this.label = _("Review and install");
227227
this.title = _("Review and install");
228228
}

src/components/review/StorageReview.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ export const StorageReviewNote = () => {
346346

347347
return (
348348
<ReviewDescriptionListItem
349-
id="installation-review-target-storage-note"
349+
id="anaconda-screen-review-target-storage-note"
350350
term={_("Note")}
351351
description={description}
352352
/>

src/components/steps.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const getSteps = (userInterfaceConfig, ...args) => {
2020
new PageInstallationMethod(...args),
2121
new PageStorageConfiguration(...args),
2222
{
23-
id: "storage-configuration-manual",
23+
id: "anaconda-screen-storage-configuration-manual",
2424
isHidden: mountPointMappingStep.isHidden,
2525
label: _("Storage configuration"),
2626
steps: [mountPointMappingStep],

src/components/storage/CockpitStorageIntegration.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ export const ModifyStorage = ({ currentStepId, setShowStorage }) => {
653653
mount_point_prefix: targetSystemRoot,
654654
});
655655
// Allow to modify storage only when we are in the scenario selection page
656-
const isDisabled = currentStepId !== "installation-method";
656+
const isDisabled = currentStepId !== "anaconda-screen-method";
657657
const item = (
658658
<DropdownItem
659659
id="modify-storage"

src/components/storage/DiskEncryption.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const ruleAscii = {
5454
};
5555

5656
const CheckDisksSpinner = (
57-
<EmptyState id="installation-destination-next-spinner">
57+
<EmptyState id={idPrefix + "-next-spinner"}>
5858
<EmptyStateHeader titleText={<>{_("Checking storage configuration")}</>} icon={<EmptyStateIcon icon={Spinner} />} headingLevel="h4" />
5959
<EmptyStateFooter>
6060
<TextContent>

0 commit comments

Comments
 (0)