Skip to content

Commit df4701a

Browse files
committed
Merge branch 'master' into 9162-resources-toggleBoxInconsistency
2 parents 453c5cf + 96a6eb4 commit df4701a

20 files changed

+85
-125
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,6 @@ planet.yml
5757

5858
# Dev environment
5959
environment.dev.ts
60+
61+
# Gemini CLI configuration
62+
gemini-extension.json

chatapi/src/index.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ wss.on('connection', (ws) => {
4848
}));
4949
}
5050
} catch (error: any) {
51-
ws.send(`${error.message}: Cannot connect to the streaming endpoint`);
51+
if (error.message === 'missing' || error.statusCode === 404 || error.error === 'not_found') {
52+
ws.send(JSON.stringify({ 'error': 'Not Found', 'message': 'Conversation not found' }));
53+
} else {
54+
ws.send(JSON.stringify({ 'error': 'Internal Server Error', 'message': error.message }));
55+
}
5256
}
5357
});
5458

@@ -66,7 +70,7 @@ app.post('/', async (req: any, res: any) => {
6670

6771
try {
6872
if (!save) {
69-
const response = await chatNoSave(data.content, data.aiProvider, data.context, data.assistant, false);
73+
const response = await chatNoSave(data.content, data.aiProvider, data.assistant, data.context);
7074
return res.status(200).json({
7175
'status': 'Success',
7276
'chat': response
@@ -80,6 +84,9 @@ app.post('/', async (req: any, res: any) => {
8084
});
8185
}
8286
} catch (error: any) {
87+
if (error.message === 'missing' || error.statusCode === 404 || error.error === 'not_found') {
88+
return res.status(404).json({ 'error': 'Not Found', 'message': 'Conversation not found' });
89+
}
8390
return res.status(500).json({ 'error': 'Internal Server Error', 'message': error.message });
8491
}
8592
});

chatapi/src/services/chat.service.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,14 @@ export async function chatNoSave(
6969
content: any,
7070
aiProvider: AIProvider,
7171
assistant: boolean,
72-
context?: any,
73-
stream?: boolean,
74-
callback?: (response: string) => void
72+
context?: any
7573
): Promise<string | undefined> {
7674
const messages: ChatMessage[] = [];
7775

7876
messages.push({ 'role': 'user', content });
7977

8078
try {
81-
const completionText = await aiChat(messages, aiProvider, assistant, context, stream, callback);
82-
messages.push({
83-
'role': 'assistant', 'content': completionText
84-
});
85-
79+
const completionText = await aiChat(messages, aiProvider, assistant, context);
8680
return completionText;
8781
} catch (error: any) {
8882
handleChatError(error);

chatapi/src/utils/db.utils.ts

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,14 @@ import { ChatMessage } from '../models/chat.model';
88
* @returns Array of chat conversations
99
*/
1010
async function getChatDocument(id: string) {
11-
try {
12-
const res = await chatDB.get(id) as DbDoc;
13-
return {
14-
'conversations': res.conversations,
15-
'title': res.title,
16-
'createdDate': res.createdDate,
17-
'aiProvider': res.aiProvider
18-
};
19-
// Should return user, team data as well particularly for the "/conversations" endpoint
20-
} catch (error) {
21-
return {
22-
'conversations': [],
23-
'title': ''
24-
};
25-
}
11+
const res = await chatDB.get(id) as DbDoc;
12+
return {
13+
'conversations': res.conversations,
14+
'title': res.title,
15+
'createdDate': res.createdDate,
16+
'aiProvider': res.aiProvider
17+
};
18+
// Should return user, team data as well particularly for the "/conversations" endpoint
2619
}
2720

2821
export async function retrieveChatHistory(dbData: any, messages: ChatMessage[]) {

docker/planet/scripts/crosscompile_planet.sh

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

docker/planet/scripts/docker-entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ envsubst '$DEFAULT_LANGUAGE' < /etc/nginx/templates/default.conf.template > /etc
4040

4141
spawn-fcgi -s /run/fcgi.sock -U nginx -G nginx /usr/bin/fcgiwrap
4242

43-
nginx -g "daemon off;"
44-
4543
mkdir -p /usr/share/nginx/html/fs
44+
45+
nginx -g "daemon off;"

git-hooks/pre-push

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,6 @@
33
# An example hook script to verify what is about to be pushed. Called by "git
44
# push" after it has checked the remote status, but before anything has been
55
# pushed. If this script exits with a non-zero status nothing will be pushed.
6-
#
7-
# This hook is called with the following parameters:
8-
#
9-
# $1 -- Name of the remote to which the push is being done
10-
# $2 -- URL to which the push is being done
11-
#
12-
# If pushing without using a named remote those arguments will be equal.
13-
#
14-
# Information about the commits which are being pushed is supplied as lines to
15-
# the standard input in the form:
16-
#
17-
# <local ref> <local sha1> <remote ref> <remote sha1>
18-
#
19-
# This sample shows how to prevent push of commits where the log message starts
20-
# with "WIP" (work in progress).
21-
22-
remote="$1"
23-
url="$2"
246

257
pass=true
268
RED='\033[1;31m'

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "planet",
33
"license": "AGPL-3.0",
4-
"version": "0.20.64",
4+
"version": "0.20.75",
55
"myplanet": {
6-
"latest": "v0.36.37",
7-
"min": "v0.35.37"
6+
"latest": "v0.37.2",
7+
"min": "v0.30.2"
88
},
99
"scripts": {
1010
"ng": "ng",

src/app/courses/courses.component.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { CouchService } from '../shared/couchdb.service';
2525
import { PlanetMessageService } from '../shared/planet-message.service';
2626
import { DialogsPromptComponent } from '../shared/dialogs/dialogs-prompt.component';
2727
import { CoursesService } from './courses.service';
28-
import { dedupeShelfReduce, findByIdInArray, calculateMdAdjustedLimit } from '../shared/utils';
28+
import { dedupeShelfReduce, findByIdInArray, calculateMdAdjustedLimit, itemsShown } from '../shared/utils';
2929
import { StateService } from '../shared/state.service';
3030
import { DialogsLoadingService } from '../shared/dialogs/dialogs-loading.service';
3131
import { TagsService } from '../shared/forms/tags.service';
@@ -307,8 +307,7 @@ export class CoursesComponent implements OnInit, OnChanges, AfterViewInit, OnDes
307307

308308
/** Whether the number of selected elements matches the total number of rows. */
309309
isAllSelected() {
310-
const itemsShown = Math.min(this.paginator.length - (this.paginator.pageIndex * this.paginator.pageSize), this.paginator.pageSize);
311-
return this.selection.selected.length === itemsShown;
310+
return this.selection.selected.length === itemsShown(this.paginator);
312311
}
313312

314313
/** Selects all rows if they are not all selected; otherwise clear selection. */

src/app/manager-dashboard/manager-dashboard.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ <h3 i18n *ngIf="showParentList">{{ planetType === 'community' ? 'Nation' : 'Cent
7777
</ng-container>
7878
</div>
7979
<div *ngIf="pin"><span i18n>myPlanet Server pin:</span> <b class="pinClass">{{ ' ' + pin + ' ' }}</b>
80-
<button mat-raised-button i18n (click)="resetPin()">Reset Pin</button>
80+
<button mat-raised-button i18n (click)="confirmResetPin()">Reset Pin</button>
8181
</div>
8282
</ng-container>
8383
<div>

0 commit comments

Comments
 (0)