Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #417

Merged
merged 3 commits into from
Mar 5, 2025
Merged

fixes #417

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/src/modules/entities/hc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import type routes from './handlers';

const client = hc<typeof routes>('');
type Client = typeof client;
export const entitiesHc = createHc<Client>('/');
export const entitiesHc = createHc<Client>('/entities');
2 changes: 1 addition & 1 deletion backend/src/modules/system/hc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import type routes from './handlers';

const client = hc<typeof routes>('');
type Client = typeof client;
export const systemHc = createHc<Client>('/');
export const systemHc = createHc<Client>('/system');
4 changes: 2 additions & 2 deletions config/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ export const config = {
// Optional settings
has: {
pwa: true, // Progressive Web App support for preloading static assets and offline support
sync: false, // Realtime updates and sync using Electric Sync
sync: true, // Realtime updates and sync using Electric Sync
registrationEnabled: true, // Allow users to sign up. If disabled, the app is by invitation only
waitlist: false, // Suggest a waitlist for unknown emails when sign up is disabled,
imado: false, // Imado fully configured, if false, files will be stored in local browser (indexedDB)
imado: true, // Imado fully configured, if false, files will be stored in local browser (indexedDB)
},

/**
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/modules/attachments/table/table-wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const AttachmentsTable = ({ organization, canUpload = true, isSheet = false }: A
};

const openRemoveDialog = () => {
dialog(<RemoveAttachmentsForm organizationId={organization.id} dialog attachments={selected} />, {
dialog(<RemoveAttachmentsForm organizationId={organization.id} dialog attachments={selected} callback={clearSelection} />, {
className: 'max-w-xl',
title: t('common:remove_resource', { resource: t('common:attachment').toLowerCase() }),
description: t('common:confirm.delete_resources', { resources: t('common:attachments').toLowerCase() }),
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/modules/common/sse/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const SSEProvider: FC<Props> = ({ children }) => {
};

const createSource = (reconnectAttempt = false) => {
const source = new EventSource(`${config.backendUrl}/sse`, {
const source = new EventSource(`${config.backendUrl}/me/sse`, {
withCredentials: true,
});

Expand Down
36 changes: 23 additions & 13 deletions frontend/src/modules/memberships/members-table/table-wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,29 @@ const MembersTable = ({ entity: baseEntity, isSheet = false }: MembersTableProps
};

const openRemoveDialog = () => {
dialog(<RemoveMembersForm organizationId={organizationId} entityIdOrSlug={entity.slug} entityType={entity.entity} dialog members={selected} />, {
className: 'max-w-xl',
title: t('common:remove_resource', { resource: t('common:member').toLowerCase() }),
description: (
<Trans
i18nKey="common:confirm.remove_members"
values={{
entity: entity.entity,
emails: selected.map((member) => member.email).join(', '),
}}
/>
),
});
dialog(
<RemoveMembersForm
organizationId={organizationId}
entityIdOrSlug={entity.slug}
entityType={entity.entity}
dialog
members={selected}
callback={clearSelection}
/>,
{
className: 'max-w-xl',
title: t('common:remove_resource', { resource: t('common:member').toLowerCase() }),
description: (
<Trans
i18nKey="common:confirm.remove_members"
values={{
entity: entity.entity,
emails: selected.map((member) => member.email).join(', '),
}}
/>
),
},
);
};

const handleNewInvites = (emails: string[]) => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/modules/navigation/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, Command
import { ScrollArea } from '~/modules/ui/scroll-area';
import { getEntityRoute, suggestionSections } from '~/nav-config';
import { useNavigationStore } from '~/store/navigation';
import type { entitySuggestionSchema } from '#/modules/general/schema';
import type { entitySuggestionSchema } from '#/modules/entities/schema';

export type SuggestionType = z.infer<typeof entitySuggestionSchema>;

Expand Down
1 change: 1 addition & 0 deletions frontend/src/modules/organizations/table/table-wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const OrganizationsTable = () => {
callback={(organizations) => {
toaster(t('common:success.delete_resources', { resources: t('common:organizations') }), 'success');
mutateQuery.remove(organizations);
clearSelection();
}}
dialog
/>,
Expand Down
10 changes: 1 addition & 9 deletions frontend/src/modules/requests/table/table-bar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { config } from 'config';
import { Handshake, Mail, Trash, XSquare } from 'lucide-react';
import { Handshake, Trash, XSquare } from 'lucide-react';
import { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import ColumnsView from '~/modules/common/data-table/columns-view';
Expand Down Expand Up @@ -37,7 +37,6 @@ export const RequestsTableBar = ({
const { t } = useTranslation();

const selectedToWaitlist = useMemo(() => selected.filter((r) => r.type === 'waitlist' && !r.tokenId), [selected]);
const selectedContact = useMemo(() => selected.filter((r) => r.type !== 'waitlist'), [selected]);

const isFiltered = !!q;
// Drop selected Rows on search
Expand All @@ -58,13 +57,6 @@ export const RequestsTableBar = ({
<FilterBarActions>
{selected.length > 0 && (
<>
{selectedContact.length > 0 && (
<Button className="relative">
<Badge className="py-0 px-1 absolute -right-2 min-w-5 flex justify-center -top-1.5">{selectedContact.length}</Badge>
<Mail size={16} />
<span className="ml-1 max-xs:hidden">{t('common:email')}</span>
</Button>
)}
{selectedToWaitlist.length > 0 && (
<Button variant="darkSuccess" className="relative" onClick={openInviteDialog}>
<Badge className="py-0 px-1 absolute -right-2 min-w-5 flex justify-center -top-1.5">{selectedToWaitlist.length}</Badge>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/modules/requests/table/table-wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const RequestsTable = () => {
callback={(requests) => {
toaster(t('common:success.delete_resources', { resources: t('common:requests') }), 'success');
mutateQuery.remove(requests);
clearSelection();
}}
dialog
/>,
Expand Down
1 change: 1 addition & 0 deletions frontend/src/modules/users/table/table-wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const UsersTable = () => {
callback={(users) => {
mutateQuery.remove(users);
toaster(t('common:success.delete_resources', { resources: t('common:users') }), 'success');
clearSelection();
}}
/>,
{
Expand Down