Skip to content

Commit

Permalink
Fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Shakira authored and Shakira committed Apr 26, 2024
2 parents 5afcd91 + e49b008 commit cb5843a
Show file tree
Hide file tree
Showing 32 changed files with 1,599 additions and 440 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-and-ship.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ jobs:
run: |
set -ex;
SNAPSHOT_URL="https://ushahidi-static-web-assets.s3.eu-west-1.amazonaws.com/ushahidi-e2e-data-2023.07.05.sql.gz"
SNAPSHOT_URL="https://ushahidi-static-web-assets.s3.eu-west-1.amazonaws.com/ushahidi-e2e-data.sql.gz"
wget -O sql-snapshot.sql.gz ${SNAPSHOT_URL} 2>/dev/null || { echo "Failed downloading snapshot!" && exit 1; }
tmp_defaults=`mktemp`
Expand Down
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
node_modules
documentation
e2e

package-lock.json

Expand Down
10 changes: 7 additions & 3 deletions apps/mobile-mzima-client/src/app/auth/signup/signup.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@
<div class="agreement">
<app-checkbox formControlName="agreement">
I agree to Ushahidi
<a (click)="openLink($event, 'Privacy Policy')">Privacy Policy</a>
the <br />
<a (click)="openLink($event, 'Privacy Policy')">Terms and Conditions</a>.
<a (click)="openLink($event, 'https://www.ushahidi.com/privacy-policy')"
>Privacy Policy</a
>
and <br />
<a (click)="openLink($event, 'https://www.ushahidi.com/terms-of-service')"
>Terms and Conditions</a
>.
</app-checkbox>
</div>
<ion-text *ngIf="signupError?.length" class="form-error ion-text-center" color="danger">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class SignupPage {
public openLink(event: Event, link: string): void {
event.preventDefault();
event.stopPropagation();
console.log('open: ', link);
window.open(link);
}

public chooseDeployment(): void {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';
import { Router } from '@angular/router';
import { Platform } from '@ionic/angular';
import { App } from '@capacitor/app';
import { MainLayoutComponent } from '../main-layout/main-layout.component';
import { Deployment } from '@mzima-client/sdk';
import { Subject, debounceTime } from 'rxjs';
import {
AlertService,
AuthService,
ConfigService,
DeploymentService,
EnvService,
// IntercomService,
} from '@services';
import { AlertService, AuthService, ConfigService, DeploymentService, EnvService } from '@services';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { ToastService } from '@services';

Expand Down Expand Up @@ -40,11 +34,12 @@ export class ChooseDeploymentComponent {
tap = 0;

constructor(
private router: Router,
private envService: EnvService,
private configService: ConfigService,
private deploymentService: DeploymentService,
private alertService: AlertService,
private authService: AuthService, // private intercomService: IntercomService,
private authService: AuthService,
protected toastService: ToastService,
protected platform: Platform,
) {
Expand Down Expand Up @@ -119,9 +114,19 @@ export class ChooseDeploymentComponent {
}

public removeDeployment(deploymentId: number) {
const index = this.deploymentList.findIndex((i: any) => i.id === deploymentId);
if (index !== -1) this.deploymentList.splice(index, 1);
this.deploymentList = this.deploymentList.filter(
(deployment) => deployment.id !== deploymentId,
);
this.deploymentService.setDeployments(this.deploymentList);
if (this.deploymentList.length === 0) {
this.currentDeploymentId = undefined;
this.authService.logout();
this.deploymentService.setDeployment(null);
if (this.isProfile) this.router.navigate(['deployment']);
} else if (this.currentDeploymentId === deploymentId) {
this.currentDeploymentId = this.deploymentList[0].id;
this.chooseDeployment(this.deploymentList[0]);
}
}

public async chooseDeployment(deployment: Deployment) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@
}
}

::ng-deep label.textarea-wrapper {
.label-text-wrapper {
.label-text {
white-space: normal;
}
}
}

.form-control {
--background: transparent;
--border-radius: 4px 4px 0 0;
Expand Down
3 changes: 2 additions & 1 deletion apps/web-mzima-client/src/app/feed/feed.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,11 +488,12 @@ export class FeedComponent extends MainViewComponent implements OnInit {
}
this.selectedPosts = [];
if (count) {
const postWord = count === 1 ? 'post' : 'posts';
this.confirmModalService.open({
title: this.translate.instant('notify.confirm_modal.deleted.success'),
description: `<p>${this.translate.instant(
'notify.confirm_modal.deleted.success_description',
{ count },
{ count: `${count} ${postWord}` },
)}</p>`,
buttonSuccess: this.translate.instant('notify.confirm_modal.deleted.success_button'),
});
Expand Down
1 change: 1 addition & 0 deletions apps/web-mzima-client/src/app/map/map.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export class MapComponent extends MainViewComponent implements OnInit {

private reInitParams() {
this.params.page = 1;
this.params.limit = 500;
this.params.currentView = 'map';
this.mapLayers.map((layer) => {
this.map.removeLayer(layer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export class PostHeadComponent extends BaseComponent {
title: this.translate.instant('notify.confirm_modal.deleted.success'),
description: `<p>${this.translate.instant(
'notify.confirm_modal.deleted.success_description',
{ count: 1 },
{ count: '1 post' },
)}</p>`,
buttonSuccess: this.translate.instant('notify.confirm_modal.deleted.success_button'),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
/>
</div>
<div class="post-info__content">
<span *ngIf="author" class="post-info__username">
<span *ngIf="author" class="post-info__username" [data-qa]="'author'">
{{ author }}
</span>

<div class="post-info__list">
<span class="post-info__item">
<span class="post-info__item" [data-qa]="'post-date'">
{{ post.post_date | dateAgo }}
</span>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,58 +135,66 @@ <h2>{{ 'survey.choose_survey_field' | translate }}</h2>
<br />

<div *ngFor="let control of provider?.options" [data-qa]="'provider-options'">
<ng-container *ngIf="control.input === 'read-only-text'">
<h2 *ngIf="control.label?.length">{{ control.label }}</h2>
<p *ngIf="control.description?.length" [innerHTML]="control.description"></p>
</ng-container>

<ng-container *ngIf="control.input !== 'read-only-text'">
<div class="form-row">
<mat-label>
{{ control.label }}
<span class="color-accent" *ngIf="control.rules?.indexOf('required') > -1">*</span>
</mat-label>
<mat-form-field
*ngIf="control.input === 'text'"
appearance="outline"
[data-qa]="'control-type-text'"
>
<input
matInput
[placeholder]="control.description"
[formControlName]="control.id"
[type]="control.input"
[data-qa]="'control-text' + control.id"
/>
<mat-hint
*ngIf="control.description?.length"
[innerHTML]="control.description"
></mat-hint>
<mat-error
*ngIf="
(form.get(control.id)?.touched || form.get(control.id)?.dirty) &&
form.get(control.id)?.hasError('required')
"
<ng-container [ngSwitch]="control.input">
<ng-container *ngSwitchCase="'read-only-text'">
<h2 *ngIf="control.label?.length">{{ control.label }}</h2>
<p *ngIf="control.description?.length" [innerHTML]="control.description"></p>
</ng-container>
<ng-container *ngSwitchCase="'hidden'">
<input
[formControlName]="control.id"
type="hidden"
[data-qa]="'control-text' + control.id"
/>
</ng-container>
<ng-container *ngSwitchDefault>
<div class="form-row">
<mat-label>
{{ control.label }}
<span class="color-accent" *ngIf="control.rules?.indexOf('required') > -1">*</span>
</mat-label>
<mat-form-field
*ngIf="control.input === 'text'"
appearance="outline"
[data-qa]="'control-type-text'"
>
{{ 'form.field_required' | translate }}
</mat-error>
</mat-form-field>
<input
matInput
[placeholder]="control.description"
[formControlName]="control.id"
[type]="control.input"
[data-qa]="'control-text' + control.id"
/>
<mat-hint
*ngIf="control.description?.length"
[innerHTML]="control.description"
></mat-hint>
<mat-error
*ngIf="
(form.get(control.id)?.touched || form.get(control.id)?.dirty) &&
form.get(control.id)?.hasError('required')
"
>
{{ 'form.field_required' | translate }}
</mat-error>
</mat-form-field>

<mat-radio-group
*ngIf="control.input === 'radio'"
aria-label="Select an option"
[formControlName]="control.id"
[data-qa]="'control-type-radio'"
>
<mat-radio-button
*ngFor="let item of control.options"
[value]="item"
[data-qa]="'control-text' + item"
<mat-radio-group
*ngIf="control.input === 'radio'"
aria-label="Select an option"
[formControlName]="control.id"
[data-qa]="'control-type-radio'"
>
{{ item }}
</mat-radio-button>
</mat-radio-group>
</div>
<mat-radio-button
*ngFor="let item of control.options"
[value]="item"
[data-qa]="'control-text' + item"
>
{{ item }}
</mat-radio-button>
</mat-radio-group>
</div>
</ng-container>
</ng-container>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,23 +214,35 @@ <h2>
<ng-container *ngIf="survey">
<div class="form-row">
<div class="toggle">
<mat-slide-toggle [(ngModel)]="survey.require_approval" name="accept-survey">
<mat-slide-toggle
[data-qa]="'toggle-posts-require-review'"
[(ngModel)]="survey.require_approval"
name="accept-survey"
>
{{ 'survey.require_review' | translate }}
</mat-slide-toggle>
<p *ngIf="survey.require_approval" class="toggle__description">
{{ 'survey.require_review_desc' | translate }}
</p>
</div>
<div class="toggle">
<mat-slide-toggle [(ngModel)]="survey.hide_author" name="import-to-survey">
<mat-slide-toggle
[data-qa]="'toggle-hide-author'"
[(ngModel)]="survey.hide_author"
name="import-to-survey"
>
{{ 'survey.hide_author_information' | translate }}
</mat-slide-toggle>
<p *ngIf="survey.hide_author" class="toggle__description">
{{ 'survey.hide_author_information_desc' | translate }}
</p>
</div>
<div class="toggle" *ngIf="anonymiseReportersEnabled">
<mat-slide-toggle [(ngModel)]="survey.hide_location" name="import-to-survey">
<mat-slide-toggle
[data-qa]="'toggle-hide-location'"
[(ngModel)]="survey.hide_location"
name="import-to-survey"
>
{{ 'survey.hide_location_information' | translate }}
</mat-slide-toggle>
<p
Expand All @@ -241,7 +253,11 @@ <h2>
></p>
</div>
<div class="toggle" *ngIf="anonymiseReportersEnabled">
<mat-slide-toggle [(ngModel)]="survey.hide_time" name="import-to-survey">
<mat-slide-toggle
[data-qa]="'toggle-hide-time'"
[(ngModel)]="survey.hide_time"
name="import-to-survey"
>
{{ 'survey.hide_time_information' | translate }}
</mat-slide-toggle>
<p *ngIf="survey.hide_time" class="toggle__description">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export class CollectionsComponent extends BaseComponent implements OnInit {
visible_to: [
{
value: 'everyone',
options: ['everyone'],
options: [],
disabled: false,
},
],
Expand Down Expand Up @@ -167,7 +167,7 @@ export class CollectionsComponent extends BaseComponent implements OnInit {

function checkReadPrivilege() {
// If the collection's role allows everyone to view or the specific role of the current user to view it.
if (item.role?.includes('everyone') || item.role?.includes(userRole)) {
if (item.role?.includes('everyone') || item.role?.includes(userRole) || !item.role) {
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
margin-bottom: 16px;
color: var(--color-dark);

@include breakpoint-min($tablet) {
padding-right: 48px;
}

@include breakpoint-max($tablet) {
font-size: 20px;
line-height: 1.28;
Expand Down
Loading

0 comments on commit cb5843a

Please sign in to comment.