Skip to content

Commit

Permalink
change: [M3-8520] - Revert the "View Code Snippets"button copy to the…
Browse files Browse the repository at this point in the history
… original text (#10886)

* unit test coverage for HostNameTableCell

* Revert "unit test coverage for HostNameTableCell"

This reverts commit b274baf.

* Revert "View Code Snippets" button copy to the original text.

* update cypress tests

* Create pr-10886-upcoming-features-1725465397032.md
  • Loading branch information
cpathipa committed Sep 5, 2024
1 parent 2630aed commit 8e65c4b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

Revert the "View Code Snippets"button copy to the original text ([#10886](https://github.com/linode/manager/pull/10886))
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('Create Linode', () => {

// View Code Snippets and confirm it's provisioned as expected.
ui.button
.findByTitle('View Code Snippets')
.findByTitle('Create using command line')
.should('be.visible')
.should('be.enabled')
.click();
Expand Down
1 change: 1 addition & 0 deletions packages/manager/src/dev-tools/FeatureFlagTool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const options: { flag: keyof Flags; label: string }[] = [
{ flag: 'supportTicketSeverity', label: 'Support Ticket Severity' },
{ flag: 'dbaasV2', label: 'Databases V2 Beta' },
{ flag: 'databaseResize', label: 'Database Resize' },
{ flag: 'apicliDxToolsAdditions', label: 'APICLI DX Tools Additions' },
];

const renderFlagItems = (
Expand Down
13 changes: 2 additions & 11 deletions packages/manager/src/features/Linodes/LinodeCreatev2/Actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useFormContext } from 'react-hook-form';

import { Box } from 'src/components/Box';
import { Button } from 'src/components/Button/Button';
import { useFlags } from 'src/hooks/useFlags';
import { useRestrictedGlobalGrantCheck } from 'src/hooks/useRestrictedGlobalGrantCheck';
import { sendApiAwarenessClickEvent } from 'src/utilities/analytics/customEventAnalytics';
import { sendLinodeCreateFormInputEvent } from 'src/utilities/analytics/formEventAnalytics';
Expand All @@ -18,14 +17,10 @@ import {
import type { LinodeCreateFormValues } from './utilities';

export const Actions = () => {
const flags = useFlags();

const { params } = useLinodeCreateQueryParams();

const [isAPIAwarenessModalOpen, setIsAPIAwarenessModalOpen] = useState(false);

const isDxToolsAdditionsEnabled = flags?.apicliDxToolsAdditions;

const {
formState,
getValues,
Expand All @@ -44,9 +39,7 @@ export const Actions = () => {
sendLinodeCreateFormInputEvent({
createType: params.type ?? 'OS',
interaction: 'click',
label: isDxToolsAdditionsEnabled
? 'View Code Snippets'
: 'Create Using Command Line',
label: 'Create Using Command Line',
});
if (await trigger()) {
// If validation is successful, we open the dialog.
Expand All @@ -59,9 +52,7 @@ export const Actions = () => {
return (
<Box sx={{ display: 'flex', gap: 1, justifyContent: 'flex-end' }}>
<Button buttonType="outlined" onClick={onOpenAPIAwareness}>
{isDxToolsAdditionsEnabled
? 'View Code Snippets'
: 'Create using command line'}
Create using command line
</Button>
<Button
buttonType="primary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,7 @@ export class LinodeCreate extends React.PureComponent<
sendLinodeCreateFormErrorEvent(errorString, selectedTabName ?? 'OS');
};

handleClickCreateUsingCommandLine = (
isDxToolsAdditionsEnabled: boolean | undefined
) => {
handleClickCreateUsingCommandLine = () => {
const payload = {
authorized_users: this.props.authorized_users,
backup_id: this.props.selectedBackupID,
Expand All @@ -444,16 +442,9 @@ export class LinodeCreate extends React.PureComponent<
sendLinodeCreateFormInputEvent({
createType: 'OS',
interaction: 'click',
label: isDxToolsAdditionsEnabled
? 'View Code Snippets'
: 'Create Using Command Line',
label: 'Create Using Command Line',
});
sendApiAwarenessClickEvent(
'Button',
isDxToolsAdditionsEnabled
? 'View Code Snippets'
: 'Create Using Command Line'
);
sendApiAwarenessClickEvent('Button', 'Create Using Command Line');
this.props.checkValidation(payload);
};

Expand Down Expand Up @@ -641,7 +632,6 @@ export class LinodeCreate extends React.PureComponent<

const hasErrorFor = getErrorMap(errorMap, errors);
const generalError = getErrorMap(errorMap, errors).none;
const isDxToolsAdditionsEnabled = this.props.flags?.apicliDxToolsAdditions;

if (regionsLoading || imagesLoading || linodesLoading || typesLoading) {
return <CircleProgress />;
Expand Down Expand Up @@ -1204,17 +1194,11 @@ export class LinodeCreate extends React.PureComponent<
(showGDPRCheckbox && !signedAgreement) ||
secureVMViolation
}
onClick={() =>
this.handleClickCreateUsingCommandLine(
isDxToolsAdditionsEnabled
)
}
buttonType="outlined"
data-qa-api-cli-linode
onClick={() => this.handleClickCreateUsingCommandLine()}
>
{isDxToolsAdditionsEnabled
? 'View Code Snippets'
: 'Create using command line'}
Create using command line
</StyledCreateButton>
<StyledCreateButton
disabled={
Expand Down

0 comments on commit 8e65c4b

Please sign in to comment.