Skip to content

Commit b882516

Browse files
authored
Merge branch 'master' into 8937-myachievements-loading-issue
2 parents c605964 + 2778e7c commit b882516

35 files changed

Lines changed: 342 additions & 276 deletions

.github/workflows/planet-db.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Planet DB-Init Builder
22

3-
on:
3+
on:
44
push:
55
branches-ignore:
66
- l10n_i18n
@@ -41,14 +41,11 @@ jobs:
4141
matrix:
4242
include:
4343
- arch: amd64
44-
dockerfile: ./docker/db-init/Dockerfile
45-
build_args: ""
44+
base_image: treehouses/node:3.18
4645
- arch: arm
47-
dockerfile: ./docker/db-init/crosscompile-Dockerfile
48-
build_args: "--build-arg RUNTIME_IMAGE=treehouses/node-tags:arm --build-arg CROSSCOMPILE_ARCH=armv7"
46+
base_image: treehouses/node-tags:arm-3.18
4947
- arch: arm64
50-
dockerfile: ./docker/db-init/crosscompile-Dockerfile
51-
build_args: "--build-arg RUNTIME_IMAGE=treehouses/node-tags:arm64 --build-arg CROSSCOMPILE_ARCH=armv8"
48+
base_image: treehouses/node-tags:arm64-3.18
5249

5350
steps:
5451
- name: Checkout Code
@@ -62,9 +59,11 @@ jobs:
6259
BRANCH="${GITHUB_REF_NAME//\//-}"
6360
repo="$DOCKER_ORG/$DOCKER_REPO_TAG:${{ matrix.arch }}-db-init-$PLANET_VERSION-$BRANCH-${GITHUB_SHA::8}"
6461
branchrepo="$DOCKER_ORG/$DOCKER_REPO_TAG:${{ matrix.arch }}-db-init-$PLANET_VERSION-$BRANCH"
65-
build_args="${{ matrix.build_args }}"
6662
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
67-
docker build -f '${{ matrix.dockerfile }}' $build_args -t $repo .
63+
docker build \
64+
-f './docker/db-init/Dockerfile' \
65+
--build-arg BASE_IMAGE='${{ matrix.base_image }}' \
66+
-t $repo .
6867
docker images
6968
docker tag $repo $branchrepo
7069
docker push $repo

chatapi/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@
4444
},
4545
"devDependencies": {
4646
"@types/node": "^20.3.1",
47-
"@typescript-eslint/eslint-plugin": "^5.60.0",
48-
"@typescript-eslint/parser": "^5.60.0",
49-
"eslint": "^8.43.0",
47+
"@typescript-eslint/eslint-plugin": "~5.60.0",
48+
"@typescript-eslint/parser": "~5.60.0",
49+
"eslint": "~8.43.0",
5050
"nodemon": "^2.0.22"
5151
}
5252
}

couchdb-setup.sh

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@ upsert_doc() {
1818
fi
1919
}
2020

