Skip to content

Commit fc1384a

Browse files
authored
Merge pull request #851 from gitroomhq/feat/thumbnails
Thumbnails and alt
2 parents fc99498 + 12e065b commit fc1384a

File tree

20 files changed

+978
-208
lines changed

20 files changed

+978
-208
lines changed

.github/workflows/build-containers.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ jobs:
5252
- name: Build and Push Image
5353
env:
5454
CONTAINERVER: ${{ needs.build-containers-common.outputs.containerver }}
55-
VERSION: ${{ github.ref_name }}
55+
NEXT_PUBLIC_VERSION: ${{ github.ref_name }}
5656
run: |
5757
docker buildx build --platform linux/${{ matrix.arch }} \
5858
-f Dockerfile.dev \
5959
-t ghcr.io/gitroomhq/postiz-app:${{ env.CONTAINERVER }}-${{ matrix.arch }} \
60-
--build-arg VERSION=${{ env.VERSION }} \
60+
--build-arg NEXT_PUBLIC_VERSION=${{ env.NEXT_PUBLIC_VERSION }} \
6161
--provenance=false --sbom=false \
6262
--output "type=registry,name=ghcr.io/gitroomhq/postiz-app:${{ env.CONTAINERVER }}-${{ matrix.arch }}" .
6363

Dockerfile.dev

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM node:20-alpine3.19
2-
ARG VERSION
3-
ENV VERSION=$VERSION
2+
ARG NEXT_PUBLIC_VERSION
3+
ENV NEXT_PUBLIC_VERSION=$NEXT_PUBLIC_VERSION
44
RUN apk add --no-cache g++ make py3-pip supervisor bash caddy
55
RUN npm --no-update-notifier --no-fund --global install [email protected] pm2
66

apps/backend/src/api/routes/media.controller.ts

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { FileInterceptor } from '@nestjs/platform-express';
2222
import { CustomFileValidationPipe } from '@gitroom/nestjs-libraries/upload/custom.upload.validation';
2323
import { SubscriptionService } from '@gitroom/nestjs-libraries/database/prisma/subscriptions/subscription.service';
2424
import { UploadFactory } from '@gitroom/nestjs-libraries/upload/upload.factory';
25+
import { SaveMediaInformationDto } from '@gitroom/nestjs-libraries/dtos/media/save.media.information.dto';
2526

2627
@ApiTags('Media')
2728
@Controller('/media')
@@ -95,16 +96,38 @@ export class MediaController {
9596
if (!name) {
9697
return false;
9798
}
98-
return this._mediaService.saveFile(org.id, name, process.env.CLOUDFLARE_BUCKET_URL + '/' + name);
99+
return this._mediaService.saveFile(
100+
org.id,
101+
name,
102+
process.env.CLOUDFLARE_BUCKET_URL + '/' + name
103+
);
104+
}
105+
106+
@Post('/information')
107+
saveMediaInformation(
108+
@GetOrgFromRequest() org: Organization,
109+
@Body() body: SaveMediaInformationDto
110+
) {
111+
return this._mediaService.saveMediaInformation(
112+
org.id,
113+
body
114+
);
99115
}
100116

101117
@Post('/upload-simple')
102118
@UseInterceptors(FileInterceptor('file'))
103119
async uploadSimple(
104120
@GetOrgFromRequest() org: Organization,
105-
@UploadedFile('file') file: Express.Multer.File
121+
@UploadedFile('file') file: Express.Multer.File,
122+
@Body('preventSave') preventSave: string = 'false'
106123
) {
107124
const getFile = await this.storage.uploadFile(file);
125+
126+
if (preventSave === 'true') {
127+
const { path } = getFile;
128+
return { path };
129+
}
130+
108131
return this._mediaService.saveFile(
109132
org.id,
110133
getFile.originalname,

apps/frontend/src/components/launches/ai.image.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ ${type}
6868
}
6969
: {})}
7070
className={clsx(
71-
'relative ms-[10px] rounded-[4px] mb-[10px] gap-[8px] !text-primary justify-center items-center flex border border-dashed border-customColor21 bg-input',
71+
'relative ms-[10px] rounded-[4px] gap-[8px] !text-primary justify-center items-center flex border border-dashed border-customColor21 bg-input',
7272
value.length < 30 && 'opacity-25'
7373
)}
7474
>

apps/frontend/src/components/launches/helpers/linkedin.component.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ export const LinkedinCompany: FC<{
101101
id: string;
102102
}> = (props) => {
103103
const { onClose, onSelect, id } = props;
104+
const setActivateExitButton = useLaunchStore((e) => e.setActivateExitButton);
105+
useEffect(() => {
106+
setActivateExitButton(false);
107+
return () => {
108+
setActivateExitButton(true);
109+
};
110+
}, []);
104111
const fetch = useFetch();
105112
const [company, setCompany] = useState<any>(null);
106113
const toast = useToaster();
@@ -136,6 +143,7 @@ export const LinkedinCompany: FC<{
136143
<TopTitle title={'Select Company'} />
137144
</div>
138145
<button
146+
onClick={onClose}
139147
className="outline-none absolute end-[20px] top-[20px] mantine-UnstyledButton-root mantine-ActionIcon-root bg-primary hover:bg-tableBorder cursor-pointer mantine-Modal-close mantine-1dcetaa"
140148
type="button"
141149
>

0 commit comments

Comments
 (0)