This commit is contained in:
bakhirev 2025-07-06 13:30:28 +03:00
parent 151a485f74
commit b01250f359
23 changed files with 73 additions and 21 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

View file

@ -21,6 +21,7 @@ function Achievement({ code }: IAchievementProps) {
style.achievement_good, style.achievement_good,
style.achievement_middle, style.achievement_middle,
style.achievement_bad, style.achievement_bad,
style.achievement_publicity,
][statusIndex - 1]; ][statusIndex - 1];
return ( return (

View file

@ -88,3 +88,8 @@
border-color: #FEC4C4; border-color: #FEC4C4;
} }
.achievement_publicity {
background-color: var(--color-21);
border-color: var(--color-21);
}

View file

@ -99,5 +99,5 @@ export default function getAchievementByAuthor(list: string[], dataGrip: any, au
const index = ALL_ACHIEVEMENTS[type] - 1; const index = ALL_ACHIEVEMENTS[type] - 1;
acc[index].push(type); acc[index].push(type);
return acc; return acc;
}, [[], [], []]); }, [[], [], [], []]);
} }

View file

@ -76,6 +76,9 @@ class AchievementsByCompetition {
// Давным давно, в далёкой галактике // Давным давно, в далёкой галактике
byAuthor.add(total.moreLongWaitPR, 'moreLongWaitPR'); byAuthor.add(total.moreLongWaitPR, 'moreLongWaitPR');
// Авиасейлс
// byAuthor.add(total.manyTimeZone, 'moreChangeTimeZone');
// Первый и последний коммит // Первый и последний коммит
const lastAuthor = dataGrip.firstLastCommit.maxData.author; const lastAuthor = dataGrip.firstLastCommit.maxData.author;
const firstAuthor = dataGrip.firstLastCommit.minData.author; const firstAuthor = dataGrip.firstLastCommit.minData.author;
@ -112,6 +115,12 @@ class AchievementsByCompetition {
addData('days', statistic.days); addData('days', statistic.days);
addData('moreRefactoring', statistic.types.refactor); addData('moreRefactoring', statistic.types.refactor);
if (statistic.country) {
const notBritish = statistic.country
.filter((country: any) => country.timezone !== '+00:00');
addData('manyTimeZone', notBritish.length);
}
const byTimestamp = dataGrip.timestamp.statisticByAuthor[statistic.author]; const byTimestamp = dataGrip.timestamp.statisticByAuthor[statistic.author];
addData('tasksInDay', byTimestamp.tasksByTimestampCounter.max); addData('tasksInDay', byTimestamp.tasksByTimestampCounter.max);
addData('commitsInDay', byTimestamp.commitsByTimestampCounter.max); addData('commitsInDay', byTimestamp.commitsByTimestampCounter.max);

View file

@ -6,7 +6,9 @@ function getHashMap(list: string[]) {
} }
const IS_LINT_HINT = getHashMap(['.eslintrc', '.stylelintrc.json']); const IS_LINT_HINT = getHashMap(['.eslintrc', '.stylelintrc.json']);
const IS_DOC = getHashMap(['md', 'doc', 'docx', 'txt']);
const IS_CSS = getHashMap(['css', 'scss', 'less', 'style']); const IS_CSS = getHashMap(['css', 'scss', 'less', 'style']);
const IS_CSS_NAME = getHashMap(['style', 'styles']);
const IS_TEST = getHashMap(['test', 'mock', 'snap']); const IS_TEST = getHashMap(['test', 'mock', 'snap']);
const IS_CI_CD = getHashMap([ const IS_CI_CD = getHashMap([
'Dockerfile', 'Dockerfile',
@ -42,14 +44,28 @@ export default function getAchievementByFile(fileGrip: any, byAuthor: any) {
const moreDevOps: any = []; const moreDevOps: any = [];
const longFilePath: any = { author: '', length: 0 }; const longFilePath: any = { author: '', length: 0 };
const longFileName: any = { author: '', length: 0 }; const longFileName: any = { author: '', length: 0 };
const firstFileNameStyle: any = { author: '', milliseconds: Infinity };
const fileRush: IHashMap<number> = {}; const fileRush: IHashMap<number> = {};
console.log('file name');
fileGrip.files.list.forEach((file: IDirtyFile) => { fileGrip.files.list.forEach((file: IDirtyFile) => {
if (IS_LINT_HINT.has[file.name]) moreLintHint.push(getAddedChangedLines(file)); if (IS_LINT_HINT.has(file.name)) {
if (file.extension === 'md') moreReadMe.push(getAddedChangedLines(file)); moreLintHint.push(getAddedChangedLines(file));
if (IS_CSS.has[file.extension]) moreStyle.push(getAddedChangedLines(file)); } else if (IS_DOC.has(file.extension)) {
if (IS_TEST.has[file.extension] || IS_TEST.has[file.type]) moreTests.push(getAddedChangedLines(file)); moreReadMe.push(getAddedChangedLines(file));
if (IS_CI_CD.has[file.name]) moreDevOps.push(getAddedChangedLines(file)); } else if (IS_CSS.has(file.extension)) {
moreStyle.push(getAddedChangedLines(file));
} else if (IS_CSS_NAME.has(file.name)) {
moreStyle.push(getAddedChangedLines(file));
if (file?.firstCommit?.milliseconds && file?.firstCommit?.milliseconds < firstFileNameStyle.milliseconds) {
firstFileNameStyle.author = file.firstCommit?.author;
firstFileNameStyle.milliseconds = file.firstCommit?.milliseconds;
}
} else if (IS_TEST.has(file.extension) || IS_TEST.has(file.type)) {
moreTests.push(getAddedChangedLines(file));
} else if (IS_CI_CD.has(file.name)) {
moreDevOps.push(getAddedChangedLines(file));
}
fileRush[file.firstCommit?.author || ''] = fileRush[file.firstCommit?.author || ''] fileRush[file.firstCommit?.author || ''] = fileRush[file.firstCommit?.author || '']
? (fileRush[file.firstCommit?.author || ''] + 1) ? (fileRush[file.firstCommit?.author || ''] + 1)
@ -80,4 +96,7 @@ export default function getAchievementByFile(fileGrip: any, byAuthor: any) {
byAuthor.add(getTopUser(moreDevOps.flat(2)), 'moreDevOps'); byAuthor.add(getTopUser(moreDevOps.flat(2)), 'moreDevOps');
byAuthor.authors[longFilePath.author].push('longFilePath'); byAuthor.authors[longFilePath.author].push('longFilePath');
byAuthor.authors[longFileName.author].push('longFileName'); byAuthor.authors[longFileName.author].push('longFileName');
// if (firstFileNameStyle.author) {
// byAuthor.authors[firstFileNameStyle.author].push('firstCssInJs');
// }
} }

View file

@ -68,6 +68,10 @@ export default {
horoscope11: ACHIEVEMENT_TYPE.NORMAL, // скорп horoscope11: ACHIEVEMENT_TYPE.NORMAL, // скорп
horoscope12: ACHIEVEMENT_TYPE.NORMAL, // стрелец horoscope12: ACHIEVEMENT_TYPE.NORMAL, // стрелец
// Паблисити ачивки
moreChangeTimeZone: ACHIEVEMENT_TYPE.PUBLICITY, // Aaaaaa-viasales
firstCssInJs: ACHIEVEMENT_TYPE.PUBLICITY, // Ситник
// нет картинки // нет картинки
longestMessage: ACHIEVEMENT_TYPE.NORMAL, // А разговоров то было... longestMessage: ACHIEVEMENT_TYPE.NORMAL, // А разговоров то было...
commitsAfter1800: ACHIEVEMENT_TYPE.GOOD, // Делу время commitsAfter1800: ACHIEVEMENT_TYPE.GOOD, // Делу время

View file

@ -2,4 +2,5 @@ export default {
GOOD: 1, GOOD: 1,
NORMAL: 2, NORMAL: 2,
BAD: 3, BAD: 3,
PUBLICITY: 4,
}; };

View file

@ -122,6 +122,10 @@ const Total = observer(({ user }: IPersonCommonProps): React.ReactElement => {
title="page.person.achievement.negative" title="page.person.achievement.negative"
achievements={achievements[ACHIEVEMENT_TYPE.BAD - 1]} achievements={achievements[ACHIEVEMENT_TYPE.BAD - 1]}
/> />
<AchievementBlock
title="page.person.achievement.publicity"
achievements={achievements[ACHIEVEMENT_TYPE.PUBLICITY - 1]}
/>
<Description <Description
text={t('page.person.achievement.description')} text={t('page.person.achievement.description')}
/> />

View file

@ -57,6 +57,10 @@ const Total = observer(({
title="page.person.achievement.negative" title="page.person.achievement.negative"
achievements={achievements[ACHIEVEMENT_TYPE.BAD - 1]} achievements={achievements[ACHIEVEMENT_TYPE.BAD - 1]}
/> />
<AchievementBlock
title="page.person.achievement.publicity"
achievements={achievements[ACHIEVEMENT_TYPE.PUBLICITY - 1]}
/>
<br /> <br />
<br /> <br />
{commitsWithGet?.length ? ( {commitsWithGet?.length ? (

View file

@ -9,16 +9,16 @@ const LOGO: IBanner = {
}; };
const EXTERNAL_LOGO: IHashMap<IBanner> = { const EXTERNAL_LOGO: IHashMap<IBanner> = {
vk_frontend_du2: { // vk_frontend_du2: {
logo: './social/vk/frontend_du2.png', // logo: './social/vk/frontend_du2.png',
banner: './social/vk/frontend_du2.jpg', // banner: './social/vk/frontend_du2.jpg',
link: 'https://vk.com/frontend_du2', // link: 'https://vk.com/frontend_du2',
}, // },
vk_take_off_staff: { // vk_take_off_staff: {
logo: './social/vk/take_off_staff.png', // logo: './social/vk/take_off_staff.png',
banner: './social/vk/take_off_staff.jpg', // banner: './social/vk/take_off_staff.jpg',
link: 'https://vk.com/takeoff_staff', // link: 'https://vk.com/takeoff_staff',
}, // },
}; };
function getDefaultBanner(ref: string): IBanner | null { function getDefaultBanner(ref: string): IBanner | null {

View file

@ -109,6 +109,8 @@ export default `
§ achievements.moreDevOps.description: больше всех создал или изменил файлов для CI/CD § achievements.moreDevOps.description: больше всех создал или изменил файлов для CI/CD
§ achievements.moreTests.title: Тестировщик § achievements.moreTests.title: Тестировщик
§ achievements.moreTests.description: больше всех создал или изменил файлов для тестирования § achievements.moreTests.description: больше всех создал или изменил файлов для тестирования
§ achievements.moreChangeTimeZone.title: Aaaaa-viasales
§ achievements.moreChangeTimeZone.description: больше всех менял местоположение
§ achievements.allRelease.title: Фулл хаус § achievements.allRelease.title: Фулл хаус
§ achievements.allRelease.description: есть релиз, собранный только из его задач § achievements.allRelease.description: есть релиз, собранный только из его задач
§ achievements.firstCommit.title: Кто первый, того и тапки § achievements.firstCommit.title: Кто первый, того и тапки
@ -117,6 +119,8 @@ export default `
§ achievements.lastCommit.description: последний коммит на проекте § achievements.lastCommit.description: последний коммит на проекте
§ achievements.firstLastCommit.title: От начала и до конца § achievements.firstLastCommit.title: От начала и до конца
§ achievements.firstLastCommit.description: первый и последний коммит на проекте § achievements.firstLastCommit.description: первый и последний коммит на проекте
§ achievements.firstCssInJs.title: От начала и до конца
§ achievements.firstCssInJs.description: первый добавил CSS-in-JS файл
§ achievements.longFilePath.title: Закрома родины § achievements.longFilePath.title: Закрома родины
§ achievements.longFilePath.description: первый создал файл с самым глубоким вложением § achievements.longFilePath.description: первый создал файл с самым глубоким вложением
§ achievements.longFileName.title: Размер имеет значение § achievements.longFileName.title: Размер имеет значение

View file

@ -317,6 +317,7 @@ export default `
§ page.person.achievement.positive: Позитивные § page.person.achievement.positive: Позитивные
§ page.person.achievement.normal: Нейтральные § page.person.achievement.normal: Нейтральные
§ page.person.achievement.negative: Негативные § page.person.achievement.negative: Негативные
§ page.person.achievement.publicity: Специальные
§ page.person.achievement.description: Чем больше сотрудник набрал отрицательных достижений, тем больше вероятность, что ситуация нестандартная. Возможно, стоит изменить режим его работы, задачи или отчётность. Следует поговорить с ним и узнать, какие проблемы мешают его работе. § page.person.achievement.description: Чем больше сотрудник набрал отрицательных достижений, тем больше вероятность, что ситуация нестандартная. Возможно, стоит изменить режим его работы, задачи или отчётность. Следует поговорить с ним и узнать, какие проблемы мешают его работе.
§ page.person.gets.title: Медали за номера задач: § page.person.gets.title: Медали за номера задач:
§ page.person.gets.description: Медаль выдается, если пользователь первым оставляет коммит к задаче с «красивым» номером. § page.person.gets.description: Медаль выдается, если пользователь первым оставляет коммит к задаче с «красивым» номером.