7 Commits

Author SHA1 Message Date
Primakov Alexandr Alexandrovich
428b06f920 3.6.0
All checks were successful
platform/bro-js/journal.pl/pipeline/head This commit looks good
2024-12-12 22:59:07 +03:00
Primakov Alexandr Alexandrovich
7d6f2a4ca0 no JSON stringify in attendance 2024-12-12 16:00:49 +03:00
Primakov Alexandr Alexandrovich
2fe7600ef3 fix 2024-12-12 15:20:55 +03:00
Primakov Alexandr Alexandrovich
985b8ef315 stringify 2024-12-12 12:30:56 +03:00
Primakov Alexandr Alexandrovich
956fdec7f5 unknown name if no name 2024-12-12 12:12:19 +03:00
Primakov Alexandr Alexandrovich
d44a511a3d try get student name even better 2024-12-12 12:09:25 +03:00
Primakov Alexandr Alexandrovich
0aebb87210 update get student name in attendance 2024-12-12 11:17:38 +03:00
5 changed files with 13 additions and 23 deletions

View File

@@ -1,12 +0,0 @@
import type { ConfigFile } from '@rtk-query/codegen-openapi'
const config: ConfigFile = {
schemaFile: 'https://platform.bro-js.ru/jrnl-bh/documentation/json',
apiFile: './src/__data__/api/api.ts',
apiImport: 'api',
outputFile: './src/__data__/api/jrnl.ts',
exportName: 'jrnlApi',
hooks: true,
}
export default config

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "journal.pl",
"version": "3.5.1",
"version": "3.6.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "journal.pl",
"version": "3.5.1",
"version": "3.6.0",
"license": "MIT",
"dependencies": {
"@brojs/cli": "^0.0.4-beta.0",

View File

@@ -1,6 +1,6 @@
{
"name": "journal.pl",
"version": "3.5.1",
"version": "3.6.0",
"description": "bro-js platform journal ui repo",
"main": "./src/index.tsx",
"scripts": {
@@ -19,7 +19,6 @@
"author": "",
"license": "MIT",
"devDependencies": {
"@rtk-query/codegen-openapi": "^1.2.0",
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.4.0",
"eslint": "^8.57.0",

View File

@@ -14,7 +14,7 @@ export default (props) => <App {...props} />;
let rootElement: ReactDOM.Root
export const mount = async (Сomponent, element = document.getElementById('app')) => {
export const mount = async (Component, element = document.getElementById('app')) => {
let user = null;
try {
await keycloak.init({ onLoad: "login-required" });
@@ -26,11 +26,11 @@ export const mount = async (Сomponent, element = document.getElementById('app')
const store = createStore({ user });
rootElement = ReactDOM.createRoot(element);
rootElement.render(<Сomponent store={store} />);
rootElement.render(<Component store={store} />);
if(module.hot) {
module.hot.accept('./app', ()=> {
rootElement.render(<Сomponent store={store} />);
rootElement.render(<Component store={store} />);
})
}
};

View File

@@ -24,15 +24,18 @@ export const Attendance = () => {
attendance.forEach((lesson) => {
lesson.students.forEach((student) => {
const current = studentsMap.get(student.sub) || {}
studentsMap.set(student.sub, {
...student,
value:
student.family_name && student.given_name
id: student.sub,
value: current.value || (student.family_name && student.given_name
? `${student.family_name} ${student.given_name}`
: student.name || student.email,
: student.name || student.email || student.preferred_username || student.family_name || student.given_name),
})
})
})
const compare = Intl.Collator('ru').compare
const students = [...studentsMap.values()]
@@ -60,7 +63,7 @@ export const Attendance = () => {
<th>Дата</th>
<th>Название занятия</th>
{data.students.map((student) => (
<th key={student.sub}>{student.name}</th>
<th id={student.id || student.sub} key={student.sub}>{student.name || student.value || 'Имя не определено'}</th>
))}
</tr>
</thead>