Просмотр исходного кода

fix(Issues): Switch from "timestamp" to "non-semver" (#53383)

Scott Cooper 1 год назад
Родитель
Сommit
955d5ddc69

+ 1 - 1
static/app/components/customResolutionModal.spec.tsx

@@ -111,7 +111,7 @@ describe('CustomResolutionModal', () => {
 
 
     selectEvent.openMenu(screen.getByText('e.g. 1.0.4'));
     selectEvent.openMenu(screen.getByText('e.g. 1.0.4'));
     expect(
     expect(
-      await screen.findByRole('menuitemradio', {name: 'abcdef (timestamp)'})
+      await screen.findByRole('menuitemradio', {name: 'abcdef (non-semver)'})
     ).toBeInTheDocument();
     ).toBeInTheDocument();
     expect(
     expect(
       screen.getByRole('menuitemradio', {name: '1.2.3 (semver)'})
       screen.getByRole('menuitemradio', {name: '1.2.3 (semver)'})

+ 1 - 1
static/app/components/customResolutionModal.tsx

@@ -40,7 +40,7 @@ function CustomResolutionModal(props: CustomResolutionModalProps) {
             {hasIssueReleaseSemver
             {hasIssueReleaseSemver
               ? isVersionInfoSemver(release.versionInfo.version)
               ? isVersionInfoSemver(release.versionInfo.version)
                 ? t('(semver)')
                 ? t('(semver)')
-                : t('(timestamp)')
+                : t('(non-semver)')
               : null}
               : null}
           </Fragment>
           </Fragment>
         ),
         ),

+ 2 - 2
static/app/views/issueDetails/groupActivityItem.tsx

@@ -251,7 +251,7 @@ function GroupActivityItem({activity, organization, projectId, author}: Props) {
               semver: organization.features.includes('issue-release-semver')
               semver: organization.features.includes('issue-release-semver')
                 ? isSemverRelease(currentVersion)
                 ? isSemverRelease(currentVersion)
                   ? t('(semver)')
                   ? t('(semver)')
-                  : t('(timestamp)')
+                  : t('(non-semver)')
                 : '',
                 : '',
             }
             }
           );
           );
@@ -267,7 +267,7 @@ function GroupActivityItem({activity, organization, projectId, author}: Props) {
               semver: organization.features.includes('issue-release-semver')
               semver: organization.features.includes('issue-release-semver')
                 ? isSemverRelease(version)
                 ? isSemverRelease(version)
                   ? t('(semver)')
                   ? t('(semver)')
-                  : t('(timestamp)')
+                  : t('(non-semver)')
                 : '',
                 : '',
             })
             })
           : tct('[author] marked this issue as resolved in the upcoming release', {
           : tct('[author] marked this issue as resolved in the upcoming release', {

+ 0 - 14
static/app/views/releases/list/index.spec.tsx

@@ -581,18 +581,4 @@ describe('ReleasesList', () => {
 
 
     expect(await screen.findByText('sentry@0.5.3')).toBeInTheDocument();
     expect(await screen.findByText('sentry@0.5.3')).toBeInTheDocument();
   });
   });
-
-  it('renders if the version is using semver or timestamp', async () => {
-    const org = {...organization, features: ['issue-release-semver']};
-    render(<ReleasesList {...props} organization={org} />, {
-      context: routerContext,
-      organization: org,
-    });
-    const items = await screen.findAllByTestId('release-panel');
-
-    expect(items.length).toEqual(3);
-
-    expect(within(items.at(0)!).getByText('1.0.0')).toBeInTheDocument();
-    expect(within(items.at(0)!).getByText('(semver)')).toBeInTheDocument();
-  });
 });
 });

+ 5 - 11
static/app/views/releases/list/releaseCard/index.tsx

@@ -17,7 +17,6 @@ import Version from 'sentry/components/version';
 import {t, tct, tn} from 'sentry/locale';
 import {t, tct, tn} from 'sentry/locale';
 import {space} from 'sentry/styles/space';
 import {space} from 'sentry/styles/space';
 import {Organization, PageFilters, Release} from 'sentry/types';
 import {Organization, PageFilters, Release} from 'sentry/types';
-import {isVersionInfoSemver} from 'sentry/views/releases/utils';
 
 
 import {ReleasesDisplayOption} from '../releasesDisplayOptions';
 import {ReleasesDisplayOption} from '../releasesDisplayOptions';
 import {ReleasesRequestRenderProps} from '../releasesRequest';
 import {ReleasesRequestRenderProps} from '../releasesRequest';
@@ -130,18 +129,13 @@ class ReleaseCard extends Component<Props> {
             )}
             )}
           </ReleaseInfoHeader>
           </ReleaseInfoHeader>
           <ReleaseInfoSubheader>
           <ReleaseInfoSubheader>
-            <PackageSemver>
-              {versionInfo?.package && (
+            {versionInfo?.package && (
+              <PackageName>
                 <TextOverflow ellipsisDirection="left">
                 <TextOverflow ellipsisDirection="left">
                   {versionInfo.package}
                   {versionInfo.package}
                 </TextOverflow>
                 </TextOverflow>
-              )}
-              {organization.features.includes('issue-release-semver')
-                ? isVersionInfoSemver(versionInfo.version)
-                  ? t('(semver)')
-                  : t('(timestamp)')
-                : null}
-            </PackageSemver>
+              </PackageName>
+            )}
             <TimeSince date={lastDeploy?.dateFinished || dateCreated} />
             <TimeSince date={lastDeploy?.dateFinished || dateCreated} />
             {lastDeploy?.dateFinished && ` \u007C ${lastDeploy.environment}`}
             {lastDeploy?.dateFinished && ` \u007C ${lastDeploy.environment}`}
           </ReleaseInfoSubheader>
           </ReleaseInfoSubheader>
@@ -254,7 +248,7 @@ const ReleaseInfoSubheader = styled('div')`
   color: ${p => p.theme.gray400};
   color: ${p => p.theme.gray400};
 `;
 `;
 
 
-const PackageSemver = styled('div')`
+const PackageName = styled('div')`
   font-size: ${p => p.theme.fontSizeMedium};
   font-size: ${p => p.theme.fontSizeMedium};
   color: ${p => p.theme.textColor};
   color: ${p => p.theme.textColor};
   display: flex;
   display: flex;