Merge branch 'master' into iav-arm-musl-dessalines

pull/813/head
Dessalines 2020-06-22 20:35:09 -04:00
commit e3484de3b8
12 changed files with 75 additions and 45 deletions

5
RELEASES.md vendored
View File

@ -1,4 +1,4 @@
# Lemmy v0.7.0 Release (2020-06-2X) # Lemmy v0.7.0 Release (2020-06-22)
## Breaking Change to our image server: Pictshare to Pict-rs migration guide ## Breaking Change to our image server: Pictshare to Pict-rs migration guide
@ -17,10 +17,11 @@ You'll also have to update your nginx config, use the [one here](https://github.
*You'll have to log in again to pick up your avatar* *You'll have to log in again to pick up your avatar*
Apart from that, we've closed [~90 issues!](https://github.com/LemmyNet/lemmy/milestone/16?closed=1), including: Apart from that, we've closed [~100 issues!](https://github.com/LemmyNet/lemmy/milestone/16?closed=1), including:
- Site-wide list of recent comments. - Site-wide list of recent comments.
- Reconnecting websockets. - Reconnecting websockets.
- Swapped out pictshare for [pict-rs](https://git.asonix.dog/asonix/pict-rs).
- Lots more themes, including a default light one. - Lots more themes, including a default light one.
- Expandable embeds for post links (and thumbnails), from iframely. - Expandable embeds for post links (and thumbnails), from iframely.
- Better icons. - Better icons.

2
ansible/VERSION vendored
View File

@ -1 +1 @@
v0.6.79 v0.6.82

View File

@ -12,7 +12,7 @@ services:
restart: always restart: always
lemmy: lemmy:
image: dessalines/lemmy:v0.6.79 image: dessalines/lemmy:v0.6.82
ports: ports:
- "127.0.0.1:8536:8536" - "127.0.0.1:8536:8536"
restart: always restart: always

View File

@ -1 +1 @@
pub const VERSION: &str = "v0.6.79"; pub const VERSION: &str = "v0.6.82";

View File

@ -61,7 +61,7 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
buttonTitle: !this.props.node buttonTitle: !this.props.node
? capitalizeFirstLetter(i18n.t('post')) ? capitalizeFirstLetter(i18n.t('post'))
: this.props.edit : this.props.edit
? capitalizeFirstLetter(i18n.t('edit')) ? capitalizeFirstLetter(i18n.t('save'))
: capitalizeFirstLetter(i18n.t('reply')), : capitalizeFirstLetter(i18n.t('reply')),
previewMode: false, previewMode: false,
loading: false, loading: false,
@ -138,7 +138,7 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
/> />
{this.state.previewMode && ( {this.state.previewMode && (
<div <div
className="md-div" className="card card-body md-div"
dangerouslySetInnerHTML={mdToHtml( dangerouslySetInnerHTML={mdToHtml(
this.state.commentForm.content this.state.commentForm.content
)} )}
@ -151,7 +151,7 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
<button <button
type="submit" type="submit"
class="btn btn-sm btn-secondary mr-2" class="btn btn-sm btn-secondary mr-2"
disabled={this.props.disabled} disabled={this.props.disabled || this.state.loading}
> >
{this.state.loading ? ( {this.state.loading ? (
<svg class="icon icon-spinner spin"> <svg class="icon icon-spinner spin">

View File

@ -132,7 +132,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
> >
<div <div
id={`comment-${node.comment.id}`} id={`comment-${node.comment.id}`}
className={`details comment-node border-top border-light ${ className={`details comment-node border-top border-light py-2 ${
this.isCommentNew ? 'mark' : '' this.isCommentNew ? 'mark' : ''
}`} }`}
style={ style={
@ -148,7 +148,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
'ml-2' 'ml-2'
}`} }`}
> >
<div class="d-flex flex-wrap align-items-center mb-1 mt-1 text-muted small"> <div class="d-flex flex-wrap align-items-center text-muted small">
<span class="mr-2"> <span class="mr-2">
<UserListing <UserListing
user={{ user={{
@ -294,25 +294,6 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
)} )}
</button> </button>
)} )}
<button
class="btn btn-link btn-animate text-muted"
onClick={linkEvent(this, this.handleSaveCommentClick)}
data-tippy-content={
node.comment.saved ? i18n.t('unsave') : i18n.t('save')
}
>
{this.state.saveLoading ? (
this.loadingIcon
) : (
<svg
class={`icon icon-inline ${
node.comment.saved && 'text-warning'
}`}
>
<use xlinkHref="#icon-star"></use>
</svg>
)}
</button>
<button <button
class="btn btn-link btn-animate text-muted" class="btn btn-link btn-animate text-muted"
onClick={linkEvent(this, this.handleReplyClick)} onClick={linkEvent(this, this.handleReplyClick)}
@ -348,6 +329,30 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
</button> </button>
)} )}
{!this.props.showContext && this.linkBtn} {!this.props.showContext && this.linkBtn}
<button
class="btn btn-link btn-animate text-muted"
onClick={linkEvent(
this,
this.handleSaveCommentClick
)}
data-tippy-content={
node.comment.saved
? i18n.t('unsave')
: i18n.t('save')
}
>
{this.state.saveLoading ? (
this.loadingIcon
) : (
<svg
class={`icon icon-inline ${
node.comment.saved && 'text-warning'
}`}
>
<use xlinkHref="#icon-star"></use>
</svg>
)}
</button>
<button <button
className="btn btn-link btn-animate text-muted" className="btn btn-link btn-animate text-muted"
onClick={linkEvent(this, this.handleViewSource)} onClick={linkEvent(this, this.handleViewSource)}

View File

@ -207,7 +207,11 @@ export class CommunityForm extends Component<
)} )}
<div class="form-group row"> <div class="form-group row">
<div class="col-12"> <div class="col-12">
<button type="submit" class="btn btn-secondary mr-2"> <button
type="submit"
class="btn btn-secondary mr-2"
disabled={this.state.loading}
>
{this.state.loading ? ( {this.state.loading ? (
<svg class="icon icon-spinner spin"> <svg class="icon icon-spinner spin">
<use xlinkHref="#icon-spinner"></use> <use xlinkHref="#icon-spinner"></use>

View File

@ -123,7 +123,10 @@ export class Inbox extends Component<any, InboxState> {
this.state.unreadOrAll == UnreadOrAll.Unread && ( this.state.unreadOrAll == UnreadOrAll.Unread && (
<ul class="list-inline mb-1 text-muted small font-weight-bold"> <ul class="list-inline mb-1 text-muted small font-weight-bold">
<li className="list-inline-item"> <li className="list-inline-item">
<span class="pointer" onClick={this.markAllAsRead}> <span
class="pointer"
onClick={linkEvent(this, this.markAllAsRead)}
>
{i18n.t('mark_all_as_read')} {i18n.t('mark_all_as_read')}
</span> </span>
</li> </li>
@ -392,8 +395,14 @@ export class Inbox extends Component<any, InboxState> {
this.refetch(); this.refetch();
} }
markAllAsRead() { markAllAsRead(i: Inbox) {
WebSocketService.Instance.markAllAsRead(); WebSocketService.Instance.markAllAsRead();
i.state.replies = [];
i.state.mentions = [];
i.state.messages = [];
i.sendUnreadCount();
window.scrollTo(0, 0);
i.setState(i.state);
} }
parseMessage(msg: WebSocketJsonResponse) { parseMessage(msg: WebSocketJsonResponse) {
@ -447,12 +456,7 @@ export class Inbox extends Component<any, InboxState> {
this.setState(this.state); this.setState(this.state);
setupTippy(); setupTippy();
} else if (res.op == UserOperation.MarkAllAsRead) { } else if (res.op == UserOperation.MarkAllAsRead) {
this.state.replies = []; // Moved to be instant
this.state.mentions = [];
this.state.messages = [];
this.sendUnreadCount();
window.scrollTo(0, 0);
this.setState(this.state);
} else if (res.op == UserOperation.EditComment) { } else if (res.op == UserOperation.EditComment) {
let data = res.data as CommentResponse; let data = res.data as CommentResponse;
editCommentRes(data, this.state.replies); editCommentRes(data, this.state.replies);

View File

@ -284,7 +284,7 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
/> />
{this.state.previewMode && ( {this.state.previewMode && (
<div <div
className="md-div" className="card card-body md-div"
dangerouslySetInnerHTML={mdToHtml(this.state.postForm.body)} dangerouslySetInnerHTML={mdToHtml(this.state.postForm.body)}
/> />
)} )}
@ -360,7 +360,9 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
<div class="form-group row"> <div class="form-group row">
<div class="col-sm-10"> <div class="col-sm-10">
<button <button
disabled={!this.state.postForm.community_id} disabled={
!this.state.postForm.community_id || this.state.loading
}
type="submit" type="submit"
class="btn btn-secondary mr-2" class="btn btn-secondary mr-2"
> >
@ -406,6 +408,12 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
handlePostSubmit(i: PostForm, event: any) { handlePostSubmit(i: PostForm, event: any) {
event.preventDefault(); event.preventDefault();
// Coerce empty url string to undefined
if (i.state.postForm.url && i.state.postForm.url === '') {
i.state.postForm.url = undefined;
}
if (i.props.post) { if (i.props.post) {
WebSocketService.Instance.editPost(i.state.postForm); WebSocketService.Instance.editPost(i.state.postForm);
} else { } else {

View File

@ -154,7 +154,7 @@ export class PrivateMessageForm extends Component<
/> />
{this.state.previewMode && ( {this.state.previewMode && (
<div <div
className="md-div" className="card card-body md-div"
dangerouslySetInnerHTML={mdToHtml( dangerouslySetInnerHTML={mdToHtml(
this.state.privateMessageForm.content this.state.privateMessageForm.content
)} )}
@ -183,7 +183,11 @@ export class PrivateMessageForm extends Component<
)} )}
<div class="form-group row"> <div class="form-group row">
<div class="offset-sm-2 col-sm-10"> <div class="offset-sm-2 col-sm-10">
<button type="submit" class="btn btn-secondary mr-2"> <button
type="submit"
class="btn btn-secondary mr-2"
disabled={this.state.loading}
>
{this.state.loading ? ( {this.state.loading ? (
<svg class="icon icon-spinner spin"> <svg class="icon icon-spinner spin">
<use xlinkHref="#icon-spinner"></use> <use xlinkHref="#icon-spinner"></use>

View File

@ -78,7 +78,7 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
<form onSubmit={linkEvent(this, this.handleCreateSiteSubmit)}> <form onSubmit={linkEvent(this, this.handleCreateSiteSubmit)}>
<h5>{`${ <h5>{`${
this.props.site this.props.site
? capitalizeFirstLetter(i18n.t('edit')) ? capitalizeFirstLetter(i18n.t('save'))
: capitalizeFirstLetter(i18n.t('name')) : capitalizeFirstLetter(i18n.t('name'))
} ${i18n.t('your_site')}`}</h5> } ${i18n.t('your_site')}`}</h5>
<div class="form-group row"> <div class="form-group row">
@ -175,7 +175,11 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
</div> </div>
<div class="form-group row"> <div class="form-group row">
<div class="col-12"> <div class="col-12">
<button type="submit" class="btn btn-secondary mr-2"> <button
type="submit"
class="btn btn-secondary mr-2"
disabled={this.state.loading}
>
{this.state.loading ? ( {this.state.loading ? (
<svg class="icon icon-spinner spin"> <svg class="icon icon-spinner spin">
<use xlinkHref="#icon-spinner"></use> <use xlinkHref="#icon-spinner"></use>

2
ui/src/version.ts vendored
View File

@ -1 +1 @@
export const version: string = 'v0.6.79'; export const version: string = 'v0.6.82';