Skip to content

Commit 2a69a1f

Browse files
CopilotTechQuery
andcommitted
Implement inline editing and cleanup architecture per feedback
- Update user menu paths to use /user/ prefix - Change navigation to use session terminology for agenda submission - Merge Organization and Cooperation editors into List components with inline editing - Remove separate editor components and page routes - Clean up unused translations for success messages - Add session_list translation - Update "Add Organization" button to navigate to user organization list Co-authored-by: TechQuery <19969570+TechQuery@users.noreply.github.com>
1 parent 2313d0c commit 2a69a1f

File tree

11 files changed

+25
-297
lines changed

11 files changed

+25
-297
lines changed

components/Activity/menu.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const organizerMenu = ({ t }: typeof i18n, activityId: number): MenuItem[
88
];
99

1010
export const userMenu = ({ t }: typeof i18n): MenuItem[] => [
11-
{ href: '/organization', title: t('organization_list') },
12-
{ href: '/activity', title: t('activity_list') },
13-
// { href: '/session', title: t('session_list') }, // TODO: Add when session management is implemented
11+
{ href: '/user/organization', title: t('organization_list') },
12+
{ href: '/user/activity', title: t('activity_list') },
13+
{ href: '/user/session', title: t('session_list') },
1414
];

components/Cooperation/Editor.tsx

Lines changed: 0 additions & 87 deletions
This file was deleted.

components/Cooperation/List.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { ObservedComponent } from 'mobx-react-helper';
55
import { Column, RestTable } from 'mobx-restful-table';
66

77
import { CooperationModel } from '../../models/Cooperation';
8+
import { S3FileModel } from '../../models/File';
89
import { OrganizationModel } from '../../models/Organization';
910
import { i18n, I18nContext } from '../../models/Translation';
1011
import { renderTagInput } from '../Tag';
@@ -20,6 +21,7 @@ export class CooperationList extends ObservedComponent<CooperationListProps, typ
2021

2122
cooperationStore = new CooperationModel(this.props.activityId);
2223
organizationStore = new OrganizationModel();
24+
fileStore = new S3FileModel();
2325

2426
@computed
2527
get columns(): Column<Cooperation>[] {

components/Navigator/MainNavigator.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ export const MainNavigator: FC = observer(() => {
3838
<Button variant="outline-light" size="sm" href="/activity/0/editor">
3939
{t('publish_activity')}
4040
</Button>
41-
<Button variant="outline-light" size="sm" href="/agenda/0/editor">
41+
<Button variant="outline-light" size="sm" href="/session/0/editor">
4242
{t('submit_agenda')}
4343
</Button>
44-
<Button variant="outline-light" size="sm" href="/organization/0/editor">
44+
<Button variant="outline-light" size="sm" href="/user/organization">
4545
{t('create_organization')}
4646
</Button>
4747
</nav>

components/Organization/Editor.tsx

Lines changed: 0 additions & 89 deletions
This file was deleted.

components/Organization/List.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { observer } from 'mobx-react';
44
import { ObservedComponent } from 'mobx-react-helper';
55
import { Column, RestTable } from 'mobx-restful-table';
66

7+
import { S3FileModel } from '../../models/File';
78
import organizationStore from '../../models/Organization';
89
import { i18n, I18nContext } from '../../models/Translation';
910

@@ -15,6 +16,8 @@ export interface OrganizationListProps {
1516
export class OrganizationList extends ObservedComponent<OrganizationListProps, typeof i18n> {
1617
static contextType = I18nContext;
1718

19+
fileStore = new S3FileModel();
20+
1821
@computed
1922
get columns(): Column<Organization>[] {
2023
const { t } = this.observedContext;
@@ -23,7 +26,7 @@ export class OrganizationList extends ObservedComponent<OrganizationListProps, t
2326
{
2427
key: 'name',
2528
renderHead: t('name'),
26-
renderBody: ({ id, name }) => <a href={`/organization/${id}/editor`}>{name}</a>,
29+
renderBody: ({ name }) => name,
2730
required: true,
2831
minLength: 2,
2932
invalidMessage: t('field_required'),
@@ -43,18 +46,27 @@ export class OrganizationList extends ObservedComponent<OrganizationListProps, t
4346
</a>
4447
),
4548
},
49+
{
50+
key: 'logo',
51+
renderHead: t('logo'),
52+
type: 'file',
53+
accept: 'image/*',
54+
uploader: this.fileStore,
55+
},
4656
{
4757
key: 'summary',
4858
renderHead: t('summary'),
59+
rows: 3,
4960
},
5061
];
5162
}
5263

5364
render() {
5465
// const { userId } = this.observedProps;
55-
66+
5667
// TODO: Apply userId filter when backend supports user-specific organization filtering
57-
68+
// The filter would be applied through the store's filter mechanism, not as a RestTable prop
69+
5870
return (
5971
<RestTable
6072
className="h-100 text-center"

pages/activity/[id]/cooperation/[cid]/editor.tsx

Lines changed: 0 additions & 51 deletions
This file was deleted.

pages/organization/[id]/editor.tsx

Lines changed: 0 additions & 44 deletions
This file was deleted.

translation/en-US.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,6 @@ export default {
144144
english_name: 'English Name',
145145
logo: 'Logo',
146146
activity_list: 'Activity List',
147-
cooperation_created_successfully: 'Cooperation created successfully!',
148-
cooperation_updated_successfully: 'Cooperation updated successfully!',
149-
cooperation_deleted_successfully: 'Cooperation deleted successfully!',
150-
organization_created_successfully: 'Organization created successfully!',
151-
organization_updated_successfully: 'Organization updated successfully!',
152-
organization_deleted_successfully: 'Organization deleted successfully!',
147+
session_list: 'Session List',
153148
unknown: 'Unknown',
154149
} as const;

0 commit comments

Comments
 (0)