Skip to content

Commit 1fdac44

Browse files
Merge branch 'beta' into react-query-start
2 parents ad43c89 + 70f97e6 commit 1fdac44

File tree

102 files changed

+2038
-1287
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+2038
-1287
lines changed

jsapp/js/account/changePasswordRoute.component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const ChangePasswordRoute = class ChangePassword extends React.Component<WithRou
3636
<bem.AccountSettings__actions>
3737
<Button
3838
type='bare'
39-
color='storm'
39+
color='dark-blue'
4040
size='l'
4141
startIcon='close'
4242
onClick={this.close.bind(this)}

jsapp/js/account/plans/plan.component.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,16 +428,16 @@ export default function Plan(props: PlanProps) {
428428
hasMetaFeatures() && (
429429
<div className={styles.comparisonButton}>
430430
<Button
431-
type='full'
432-
color='light-storm'
431+
type='bare'
432+
color='dark-blue'
433433
size='m'
434-
isFullWidth
435434
label={
436435
expandComparison
437436
? t('Collapse full comparison')
438437
: t('Display full comparison')
439438
}
440439
onClick={() => setExpandComparison(!expandComparison)}
440+
endIcon={expandComparison ? 'angle-up' : 'angle-down'}
441441
/>
442442
</div>
443443
);

jsapp/js/account/plans/plan.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ a.enterpriseLink {
237237
margin-left: auto;
238238
margin-right: auto;
239239
width: $plans-page-card-width;
240+
text-align: center;
240241
}
241242

242243
.planButton {

jsapp/js/account/security/mfa/mfaSection.component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ export default class SecurityRoute extends React.Component<{}, SecurityState> {
220220
<bem.MFAOptions__buttons>
221221
<Button
222222
type='frame'
223-
color='storm'
223+
color='dark-blue'
224224
label={t('Reconfigure')}
225225
size='m'
226226
onClick={(evt: React.ChangeEvent<HTMLInputElement>) => {
@@ -238,7 +238,7 @@ export default class SecurityRoute extends React.Component<{}, SecurityState> {
238238
<bem.MFAOptions__buttons>
239239
<Button
240240
type='frame'
241-
color='storm'
241+
color='dark-blue'
242242
label={t('Generate new')}
243243
size='m'
244244
onClick={(evt: React.ChangeEvent<HTMLInputElement>) => {

jsapp/js/account/stripe.types.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,13 @@ export enum PlanNames {
157157
'ENTERPRISE' = 'Enterprise',
158158
}
159159

160+
export enum UsageLimitTypes {
161+
'STORAGE' = 'storage',
162+
'SUBMISSION' = 'submission',
163+
'TRANSCRIPTION' = 'automated transcription',
164+
'TRANSLATION' = 'machine translation',
165+
}
166+
160167
export enum Limits {
161168
'unlimited' = 'unlimited',
162169
}

jsapp/js/account/usage/usage.component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import UsageContainer, {
1010
USAGE_CONTAINER_TYPE,
1111
} from 'js/account/usage/usageContainer';
1212
import envStore from 'js/envStore';
13-
import {formatDate} from 'js/utils';
13+
import {convertSecondsToMinutes, formatDate} from 'js/utils';
1414
import styles from './usage.module.scss';
1515
import useWhenStripeIsEnabled from 'js/hooks/useWhenStripeIsEnabled.hook';
1616
import {ProductsContext} from '../useProducts.hook';
@@ -104,7 +104,7 @@ export default function Usage() {
104104
nlpCharacterLimit: limits.nlp_character_limit,
105105
nlpMinuteLimit:
106106
typeof limits.nlp_seconds_limit === 'number'
107-
? limits.nlp_seconds_limit / 60
107+
? convertSecondsToMinutes(limits.nlp_seconds_limit)
108108
: limits.nlp_seconds_limit,
109109
submissionLimit: limits.submission_limit,
110110
isLoaded: true,

jsapp/js/account/usage/usageProjectBreakdown.tsx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import {USAGE_ASSETS_PER_PAGE} from 'jsapp/js/constants';
1111
import SortableProjectColumnHeader from 'jsapp/js/projects/projectsTable/sortableProjectColumnHeader';
1212
import type {ProjectFieldDefinition} from 'jsapp/js/projects/projectViews/constants';
1313
import type {ProjectsTableOrder} from 'jsapp/js/projects/projectsTable/projectsTable';
14-
import {truncateNumber} from 'jsapp/js/utils';
15-
import {UsageContext, useUsage} from './useUsage.hook';
14+
import {convertSecondsToMinutes} from 'jsapp/js/utils';
15+
import {UsageContext} from './useUsage.hook';
1616
import Button from 'js/components/common/button';
1717
import Icon from 'js/components/common/icon';
1818
import {OrganizationContext} from 'js/account/organizations/useOrganization.hook';
@@ -132,10 +132,8 @@ const ProjectBreakdown = () => {
132132
`submission_count_current_${usage.trackingPeriod}`
133133
].toLocaleString();
134134

135-
const periodASRSeconds = truncateNumber(
136-
project[`nlp_usage_current_${usage.trackingPeriod}`]
137-
.total_nlp_asr_seconds / 60,
138-
1
135+
const periodASRSeconds = convertSecondsToMinutes(
136+
project[`nlp_usage_current_${usage.trackingPeriod}`].total_nlp_asr_seconds
139137
).toLocaleString();
140138

141139
const periodMTCharacters =
@@ -154,9 +152,7 @@ const ProjectBreakdown = () => {
154152
</Link>
155153
</td>
156154
<td>{project.submission_count_all_time.toLocaleString()}</td>
157-
<td className={styles.currentMonth}>
158-
{periodSubmissions}
159-
</td>
155+
<td className={styles.currentMonth}>{periodSubmissions}</td>
160156
<td>{prettyBytes(project.storage_bytes)}</td>
161157
<td>{periodASRSeconds}</td>
162158
<td>{periodMTCharacters}</td>
@@ -180,7 +176,7 @@ const ProjectBreakdown = () => {
180176
</div>
181177
</div>
182178
<Button
183-
color='storm'
179+
color='dark-blue'
184180
size='s'
185181
type='bare'
186182
startIcon='close'

jsapp/js/account/usage/useUsage.hook.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {createContext, useCallback} from 'react';
22
import type {Organization, RecurringInterval} from 'js/account/stripe.types';
33
import {getSubscriptionInterval} from 'js/account/stripe.api';
4-
import {formatRelativeTime, truncateNumber} from 'js/utils';
4+
import {convertSecondsToMinutes, formatRelativeTime} from 'js/utils';
55
import {getUsage} from 'js/account/usage/usage.api';
66
import {useApiFetcher, withApiFetcher} from 'js/hooks/useApiFetcher.hook';
77

@@ -50,11 +50,9 @@ const loadUsage = async (
5050
return {
5151
storage: usage.total_storage_bytes,
5252
submissions: usage.total_submission_count[`current_${trackingPeriod}`],
53-
transcriptionMinutes: Math.floor(
54-
truncateNumber(
55-
usage.total_nlp_usage[`asr_seconds_current_${trackingPeriod}`] / 60
56-
)
57-
), // seconds to minutes
53+
transcriptionMinutes: convertSecondsToMinutes(
54+
usage.total_nlp_usage[`asr_seconds_current_${trackingPeriod}`]
55+
),
5856
translationChars:
5957
usage.total_nlp_usage[`mt_characters_current_${trackingPeriod}`],
6058
currentMonthStart: usage.current_month_start,

jsapp/js/components/RESTServices/RESTServiceLogs.es6

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export default class RESTServiceLogs extends React.Component {
205205
<header className='rest-services-list__header'>
206206
<Button
207207
type='frame'
208-
color='storm'
208+
color='dark-blue'
209209
size='m'
210210
onClick={() => {
211211
window.location.assign(`/#/forms/${this.state.assetUid}/settings/rest`);
@@ -268,7 +268,7 @@ export default class RESTServiceLogs extends React.Component {
268268
{ this.hasAnyFailedLogs() &&
269269
<Button
270270
type='bare'
271-
color='storm'
271+
color='dark-blue'
272272
size='m'
273273
onClick={this.retryAll.bind(this)}
274274
tooltip={t('Retry all submissions')}
@@ -319,7 +319,7 @@ export default class RESTServiceLogs extends React.Component {
319319
{log.status === HOOK_LOG_STATUSES.FAILED &&
320320
<Button
321321
type='bare'
322-
color='storm'
322+
color='dark-blue'
323323
size='m'
324324
isDisabled={!this.state.isHookActive}
325325
onClick={this.retryLog.bind(this, log)}
@@ -331,7 +331,7 @@ export default class RESTServiceLogs extends React.Component {
331331
{this.hasInfoToDisplay(log) &&
332332
<Button
333333
type='bare'
334-
color='storm'
334+
color='dark-blue'
335335
size='m'
336336
onClick={this.showLogInfo.bind(this, log)}
337337
tooltip={t('More info')}

jsapp/js/components/RESTServices/RESTServicesForm.es6

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,8 @@ export default class RESTServicesForm extends React.Component {
375375
})}
376376

377377
<Button
378-
type='full'
379-
color='storm'
378+
type='frame'
379+
color='dark-blue'
380380
size='s'
381381
startIcon='plus'
382382
onClick={this.addNewCustomHeaderRow.bind(this)}

0 commit comments

Comments
 (0)