]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-21541 Fix borders in QP changelog list
authorAmbroise C <ambroise.christea@sonarsource.com>
Wed, 31 Jan 2024 17:17:34 +0000 (18:17 +0100)
committersonartech <sonartech@sonarsource.com>
Thu, 1 Feb 2024 20:02:46 +0000 (20:02 +0000)
server/sonar-web/design-system/src/components/Table.tsx
server/sonar-web/src/main/js/apps/quality-profiles/changelog/Changelog.tsx

index da6b5d5eb36ac6ceedc5066b65bdc1eaa4f379b5..44c09e399fe7f73792f976c80702113806cad546 100644 (file)
@@ -187,9 +187,14 @@ export function CellComponent(props: CellComponentProps) {
   return <CellComponentStyled as={containerType} {...props} />;
 }
 
-export function ContentCell({ children, className, ...props }: CellComponentProps) {
+export function ContentCell({
+  children,
+  cellClassName,
+  className,
+  ...props
+}: CellComponentProps & { cellClassName?: string }) {
   return (
-    <CellComponent {...props}>
+    <CellComponent className={cellClassName} {...props}>
       <div
         className={classNames('sw-text-left sw-justify-start sw-flex sw-items-center', className)}
       >
index 6b2444379df92536c5e468c533961130ff99dc0d..437f10bbcbe04b0c7d29413703dac54357ac2506 100644 (file)
@@ -85,7 +85,8 @@ export default function Changelog(props: Props) {
     return (
       <TableRowInteractive key={index}>
         <ContentCell
-          className={classNames('sw-align-top', { 'sw-border-transparent': !shouldDisplayDate })}
+          cellClassName={classNames({ 'sw-border-transparent': !shouldDisplayDate })}
+          className={classNames('sw-align-top')}
         >
           {shouldDisplayDate && (
             <div>
@@ -110,17 +111,15 @@ export default function Changelog(props: Props) {
         </ContentCell>
 
         <ContentCell
-          className={classNames('sw-whitespace-nowrap sw-align-top sw-max-w-[120px]', {
-            'sw-border-transparent': !shouldDisplayDate,
-          })}
+          cellClassName={classNames({ 'sw-border-transparent': !shouldDisplayDate })}
+          className={classNames('sw-whitespace-nowrap sw-align-top sw-max-w-[120px]')}
         >
           {shouldDisplayAuthor && (event.authorName ? event.authorName : <Note>System</Note>)}
         </ContentCell>
 
         <ContentCell
-          className={classNames('sw-whitespace-nowrap sw-align-top', {
-            'sw-border-transparent': !shouldDisplayDate,
-          })}
+          cellClassName={classNames({ 'sw-border-transparent': !shouldDisplayDate })}
+          className={classNames('sw-whitespace-nowrap sw-align-top')}
         >
           {shouldDisplayAction &&
             intl.formatMessage({ id: `quality_profiles.changelog.${event.action}` })}
@@ -143,9 +142,8 @@ export default function Changelog(props: Props) {
         </CellComponent>
 
         <ContentCell
-          className={classNames('sw-align-top sw-max-w-[400px]', {
-            'sw-border-transparent': !shouldDisplayDate,
-          })}
+          cellClassName={classNames({ 'sw-border-transparent': !shouldDisplayDate })}
+          className={classNames('sw-align-top sw-max-w-[400px]')}
         >
           {event.params && <ChangesList changes={event.params} />}
         </ContentCell>