21-
# Function for insert mock data docs
22-
insert_docs() {
23-
DB=$1
24-
DOC_LOC=$2
25-
curl -H 'Content-Type: application/json' -X POST $COUCHURL/$DB/_bulk_docs -d @$DOC_LOC $PROXYHEADER
26-
}
27-
2821
# Function to add databases
2922
insert_dbs() {
3023
DBS=$1
@@ -68,25 +61,6 @@ else
6861
COUCHURL=http://$COUCHUSER:$COUCHPASSWORD@$HOST:$PORT
6962
fi
7063

71-
# Adding attachments to database documents
72-
# To add attachment added two file (resources-mock.json and resources-attachment-mockup.json)
73-
# Ids must match between two files
74-
insert_attachments() {
75-
DB=$1
76-
DOC_LOC=$2
77-
# Use echo $(<$DOC_LOC) to be able to run in Windows
78-
INPUTS=$(echo $(<$DOC_LOC) | jq -c '.[]')
79-
for i in $INPUTS
80-
do
81-
ID=$(echo $i | jq -r '.doc_id' )
82-
FILE_NAME=$(echo $i | jq -r '.file_name')
83-
FILE_LOCATION=$(echo $i | jq -r '.file_location')
84-
FILE_TYPE=$(echo $i | jq -r '.file_type')
85-
REV=$(curl $COUCHURL/$DB/$ID | jq -r '._rev' $PROXYHEADER)
86-
curl -X PUT $COUCHURL/$DB/$ID/$FILE_NAME?rev=$REV --data-binary @$FILE_LOCATION -H Content-Type:$FILE_TYPE $PROXYHEADER
87-
done
88-
}
89-
9064
# Reads one JSON file to update multiple databases
9165
# JSON file needs a 'dbName' field with a string and
9266
# a 'json' field with the JSON to be updated

docker/db-init/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
FROM treehouses/node
1+
ARG BASE_IMAGE=treehouses/node:3.18
2+
3+
FROM ${BASE_IMAGE}
24
LABEL maintainer="dogi@ole.org,mutugiii@ole.org"
35

46
RUN apk update \
57
&& apk add --no-cache bash curl git jq ca-certificates
68

7-
RUN npm config set unsafe-perm true \
8-
&& npm install -g add-cors-to-couchdb \
9-
&& npm config set unsafe-perm false
9+
RUN npm install -g add-cors-to-couchdb
1010

1111
WORKDIR /root
1212

docker/db-init/crosscompile-Dockerfile

Lines changed: 0 additions & 26 deletions
This file was deleted.

docker/db-init/crosscompile_db-init.sh

Lines changed: 0 additions & 34 deletions
This file was deleted.

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"license": "AGPL-3.0",
44
"version": "0.22.76",
55
"myplanet": {
6-
"latest": "v0.53.68",
7-
"min": "v0.51.90"
6+
"latest": "v0.54.91",
7+
"min": "v0.52.45"
88
},
99
"scripts": {
1010
"ng": "ng",
@@ -25,13 +25,13 @@
2525
"private": true,
2626
"dependencies": {
2727
"@angular/animations": "19.2.20",
28-
"@angular/cdk": "^19.2.19",
28+
"@angular/cdk": "19.2.19",
2929
"@angular/common": "19.2.20",
3030
"@angular/compiler": "19.2.20",
3131
"@angular/core": "19.2.20",
3232
"@angular/forms": "19.2.20",
33-
"@angular/localize": "^19.2.20",
34-
"@angular/material": "^19.2.19",
33+
"@angular/localize": "19.2.20",
34+
"@angular/material": "19.2.19",
3535
"@angular/platform-browser": "19.2.20",
3636
"@angular/platform-browser-dynamic": "19.2.20",
3737
"@angular/platform-server": "19.2.20",
@@ -62,13 +62,13 @@
6262
"zone.js": "~0.15.1"
6363
},
6464
"devDependencies": {
65-
"@angular-devkit/build-angular": "^19.2.22",
65+
"@angular-devkit/build-angular": "19.2.22",
6666
"@angular-eslint/builder": "19.8.1",
6767
"@angular-eslint/eslint-plugin": "19.8.1",
6868
"@angular-eslint/eslint-plugin-template": "19.8.1",
6969
"@angular-eslint/schematics": "19.8.1",
7070
"@angular-eslint/template-parser": "19.8.1",
71-
"@angular/cli": "^19.2.22",
71+
"@angular/cli": "19.2.22",
7272
"@angular/compiler-cli": "19.2.20",
7373
"@angular/language-service": "19.2.20",
7474
"@eslint/compat": "^1.4.1",

src/app/chat/chat-window/chat-window.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ export class ChatWindowComponent implements OnInit, OnDestroy, AfterViewInit {
258258

259259
submitPrompt() {
260260
const content = this.promptForm.controls.prompt.value;
261-
this.data = { ...this.data, content, aiProvider: this.provider };
261+
this.data = { ...this.data, content, aiProvider: this.provider, assistant: this.provider?.name === 'openai' };
262262

263263
this.chatService.setChatAIProvider(this.data.aiProvider);
264264
this.setSelectedConversation();

src/app/courses/courses.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
<span i18n>Send Courses</span>
9393
<span *ngIf="selectedLocal > 0"> ({{selectedLocal}})</span>
9494
</button>
95-
<button *ngIf="planetType !== 'community'" mat-menu-item (click)="openSendCourseDialog()" [disabled]="!selection.selected.length">
95+
<button *ngIf="planetType !== 'community'" mat-menu-item (click)="openSendCourseDialog()" [disabled]="!selection.selected.length || dialogGuard.isActive('send-course')">
9696
<mat-icon aria-hidden="true" class="margin-lr-3" >compare_arrows</mat-icon>
9797
<span i18n>Push To {planetType, select, center {Nation} other {Community}}</span>
9898
<span *ngIf="selection?.selected?.length"> ({{selection?.selected?.length}})</span>

src/app/courses/courses.component.ts

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { SelectionModel } from '@angular/cdk/collections';
1010
import { Router, ActivatedRoute, RouterLink } from '@angular/router';
1111
import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
1212
import { Subject, of } from 'rxjs';
13-
import { switchMap, takeUntil } from 'rxjs/operators';
13+
import { map, switchMap, takeUntil } from 'rxjs/operators';
1414
import { FuzzySearchService } from '../shared/fuzzy-search.service';
1515
import {
1616
filterSpecificFields, composeFilterFunctions, createDeleteArray, filterTags,
@@ -29,6 +29,7 @@ import { CoursesService } from './courses.service';
2929
import { dedupeShelfReduce, doesMarkdownPreviewTruncate, findByIdInArray, hasMarkdownImages, itemsShown } from '../shared/utils';
3030
import { StateService } from '../shared/state.service';
3131
import { DialogsLoadingService } from '../shared/dialogs/dialogs-loading.service';
32+
import { DialogGuardService } from '../shared/dialogs/dialog-guard.service';
3233
import { TagsService } from '../shared/forms/tags.service';
3334
import { PlanetTagInputComponent } from '../shared/forms/planet-tag-input.component';
3435
import { SearchService } from '../shared/forms/search.service';
@@ -95,7 +96,7 @@ export class CoursesComponent implements OnInit, OnChanges, AfterViewInit, OnDes
9596
@Input() displayedColumns = [ 'select', 'courseTitle', 'info', 'createdDate', 'rating' ];
9697
@Input() excludeIds = [];
9798
@Input() includeIds: string[] = [];
98-
dialogRef: MatDialogRef<DialogsListComponent>;
99+
dialogRef: MatDialogRef<DialogsListComponent> | null = null;
99100
message = '';
100101
deleteDialog: any;
101102
readonly dbName = 'courses';
@@ -163,6 +164,7 @@ export class CoursesComponent implements OnInit, OnChanges, AfterViewInit, OnDes
163164
private syncService: SyncService,
164165
private stateService: StateService,
165166
private dialogsLoadingService: DialogsLoadingService,
167+
public dialogGuard: DialogGuardService,
166168
private tagsService: TagsService,
167169
private searchService: SearchService,
168170
private deviceInfoService: DeviceInfoService,
@@ -470,17 +472,19 @@ export class CoursesComponent implements OnInit, OnChanges, AfterViewInit, OnDes
470472
}
471473

472474
openSendCourseDialog() {
473-
this.dialogsListService.getListAndColumns('communityregistrationrequests', { 'registrationRequest': 'accepted' }).pipe(
474-
takeUntil(this.onDestroy$)
475-
).subscribe((planet) => {
476-
const data = { okClick: this.sendCourse().bind(this),
477-
filterPredicate: filterSpecificFields([ 'name' ]),
478-
allowMulti: true,
479-
...planet };
480-
this.dialogRef = this.dialog.open(DialogsListComponent, {
481-
data, maxHeight: '500px', width: '600px', autoFocus: false
482-
});
483-
});
475+
this.dialogGuard.open('send-course', () =>
476+
this.dialogsListService.getListAndColumns('communityregistrationrequests', { 'registrationRequest': 'accepted' }).pipe(
477+
map(planet => this.dialog.open(DialogsListComponent, {
478+
data: {
479+
okClick: this.sendCourse().bind(this),
480+
filterPredicate: filterSpecificFields([ 'name' ]),
481+
allowMulti: true,
482+
...planet
483+
},
484+
maxHeight: '500px', width: '600px', autoFocus: false
485+
}))
486+
)
487+
).pipe(takeUntil(this.onDestroy$)).subscribe(ref => this.dialogRef = ref);
484488
}
485489

486490
sendCourse() {

0 commit comments

Comments
 (0)