Skip to content

Commit b35abd3

Browse files
committed
#86 - add progress bar in order to track requests limit
1 parent f0b54fe commit b35abd3

File tree

15 files changed

+236
-13
lines changed

15 files changed

+236
-13
lines changed

.env

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
VITE_APP_APP_VERSION=10.0.12
1+
VITE_APP_APP_VERSION=10.0.14
2+
VITE_APP_GITHUB_API_FREE_HOURLY_LIMIT=60
3+
VITE_APP_GITHUB_API_TOKENIZED_HOURLY_LIMIT=5000
24
VITE_APP_TOKEN_CREATION_LINK=https://github.com/settings/tokens/new?scopes=repo&description=Github%20GLOC
35
VITE_APP_APPLICATION_REPO=https://github.com/kas-elvirov/gloc
46
VITE_APP_DEVELOPER_WEBSITE=https://kas-elvirov.com

.env.development

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
VITE_APP_APP_VERSION=10.0.12
1+
VITE_APP_APP_VERSION=10.0.14
2+
VITE_APP_GITHUB_API_FREE_HOURLY_LIMIT=60
3+
VITE_APP_GITHUB_API_TOKENIZED_HOURLY_LIMIT=5000
24
VITE_APP_TOKEN_CREATION_LINK=https://github.com/settings/tokens/new?scopes=repo&description=Github%20GLOC
35
VITE_APP_APPLICATION_REPO=https://github.com/kas-elvirov/gloc
46
VITE_APP_DEVELOPER_WEBSITE=https://kas-elvirov.com

.env.production

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
VITE_APP_APP_VERSION=10.0.12
1+
VITE_APP_APP_VERSION=10.0.14
2+
VITE_APP_GITHUB_API_FREE_HOURLY_LIMIT=60
3+
VITE_APP_GITHUB_API_TOKENIZED_HOURLY_LIMIT=5000
24
VITE_APP_TOKEN_CREATION_LINK=https://github.com/settings/tokens/new?scopes=repo&description=Github%20GLOC
35
VITE_APP_APPLICATION_REPO=https://github.com/kas-elvirov/gloc
46
VITE_APP_DEVELOPER_WEBSITE=https://kas-elvirov.com

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"short_name": "Gloc",
55
"author": "Kas Elvirov",
66
"description": "Github Gloc - counts locs on GitHub pages",
7-
"version": "10.0.12",
7+
"version": "10.0.14",
88
"action": {
99
"default_icon": {
1010
"16": "img/icon16.png",

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gloc",
3-
"version": "10.0.12",
3+
"version": "10.0.14",
44
"engines": {
55
"node": "16.19.0",
66
"npm": "0.39.3"

scripts/upAppVersion.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ const manifest = require('../manifest.json');
1010
const env = '.env';
1111
let parsedEnv = envfile.parse(env);
1212
parsedEnv.VITE_APP_APP_VERSION = package.version;
13+
parsedEnv.VITE_APP_GITHUB_API_FREE_HOURLY_LIMIT = 60;
14+
parsedEnv.VITE_APP_GITHUB_API_TOKENIZED_HOURLY_LIMIT = 5000;
1315
parsedEnv.VITE_APP_TOKEN_CREATION_LINK = 'https://github.com/settings/tokens/new?scopes=repo&description=Github%20GLOC';
1416
parsedEnv.VITE_APP_APPLICATION_REPO = 'https://github.com/kas-elvirov/gloc';
1517
parsedEnv.VITE_APP_DEVELOPER_WEBSITE = 'https://kas-elvirov.com';
@@ -22,6 +24,8 @@ fs.writeFileSync('./.env', envfile.stringify(parsedEnv));
2224
const envDevelopment = '.env.development';
2325
let parsedEnvDevelopment = envfile.parse(envDevelopment);
2426
parsedEnvDevelopment.VITE_APP_APP_VERSION = package.version;
27+
parsedEnvDevelopment.VITE_APP_GITHUB_API_FREE_HOURLY_LIMIT = 60;
28+
parsedEnvDevelopment.VITE_APP_GITHUB_API_TOKENIZED_HOURLY_LIMIT = 5000;
2529
parsedEnvDevelopment.VITE_APP_TOKEN_CREATION_LINK =
2630
'https://github.com/settings/tokens/new?scopes=repo&description=Github%20GLOC';
2731
parsedEnvDevelopment.VITE_APP_APPLICATION_REPO = 'https://github.com/kas-elvirov/gloc';
@@ -35,6 +39,8 @@ fs.writeFileSync('./.env.development', envfile.stringify(parsedEnvDevelopment));
3539
const envProduction = '.env.production';
3640
let parsedEnvProduction = envfile.parse(envProduction);
3741
parsedEnvProduction.VITE_APP_APP_VERSION = package.version;
42+
parsedEnvProduction.VITE_APP_GITHUB_API_FREE_HOURLY_LIMIT = 60;
43+
parsedEnvProduction.VITE_APP_GITHUB_API_TOKENIZED_HOURLY_LIMIT = 5000;
3844
parsedEnvProduction.VITE_APP_TOKEN_CREATION_LINK =
3945
'https://github.com/settings/tokens/new?scopes=repo&description=Github%20GLOC';
4046
parsedEnvProduction.VITE_APP_APPLICATION_REPO = 'https://github.com/kas-elvirov/gloc';
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { FC } from 'react';
2+
3+
import { Box, LinearProgress, Typography } from '@mui/material';
4+
5+
import { LinearProgressWithLabelProps } from './LinearProgressWithLabel.types';
6+
7+
export const LinearProgressWithLabel: FC<
8+
LinearProgressWithLabelProps
9+
> = props => {
10+
return (
11+
<Box sx={{ display: 'flex', alignItems: 'center' }}>
12+
<Box sx={{ width: '100%', mr: 1 }}>
13+
<LinearProgress
14+
variant='determinate'
15+
{...props}
16+
color={props.value < 100 ? 'primary' : 'error'}
17+
/>
18+
</Box>
19+
<Box sx={{ minWidth: 35 }}>
20+
<Typography
21+
variant='body2'
22+
sx={{ color: 'text.secondary' }}
23+
>{`${Math.round(props.value)}%`}</Typography>
24+
</Box>
25+
</Box>
26+
);
27+
};
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { LinearProgressProps } from '@mui/material';
2+
3+
export type LinearProgressWithLabelProps = LinearProgressProps & {
4+
value: number;
5+
};

src/_modules/Content/containers/LocIndicator/LocIndicator.utils.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ const getErrorMessage = ({
2525
let isError = false;
2626
const castedError = error as ErrorType;
2727

28-
console.group('getErrorMessage');
29-
console.log('data', data);
30-
console.log('error', error);
31-
console.log('isObjectValid(data)', isObjectValid(data));
32-
console.groupEnd();
33-
3428
if (castedError?.status === 202 && !isObjectValid(data)) {
3529
return {
3630
errorMessage: 'Needs to retry',

0 commit comments

Comments
 (0)