Skip to content

Commit

Permalink
chore: various small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nicotsx committed Dec 7, 2024
1 parent c8019d0 commit 984452c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/backend/src/modules/apps/apps.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class AppsRepository {
public async updateAppAppStoreIdWhereNull(appStoreId: number) {
await this.db.db
.update(app)
.set({ appStoreId, id: sql`CONCAT('${sql.raw(appStoreId.toString())}', '_', id)` })
.set({ appStoreId, id: sql`CONCAT(id, '_', '${sql.raw(appStoreId.toString())}')` })
.where(isNull(app.appStoreId))
.returning()
.execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class DockerComposeBuilder {
const service = new ServiceBuilder();
service
.setImage(params.image)
.setName(`${storeId}_${params.name}`)
.setName(`${params.name}_${storeId}`)
.setEnvironment(params.environment)
.setCommand(params.command)
.setHealthCheck(params.healthCheck)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ exports[`App lifecycle > install app > should successfully install app and creat

exports[`App lifecycle > install app > should successfully install app and create expected directory structure 2`] = `
"services:
1_test:
test_1:
image: test
container_name: 1_test
container_name: test_1
restart: unless-stopped
networks:
- tipi_main_network
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/tests/integration/app-lifecycle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe('App lifecycle', () => {
it('should successfully install app and create expected directory structure', async () => {
// arrange
const appInfo = await createAppInStore(1, { id: 'test' });
const appId = `1_${appInfo.id}`;
const appId = `${appInfo.id}_1`;

// act
await appLifecycleService.installApp({ appId, form: {} });
Expand All @@ -124,7 +124,7 @@ describe('App lifecycle', () => {
it('should not delete an existing app-data folder even if the app is reinstalled', async () => {
// arrange
const appInfo = await createAppInStore(1, { id: 'test2' });
const appId = `1_${appInfo.id}`;
const appId = `${appInfo.id}_1`;

await fs.promises.mkdir(`${APP_DATA_DIR}/1_test2/data`, { recursive: true });
await fs.promises.writeFile(`${APP_DATA_DIR}/1_test2/data/test.txt`, 'test');
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/page-title/page-title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const PageTitle = ({ apps }: Props) => {
);
};

const appTitle = apps.find((app) => app.id.split('_')[1] === pathArray.at(-1))?.name;
const appTitle = apps.find((app) => app.id.split('_')[0] === pathArray.at(-1))?.name;
const title = appTitle ?? t(`HEADER_${pathArray[0]?.toUpperCase().replace('-', '_')}`);

return (
Expand Down

0 comments on commit 984452c

Please sign in to comment.