<commit_before>import * as fp from 'lodash/fp';
import * as React from 'react';

import {currentWorkspaceStore} from 'app/utils/navigation';
import {WorkspaceData} from 'app/utils/workspace-data';

import {profileApi, workspacesApi} from 'app/services/swagger-fetch-clients';

import {Button} from 'app/components/buttons';
import {FlexColumn} from 'app/components/flex';
import {InfoIcon} from 'app/components/icons';
import {TooltipTrigger} from 'app/components/popups';
import {Spinner} from 'app/components/spinners';
import {ResearchPurpose} from 'app/pages/workspace/research-purpose';
import {WorkspaceShare} from 'app/pages/workspace/workspace-share';
import colors, {colorWithWhiteness} from 'app/styles/colors';
import {reactStyles, withCdrVersions, withUrlParams, withUserProfile} from 'app/utils';
import {AuthorityGuardedAction, hasAuthorityForAction} from 'app/utils/authorities';
import {getCdrVersion} from 'app/utils/cdr-versions';
import {WorkspacePermissionsUtil} from 'app/utils/workspace-permissions';
import {
  BillingAccountType,
  CdrVersionTiersResponse,
  Profile,
  UserRole,
  WorkspaceAccessLevel
} from 'generated/fetch';

interface WorkspaceProps {
  profileState: {profile: Profile, reload: Function, updateCache: Function};
  cdrVersionTiersResponse: CdrVersionTiersResponse;
}

interface WorkspaceState {
  sharing: boolean;
  workspace: WorkspaceData;
  workspaceFreeTierUsage: number;
  workspaceUserRoles: UserRole[];
  publishing: boolean;
}

const styles = reactStyles({
  mainPage: {
    display: 'flex', justifyContent: 'space-between', alignItems: 'stretch',
    height: 'calc(100% - 60px)'
  },
  rightSidebar: {
    backgroundColor: colorWithWhiteness(colors.primary, 0.85), marginRight: '-0.6rem',
    paddingLeft: '0.5rem', paddingTop: '1rem', width: '22%', display: 'flex',
    flexDirection: 'column'
  },
  shareHeader: {
    display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: '0.5rem',
    paddingBottom: '0.5rem'
  },
  infoBox: {
    backgroundColor: colorWithWhiteness(colors.primary, 0.75), height: '2rem', width: '6rem',
    borderRadius: '5px', padding: '0.4rem', marginRight: '0.5rem', marginBottom: '0.5rem',
    color: colors.primary, lineHeight: '14px'
  },
  infoBoxHeader: {
    textTransform: 'uppercase', fontSize: '0.4rem'
  }<commit_msg>Fix cdr cersion box (#4962)<commit_after>import * as fp from 'lodash/fp';
import * as React from 'react';

import {currentWorkspaceStore} from 'app/utils/navigation';
import {WorkspaceData} from 'app/utils/workspace-data';

import {profileApi, workspacesApi} from 'app/services/swagger-fetch-clients';

import {Button} from 'app/components/buttons';
import {FlexColumn} from 'app/components/flex';
import {InfoIcon} from 'app/components/icons';
import {TooltipTrigger} from 'app/components/popups';
import {Spinner} from 'app/components/spinners';
import {ResearchPurpose} from 'app/pages/workspace/research-purpose';
import {WorkspaceShare} from 'app/pages/workspace/workspace-share';
import colors, {colorWithWhiteness} from 'app/styles/colors';
import {reactStyles, withCdrVersions, withUrlParams, withUserProfile} from 'app/utils';
import {AuthorityGuardedAction, hasAuthorityForAction} from 'app/utils/authorities';
import {getCdrVersion} from 'app/utils/cdr-versions';
import {WorkspacePermissionsUtil} from 'app/utils/workspace-permissions';
import {
  BillingAccountType,
  CdrVersionTiersResponse,
  Profile,
  UserRole,
  WorkspaceAccessLevel
} from 'generated/fetch';

interface WorkspaceProps {
  profileState: {profile: Profile, reload: Function, updateCache: Function};
  cdrVersionTiersResponse: CdrVersionTiersResponse;
}

interface WorkspaceState {
  sharing: boolean;
  workspace: WorkspaceData;
  workspaceFreeTierUsage: number;
  workspaceUserRoles: UserRole[];
  publishing: boolean;
}

const styles = reactStyles({
  mainPage: {
    display: 'flex', justifyContent: 'space-between', alignItems: 'stretch',
    height: 'calc(100% - 60px)'
  },
  rightSidebar: {
    backgroundColor: colorWithWhiteness(colors.primary, 0.85), marginRight: '-0.6rem',
    paddingLeft: '0.5rem', paddingTop: '1rem', width: '22%', display: 'flex',
    flexDirection: 'column'
  },
  shareHeader: {
    display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: '0.5rem',
    paddingBottom: '0.5rem'
  },
  infoBox: {
    backgroundColor: colorWithWhiteness(colors.primary, 0.75),
    width: '6rem',
    borderRadius: '5px', padding: '0.4rem', marginRight: '0.5rem', marginBottom: '0.5rem',
    color: colors.primary, lineHeight: '14px'
  },
  infoBoxHeader: {
    textTransform: 'uppercase', fontSize: '0.4rem'
  }
{'fraction_non_alphanumeric': 0.13397435897435897, 'fraction_numerical': 0.015598290598290598, 'mean_word_length': 5.774240231548481, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4433036', 'n_tokens_mistral': 1513, 'n_tokens_neox': 1493, 'n_words': 346}