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

chat: sharing improvements (fixes #7466) #7467

Merged
merged 5 commits into from
May 28, 2024
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
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "planet",
"license": "AGPL-3.0",
"version": "0.14.35",
"version": "0.14.36",
"myplanet": {
"latest": "v0.15.39",
"min": "v0.14.39"
"latest": "v0.15.47",
"min": "v0.14.47"
},
"scripts": {
"ng": "ng",
Expand Down
2 changes: 1 addition & 1 deletion src/app/news/news-list-item.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</button>
<span class="toolbar-fill"></span>
<ng-container *ngIf="item.doc.user.name === currentUser.name">
<button mat-icon-button type="button" (click)="editNews(item.doc)" *ngIf="!item.doc.chat"><mat-icon>edit</mat-icon></button>
<button mat-icon-button type="button" (click)="editNews(item.doc)"><mat-icon>edit</mat-icon></button>
<button mat-icon-button type="button" (click)="openDeleteDialog(item.doc)"><mat-icon>delete</mat-icon></button>
</ng-container>
<button mat-button i18n *ngIf="editable && !item.doc.chat" [matMenuTriggerFor]="labelMenu" [disabled]="labels.listed.length === 0">Add Label</button>
Expand Down
12 changes: 12 additions & 0 deletions src/app/news/news-list-item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,15 @@ mat-card-content {
color: #ff0000;
font-style: italic;
}

@media (max-width: $screen-md) {
.chat-container {
padding: 20px;
}
}

@media (max-width: $screen-sm) {
.chat-container {
padding: 10px;
}
}
2 changes: 1 addition & 1 deletion src/app/shared/dialogs/dialogs-chat-share.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</mat-step>
<mat-step i18n-label label="Message" [stepControl]="teamForm">
<mat-form-field class="full-width">
<textarea matInput i18n-placeholder placeholder="Message" formControlName="message" required></textarea>
<textarea matInput i18n-placeholder placeholder="Message" formControlName="message"></textarea>
<mat-error><planet-form-error-messages [control]="teamForm.controls.message"></planet-form-error-messages></mat-error>
</mat-form-field>
<button mat-raised-button color="primary" type="submit" mat-dialog-close i18n>
Expand Down
11 changes: 3 additions & 8 deletions src/app/shared/dialogs/dialogs-chat-share.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ import { forkJoin } from 'rxjs';
import { switchMap, map } from 'rxjs/operators';


import { CustomValidators } from '../../validators/custom-validators';
import { CouchService } from '../../shared/couchdb.service';
import { NewsService } from '../../news/news.service';
import { TeamsService } from '../../teams/teams.service';
import { UserService } from '../../shared/user.service';
import { ValidatorService } from '../../validators/validator.service';

@Component({
templateUrl: './dialogs-chat-share.component.html',
Expand Down Expand Up @@ -46,26 +44,23 @@ export class DialogsChatShareComponent implements OnInit {
private newsService: NewsService,
private teamsService: TeamsService,
private userService: UserService,
private validatorService: ValidatorService
) {
this.conversation = data || this.conversation;
}

ngOnInit() {
this.communityForm = this.formBuilder.group({
message: [ '' ]
message: ''
});
this.teamForm = this.formBuilder.group({
message: [ '', CustomValidators.required, ac => this.validatorService.isUnique$('teams', 'title', ac, {}) ],
route: [ '', CustomValidators.required ],
message: '',
linkId: '',
teamType: ''
});
this.getTeams();
}

teamSelect({ mode, teamId, teamType }) {
this.teamForm.controls.route.setValue(this.teamsService.teamLinkRoute(mode, teamId));
teamSelect({ teamId, teamType }) {
this.teamForm.controls.linkId.setValue(teamId);
this.teamForm.controls.teamType.setValue(teamType);
this.linkStepper.selected.completed = true;
Expand Down
Loading