Skip to content
Merged
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
9 changes: 8 additions & 1 deletion frontend/jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ module.exports = {
{
path: 'node_modules/ts-jest-mock-import-meta',
options: {
metaObjectReplacement: { url: 'https://www.url.com' },
metaObjectReplacement: {
url: 'https://www.url.com',
env: {
VITE_BACKEND_URL: 'http://localhost:8000/',
VITE_FRONTEND_URL: 'http://localhost:80',
VITE_CONTAINER_ORIGIN: 'http://localhost:8080/',
},
},
},
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ export const SetupGuide = (props: Props) => {
commands one block at a time
</div>
<CopyableCode
text={`task config sync.server.origin ${url.containerOrigin}`}
copyText={`task config sync.server.origin ${url.containerOrigin}`}
text={`task config sync.server.url ${url.containerOrigin}`}
copyText={`task config sync.server.url ${url.containerOrigin}`}
/>
<CopyableCode
text={`task config sync.server.client_id ${props.uuid}`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('SetupGuide', () => {
).toBeInTheDocument();

expect(
screen.getByText('task config sync.server.origin https://test-container')
screen.getByText('task config sync.server.url https://test-container')
).toBeInTheDocument();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('exportConfigSetup', () => {
);

expect(result).toContain(
`task config sync.server.origin ${url.containerOrigin}`
`task config sync.server.url ${url.containerOrigin}`
);

expect(result).toContain(`task config sync.server.client_id ${props.uuid}`);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/HomeComponents/SetupGuide/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export function exportConfigSetup(props: Props): string {
return [
'Configure Taskwarrior with these commands, run these commands one block at a time',
`task config sync.encryption_secret ${props.encryption_secret}`,
`task config sync.server.origin ${url.containerOrigin}`,
`task config sync.server.url ${url.containerOrigin}`,
`task config sync.server.client_id ${props.uuid}`,
'For more information about how this works, refer to the task-sync(5) manpage for details on how to configure the new sync implementation.',
].join('\n');
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/components/utils/URLs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ export const url = isTesting
taskchampionSyncServerURL: '',
}
: {
backendURL: 'http://localhost:8000/',
frontendURL: 'http://localhost:80',
containerOrigin: 'http://localhost:8080/',
backendURL: import.meta.env.VITE_BACKEND_URL || 'http://localhost:8000/',
frontendURL: import.meta.env.VITE_FRONTEND_URL || 'http://localhost:80',
containerOrigin:
import.meta.env.VITE_CONTAINER_ORIGIN || 'http://localhost:8080/',
githubRepoURL: 'https://github.com/CCExtractor/ccsync',
githubDocsURL: 'https://its-me-abhishek.github.io/ccsync-docs/',
zulipURL: 'https://ccextractor.org/public/general/support/',
Expand Down
Loading