Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change: [M3-8520] - Revert the "View Code Snippets"button copy to the original text #10886

Merged
merged 23 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b274baf
unit test coverage for HostNameTableCell
cpathipa Jun 19, 2024
f958dab
Revert "unit test coverage for HostNameTableCell"
cpathipa Jun 19, 2024
5d0a476
Merge branch 'linode:develop' into develop
cpathipa Jun 25, 2024
93aab07
Merge branch 'linode:develop' into develop
cpathipa Jun 25, 2024
d7deb4f
Merge branch 'linode:develop' into develop
cpathipa Jul 1, 2024
a550f05
Merge branch 'linode:develop' into develop
cpathipa Jul 3, 2024
de0f63e
Merge branch 'linode:develop' into develop
cpathipa Jul 5, 2024
426c42c
Merge branch 'linode:develop' into develop
cpathipa Jul 17, 2024
3fb49a6
Merge branch 'linode:develop' into develop
cpathipa Jul 22, 2024
6c76508
Merge branch 'linode:develop' into develop
cpathipa Jul 24, 2024
1653a6b
Merge branch 'linode:develop' into develop
cpathipa Jul 25, 2024
00421cf
Merge branch 'linode:develop' into develop
cpathipa Jul 29, 2024
959730a
Merge branch 'linode:develop' into develop
cpathipa Jul 31, 2024
d9bd490
Merge branch 'linode:develop' into develop
cpathipa Jul 31, 2024
960415e
Merge branch 'linode:develop' into develop
cpathipa Aug 1, 2024
b9f4745
Merge branch 'linode:develop' into develop
cpathipa Aug 2, 2024
b0b9264
Merge branch 'linode:develop' into develop
cpathipa Aug 21, 2024
6c70559
Merge branch 'linode:develop' into develop
cpathipa Aug 28, 2024
96eb34d
Merge branch 'linode:develop' into develop
cpathipa Sep 3, 2024
74b1635
Merge branch 'linode:develop' into develop
cpathipa Sep 4, 2024
f833758
Revert "View Code Snippets" button copy to the original text.
cpathipa Sep 4, 2024
a24c212
update cypress tests
cpathipa Sep 4, 2024
bdc5ca5
Create pr-10886-upcoming-features-1725465397032.md
cpathipa Sep 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Loading