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

Multiple image upload #971

Merged
merged 12 commits into from
Apr 4, 2023
Merged

Conversation

SleeplessOne1917
Copy link
Member

@SleeplessOne1917 SleeplessOne1917 commented Mar 28, 2023

This closes #777
This does what #812 by @sam365724 does but using the updated client.

src/shared/utils.ts Show resolved Hide resolved
src/shared/utils.ts Outdated Show resolved Hide resolved
animated
value={this.state.imageUploadStatus.uploaded}
max={this.state.imageUploadStatus.total}
text={`${this.state.imageUploadStatus.uploaded}/${this.state.imageUploadStatus.total} files uploaded`}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll have to add a translation for this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make a PR over on lemmy-translations for me to merge. Here's an example of using counts: https://github.com/LemmyNet/lemmy-translations/blob/main/translations/en.json#L148

You can grep the lemmy-ui for any of those formatted count type strings to see how to do in the UI.

Copy link
Member

@dessalines dessalines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few minor things, and the one i18n string to add. After the new string gets merged by me into lemmy-translations, you can run:

git submodule update --remote
git add lemmy-translations

src/shared/components/common/emoji-picker.tsx Show resolved Hide resolved
src/shared/components/common/progress-bar.tsx Show resolved Hide resolved
src/shared/components/common/progress-bar.tsx Outdated Show resolved Hide resolved
src/shared/components/common/progress-bar.tsx Show resolved Hide resolved
src/shared/components/common/markdown-textarea.tsx Outdated Show resolved Hide resolved
animated
value={this.state.imageUploadStatus.uploaded}
max={this.state.imageUploadStatus.total}
text={`${this.state.imageUploadStatus.uploaded}/${this.state.imageUploadStatus.total} files uploaded`}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make a PR over on lemmy-translations for me to merge. Here's an example of using counts: https://github.com/LemmyNet/lemmy-translations/blob/main/translations/en.json#L148

You can grep the lemmy-ui for any of those formatted count type strings to see how to do in the UI.

src/shared/components/common/markdown-textarea.tsx Outdated Show resolved Hide resolved
src/shared/components/common/markdown-textarea.tsx Outdated Show resolved Hide resolved
@dessalines
Copy link
Member

dessalines commented Apr 3, 2023

Okay, now that the translations merged, you should just have to run:

git submodule update --remote
git add lemmy-translations
git commit -m"Updating translations"
git push

@SleeplessOne1917
Copy link
Member Author

Woodpecker is getting a build failure:

+ yarn lint
yarn run v1.22.19
$ node generate_translations.js && tsc --noEmit && eslint --report-unused-disable-directives --ext .js,.ts,.tsx src && prettier --check 'src/**/*.tsx'
src/shared/components/common/markdown-textarea.tsx:311:36 - error TS2345: Argument of type 'I18nKeys' is not assignable to parameter of type 'NoOptionI18nKeys | NoOptionI18nKeys[]'.
  Type '"click_to_delete_picture"' is not assignable to type 'NoOptionI18nKeys | NoOptionI18nKeys[]'.

311         data-tippy-content={i18n.t(type)}
                                       ~~~~

src/shared/components/common/markdown-textarea.tsx:312:28 - error TS2345: Argument of type 'I18nKeys' is not assignable to parameter of type 'NoOptionI18nKeys | NoOptionI18nKeys[]'.

312         aria-label={i18n.t(type)}
                               ~~~~


Found 2 errors in the same file, starting at: src/shared/components/common/markdown-textarea.tsx:311

error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I don't know why it's doing this considering the code it's complaining about in the build isn't actually in the PR. This is what's actually in the PR's code.

@SleeplessOne1917
Copy link
Member Author

I pushed a small change an hour after the last one and the CI build worked this time. Disregard my last comment.

Copy link
Member

@dessalines dessalines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thx again!

@dessalines dessalines merged commit 699c3ff into LemmyNet:main Apr 4, 2023
@SleeplessOne1917 SleeplessOne1917 deleted the async-image-upload branch April 8, 2023 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow multiple images to be uploaded at once
2 participants