diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json b/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json index 8db734f1..eed6f5ab 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json @@ -525,14 +525,14 @@ { "resourceName": "Platform", "key": "App.Blog", - "en": "Blog", - "tr": "Blog" + "en": "Blog Management", + "tr": "Blog Yönetimi" }, { "resourceName": "Platform", "key": "App.Forum", - "en": "Forum", - "tr": "Forum" + "en": "Forum Management", + "tr": "Forum Yönetimi" }, { "resourceName": "Platform", diff --git a/company/public/img/default-profile.png b/company/public/img/default-profile.png new file mode 100644 index 00000000..89cab7f6 Binary files /dev/null and b/company/public/img/default-profile.png differ diff --git a/company/src/pages/LoginWithTenant.tsx b/company/src/pages/LoginWithTenant.tsx index 45108dd7..fc383d48 100644 --- a/company/src/pages/LoginWithTenant.tsx +++ b/company/src/pages/LoginWithTenant.tsx @@ -90,10 +90,10 @@ const LoginWithTenant: React.FC = () => { }; return ( -
+
-
+
diff --git a/company/src/pages/Profile.tsx b/company/src/pages/Profile.tsx index 2a96bdd4..481fb73d 100644 --- a/company/src/pages/Profile.tsx +++ b/company/src/pages/Profile.tsx @@ -1,8 +1,8 @@ -import React from 'react'; -import { useAuthStore } from '../store/authStore'; -import { User, Mail, Calendar, Shield } from 'lucide-react'; -import { format } from 'date-fns'; -import { tr } from 'date-fns/locale'; +import React from "react"; +import { useAuthStore } from "../store/authStore"; +import { User, Mail, Calendar, Shield } from "lucide-react"; +import { format } from "date-fns"; +import { tr } from "date-fns/locale"; const Profile: React.FC = () => { const { user } = useAuthStore(); @@ -20,14 +20,18 @@ const Profile: React.FC = () => {

Profilim

- +
{user.avatar ? ( - {user.name} { + e.currentTarget.onerror = null; // sonsuz döngüyü önlemek için + e.currentTarget.src = "/img/default-profile.png"; // bu senin varsayılan avatar görselin + }} /> ) : (
@@ -35,7 +39,9 @@ const Profile: React.FC = () => {
)}
-

{user.fullName || user.name}

+

+ {user.fullName || user.name} +

@{user.userName}

@@ -65,9 +71,11 @@ const Profile: React.FC = () => {

Kayıt Tarihi

- {user.creationTime - ? format(new Date(user.creationTime), 'dd MMMM yyyy', { locale: tr }) - : 'Bilinmiyor'} + {user.creationTime + ? format(new Date(user.creationTime), "dd MMMM yyyy", { + locale: tr, + }) + : "Bilinmiyor"}

@@ -96,17 +104,30 @@ const Profile: React.FC = () => {
-

Hesap Durumu

+

+ Hesap Durumu +

-
- - {user.isActive ? 'Aktif' : 'Pasif'} +
+ + {user.isActive ? "Aktif" : "Pasif"}
- + {user.lastLoginTime && (

- Son giriş: {format(new Date(user.lastLoginTime), 'dd MMMM yyyy HH:mm', { locale: tr })} + Son giriş:{" "} + {format(new Date(user.lastLoginTime), "dd MMMM yyyy HH:mm", { + locale: tr, + })}

)}
diff --git a/company/src/services/api/language.service.ts b/company/src/services/api/language.service.ts new file mode 100644 index 00000000..afe0dc60 --- /dev/null +++ b/company/src/services/api/language.service.ts @@ -0,0 +1,42 @@ +import { apiClient } from "./config"; + +export interface LanguageText { + id: string; + name: string; + slug: string; + description: string; + icon?: string; + topicCount: number; + postCount: number; + lastPost?: { + id: string; + title: string; + author: string; + createdAt: string; + }; + order: number; + isLocked: boolean; +} + +export interface LanguageParams { + cultureName?: string; +} + +export interface PaginatedResponse { + items: T[]; + totalCount: number; + pageNumber: number; + pageSize: number; + totalPages: number; +} + +class LanguageService { + async getLanguageTextByCultureName(cultureName: string): Promise> { + const response = await apiClient.get>( + `/api/app/language/language-by-culture-name/${cultureName}`, + ); + return response.data; + } +} + +export const languageService = new LanguageService(); diff --git a/ui/src/views/blog/BlogManagement.tsx b/ui/src/views/blog/BlogManagement.tsx index 8f82da01..18dc6027 100644 --- a/ui/src/views/blog/BlogManagement.tsx +++ b/ui/src/views/blog/BlogManagement.tsx @@ -31,11 +31,11 @@ import THead from '@/components/ui/Table/THead' import TBody from '@/components/ui/Table/TBody' import Td from '@/components/ui/Table/Td' import { SelectBoxOption } from '@/shared/types' -import { CheckBox } from 'devextreme-react' import { Checkbox } from '@/components/ui' import { Helmet } from 'react-helmet' import { useLocalization } from '@/utils/hooks/useLocalization' import { ConfirmDialog } from '@/components/shared' +import { useStoreState } from '@/store/store' const validationSchema = Yup.object().shape({ title: Yup.string().required(), @@ -67,9 +67,10 @@ const BlogManagement = () => { const [categoryModalVisible, setCategoryModalVisible] = useState(false) const [editingPost, setEditingPost] = useState(null) const [editingCategory, setEditingCategory] = useState(null) + const { texts } = useStoreState((state) => state.abpConfig) const categoryItems = categories?.map((cat) => ({ value: cat.id, - label: cat.name, + label: texts?.Platform[cat.name] + ' (' + cat.name + ')', })) useEffect(() => { @@ -388,7 +389,7 @@ const BlogManagement = () => {
{activeTab === 'posts' ? ( - +
@@ -415,9 +416,9 @@ const BlogManagement = () => { ) : ( posts.map((post) => ( - + - + + - + - + +
{translate('::blog.posts.post.title')}
{post.title}{texts?.Platform[post.title]} {post.slug}{post.category?.name}{texts?.Platform[post.category?.name]} {post.author?.name} {post.publishedAt @@ -425,7 +426,11 @@ const BlogManagement = () => { : '-'} - handlePublish(post)} /> + handlePublish(post)} + />
@@ -452,6 +457,7 @@ const BlogManagement = () => {
{translate('::blog.posts.categories.slug')} {translate('::blog.posts.categories.description')} {translate('::blog.posts.categories.count')}{translate('::blog.posts.categories.order')} {translate('::blog.posts.categories.status')}
{category.name}{texts?.Platform[category.name]} {category.slug}{category.description}{texts?.Platform[category.description!!]} {category.postCount}{category.displayOrder} { invalid={errors.title && touched.title} errorMessage={errors.title} > - + + {({ field, form }: FieldProps) => { + const options = texts?.Platform + ? Object.entries(texts.Platform).map(([key, value]) => ({ + value: key, + label: value + ' (' + key + ')', + })) + : [] + + return ( + opt.value === field.value)} + onChange={(option) => form.setFieldValue(field.name, option?.value || '')} + /> + ) + }} + + + { invalid={errors.name && touched.name} errorMessage={errors.name} > - + + {({ field, form }: FieldProps) => { + const options = texts?.Platform + ? Object.entries(texts.Platform).map(([key, value]) => ({ + value: key, + label: value + ' (' + key + ')', + })) + : [] + + return ( + opt.value === field.value)} + onChange={(option) => form.setFieldValue(field.name, option?.value || '')} + /> + ) + }} +