diff --git a/backend/pb_migrations/1776262072_updated_users.js b/backend/pb_migrations/1776262072_updated_users.js new file mode 100644 index 0000000..30f9e35 --- /dev/null +++ b/backend/pb_migrations/1776262072_updated_users.js @@ -0,0 +1,47 @@ +/// +migrate((app) => { + const collection = app.findCollectionByNameOrId("_pb_users_auth_") + + // update collection data + unmarshal({ + "oauth2": { + "mappedFields": { + "name": "" + } + } + }, collection) + + // remove field + collection.fields.removeById("text1579384326") + + return app.save(collection) +}, (app) => { + const collection = app.findCollectionByNameOrId("_pb_users_auth_") + + // update collection data + unmarshal({ + "oauth2": { + "mappedFields": { + "name": "name" + } + } + }, collection) + + // add field + collection.fields.addAt(6, new Field({ + "autogeneratePattern": "", + "hidden": false, + "id": "text1579384326", + "max": 255, + "min": 0, + "name": "name", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": false, + "system": false, + "type": "text" + })) + + return app.save(collection) +}) diff --git a/backend/pb_migrations/1776262083_updated_users.js b/backend/pb_migrations/1776262083_updated_users.js new file mode 100644 index 0000000..16b9d84 --- /dev/null +++ b/backend/pb_migrations/1776262083_updated_users.js @@ -0,0 +1,53 @@ +/// +migrate((app) => { + const collection = app.findCollectionByNameOrId("_pb_users_auth_") + + // update collection data + unmarshal({ + "oauth2": { + "mappedFields": { + "avatarURL": "" + } + } + }, collection) + + // remove field + collection.fields.removeById("file376926767") + + return app.save(collection) +}, (app) => { + const collection = app.findCollectionByNameOrId("_pb_users_auth_") + + // update collection data + unmarshal({ + "oauth2": { + "mappedFields": { + "avatarURL": "avatar" + } + } + }, collection) + + // add field + collection.fields.addAt(8, new Field({ + "hidden": false, + "id": "file376926767", + "maxSelect": 1, + "maxSize": 0, + "mimeTypes": [ + "image/jpeg", + "image/png", + "image/svg+xml", + "image/gif", + "image/webp" + ], + "name": "avatar", + "presentable": false, + "protected": false, + "required": false, + "system": false, + "thumbs": null, + "type": "file" + })) + + return app.save(collection) +}) diff --git a/frontend/src/components/layout/header/Header.astro b/frontend/src/components/layout/header/Header.astro index f86c75c..a45972f 100644 --- a/frontend/src/components/layout/header/Header.astro +++ b/frontend/src/components/layout/header/Header.astro @@ -350,10 +350,11 @@ import { COMPANY } from "@constants"; // Скрываем телефон, показываем аватар и кнопку выхода if (phoneEl) phoneEl.style.display = 'none'; + const displayName = user.name || user.email || 'Пользователь'; authSection.innerHTML = `
-
${firstLetter}
+
${firstLetter}