diff --git a/chatapi/README.md b/chatapi/README.md index f0e03039d1..e179b40ee6 100644 --- a/chatapi/README.md +++ b/chatapi/README.md @@ -1,23 +1,12 @@ ## Couchdb Notes -Ensure you have set the following configs in the `configurations` database in couchdb: +Ensure you have set the chatapi configs via the manager -> AI Configurations or in the `configurations` database in couchdb: + +For model choices view: + Openai: https://platform.openai.com/docs/models + Perplexity: https://docs.perplexity.ai/guides/model-cards + Gemini: https://deepmind.google/technologies/gemini/ - ``` - "keys": { - "openai": "sk-mm", - "perplexity": "pplx-21", - "gemini": "AIza" - }, - "models": { - "openai": "gpt-3.5-turbo", - "perplexity": "llama-3-sonar-small-32k-online", - "gemini": "gemini-pro" - }, - "assistant": { - "name": "Planet Context", - "instructions": "You are a brainstorming manager for Open Learning Exchange (OLE) - https://ole.org/, you have specialised knowledge in Planet(web app) and myPlanet(mobile app) applications developed by OLE. You are designed to generate innovative ideas and provide suggestions and help the community members so as to ensure OLE's mission of empowering communities. Emphasize on terms like 'learning,' 'learner,' 'coach,' 'leader,' 'community,' 'power,' 'team,' and 'enterprises,' and avoids overly technical jargon. You are to embody OLE's ethos of self-reliance, mentoring, and community leadership, steering clear of concepts that contradict these values. Communicates in a formal tone, treating users with respect and professionalism, and maintaining a supportive, solution-oriented approach. Ask for clarifications when necessary to ensure contributions are accurate and relevant, and always encourages community-focused, empowering brainstorming." - } - ``` Note: This applies for both production and development environments. @@ -80,7 +69,7 @@ In the production environment these configs are set in the `planet.yml` file. - **context**: string(optional) -> The text context you would like to pre-load the AI Assistant with - **aiProvider**: Object(required) - **name**: string(required) -> Name of the API provider to choose from i.e openai, perplexity or gemini. - - **model**: string(optional) -> Name of the specific provider model to use. Defaults to gpt-3.5-turbo for _openai_, llama-3-sonar-small-32k-online for _peplexity_ and gemini-pro for _google gemini_ + - **model**: string(optional) -> Name of the specific provider model to use. - **_id**: couchdb document id - **_rev**: couchdb revision id The couchdb id and rev are optional fields(only optional when starting a new chat), however to update an existing chat the id and rev (required) be provided. diff --git a/chatapi/src/config/ai-providers.config.ts b/chatapi/src/config/ai-providers.config.ts index 1263236a66..d1c4d3a032 100644 --- a/chatapi/src/config/ai-providers.config.ts +++ b/chatapi/src/config/ai-providers.config.ts @@ -42,9 +42,9 @@ const initialize = async () => { }; models = { - 'openai': { 'ai': keys.openai, 'defaultModel': doc?.models.openai || 'gpt-3.5-turbo' }, - 'perplexity': { 'ai': keys.perplexity, 'defaultModel': doc?.models.perplexity || 'llama-3-sonar-small-32k-online' }, - 'gemini': { 'ai': keys.gemini, 'defaultModel': doc?.models.gemini || 'gemini-pro' }, + 'openai': { 'ai': keys.openai, 'defaultModel': doc?.models.openai || '' }, + 'perplexity': { 'ai': keys.perplexity, 'defaultModel': doc?.models.perplexity || '' }, + 'gemini': { 'ai': keys.gemini, 'defaultModel': doc?.models.gemini || '' }, }; assistant = { diff --git a/chatapi/src/utils/chat-helpers.utils.ts b/chatapi/src/utils/chat-helpers.utils.ts index a146c063af..8f6eb33517 100644 --- a/chatapi/src/utils/chat-helpers.utils.ts +++ b/chatapi/src/utils/chat-helpers.utils.ts @@ -155,7 +155,7 @@ export async function aiChatNonStream( return await retrieveResponse(thread.id); } catch (error) { - return `Error processing request ${error}`; + throw new Error(`Error processing request ${error}`); } } diff --git a/src/app/community/community.component.html b/src/app/community/community.component.html index 4af70052ae..e2ad9dfb2c 100644 --- a/src/app/community/community.component.html +++ b/src/app/community/community.component.html @@ -8,7 +8,12 @@

- + + + + +

No Voices available.

+
@@ -24,17 +29,23 @@

+

No description available.

- - - {{link.title}} - - - + + + + {{link.title}} + + + + + +

No links available.

+
diff --git a/src/app/configuration/configuration.component.ts b/src/app/configuration/configuration.component.ts index 6b244dbab1..fbd11c2e19 100644 --- a/src/app/configuration/configuration.component.ts +++ b/src/app/configuration/configuration.component.ts @@ -236,9 +236,9 @@ export class ConfigurationComponent implements OnInit { gemini: '' }, models: { - openai: 'gpt-3.5-turbo', - perplexity: 'llama-3-sonar-small-32k-online', - gemini: 'gemini-pro' + openai: '', + perplexity: '', + gemini: '' }, assistant: { name: 'Planet Context', diff --git a/src/app/manager-dashboard/manager-aiservices.component.html b/src/app/manager-dashboard/manager-aiservices.component.html index aff16fea67..1e57859be1 100644 --- a/src/app/manager-dashboard/manager-aiservices.component.html +++ b/src/app/manager-dashboard/manager-aiservices.component.html @@ -73,5 +73,7 @@ - +
+ +
diff --git a/src/app/manager-dashboard/manager-aiservices.component.scss b/src/app/manager-dashboard/manager-aiservices.component.scss index 7d82f0d3b9..c231fd3666 100644 --- a/src/app/manager-dashboard/manager-aiservices.component.scss +++ b/src/app/manager-dashboard/manager-aiservices.component.scss @@ -1,3 +1,5 @@ +@import "../variables.scss"; + .container { padding: 20px; display: flex; @@ -15,6 +17,8 @@ display: grid; grid-template-columns: 1.5fr 4fr; width: 100%; + align-items: baseline; + gap: 20px; } .instructions { @@ -24,3 +28,92 @@ line-height: 1.5; } +.update-button-container { + display: flex; + justify-content: center; + width: 100%; + margin-top: 20px; +} + +.update-button-container button { + width: auto; + margin-left: 0; +} + +/* Targeting tablet screens*/ +@media (max-width: $screen-md) { + .container { + padding: 15px; + } + + .card { + width: 100%; + margin: 0; + } + + .list-item-content { + display: flex; + justify-content: space-between; + align-items: baseline; + gap: 10px; + } + + .list-item-content > span { + flex-basis: 30%; + text-align: left; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + line-height: 1.5; + } + + mat-form-field { + flex-basis: 70%; + } + + input { + width: 100%; + } +} + +/* Targeting mobile screens*/ +@media (max-width: $screen-sm) { + .container { + padding: 10px; + } + + .card { + width: 100%; + margin: 0; + } + + .list-item-content { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + gap: 10px; + max-width: 70%; + overflow-x: hidden; + } + + .list-item-content > span { + flex-basis: 35%; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + } + + mat-form-field { + flex-basis: 80%; + min-width: 0; + } + + .update-button-container { + justify-content: flex-start; + } + + .update-button-container button { + width: auto; + } +} diff --git a/src/app/manager-dashboard/reports/reports.component.html b/src/app/manager-dashboard/reports/reports.component.html index 7b0ad12b1b..93c6540548 100644 --- a/src/app/manager-dashboard/reports/reports.component.html +++ b/src/app/manager-dashboard/reports/reports.component.html @@ -7,7 +7,7 @@
- + Summary of Connected Planets Report Detail diff --git a/src/app/manager-dashboard/reports/reports.component.ts b/src/app/manager-dashboard/reports/reports.component.ts index 2a4acaae90..ef076b2de8 100644 --- a/src/app/manager-dashboard/reports/reports.component.ts +++ b/src/app/manager-dashboard/reports/reports.component.ts @@ -15,7 +15,8 @@ import { takeUntil, switchMap } from 'rxjs/operators'; mat-panel-title { align-items: center; } - ` ] + ` ], + styleUrls: ['./reports.components.scss'] }) export class ReportsComponent implements OnInit, OnDestroy { diff --git a/src/app/manager-dashboard/reports/reports.components.scss b/src/app/manager-dashboard/reports/reports.components.scss new file mode 100644 index 0000000000..ed44fb928e --- /dev/null +++ b/src/app/manager-dashboard/reports/reports.components.scss @@ -0,0 +1,15 @@ +@import '../../variables'; + +@media (max-width: $screen-sm) { + .toolbar-responsive { + display: flex; + flex-direction: column; + align-items: flex-start; + width: 100%; + height: auto; + } + + .margin-lr-10 { + margin: 10px 0 + } +} diff --git a/src/app/notifications/notifications.component.html b/src/app/notifications/notifications.component.html index ea8e32ab06..8e7cb1b3f5 100644 --- a/src/app/notifications/notifications.component.html +++ b/src/app/notifications/notifications.component.html @@ -1,7 +1,9 @@
- - Your Notifications - + +
+ Your Notifications + +
diff --git a/src/app/notifications/notifications.component.scss b/src/app/notifications/notifications.component.scss new file mode 100644 index 0000000000..3f5c662ea2 --- /dev/null +++ b/src/app/notifications/notifications.component.scss @@ -0,0 +1,22 @@ +@import '../variables'; + +.responsive-toolbar button { + margin-left: 16px; +} + +@media (max-width: $screen-sm) { + .responsive-toolbar { + display: flex; + flex-direction: column; + align-items: flex-start; + width: 100%; + height: auto; + padding: 16px 16px 0px 16px; + } + + .responsive-toolbar div, + .responsive-toolbar mat-form-field, + .responsive-toolbar button { + margin-bottom: 8px; + } +} \ No newline at end of file diff --git a/src/app/notifications/notifications.component.ts b/src/app/notifications/notifications.component.ts index 9752049244..6b73f2a6cb 100644 --- a/src/app/notifications/notifications.component.ts +++ b/src/app/notifications/notifications.component.ts @@ -12,6 +12,7 @@ import { NotificationsService } from './notifications.service'; @Component({ templateUrl: './notifications.component.html', + styleUrls: ['./notifications.component.scss'] }) export class NotificationsComponent implements OnInit, AfterViewInit { @ViewChild(MatPaginator) paginator: MatPaginator; diff --git a/src/app/surveys/surveys.component.html b/src/app/surveys/surveys.component.html index 052881f48c..37ac02a856 100644 --- a/src/app/surveys/surveys.component.html +++ b/src/app/surveys/surveys.component.html @@ -41,7 +41,7 @@ Survey - {{element.name}} + {{element.name}} Number of Times Taken @@ -61,15 +61,17 @@ Action - - + +
- + diff --git a/src/app/surveys/surveys.component.scss b/src/app/surveys/surveys.component.scss new file mode 100644 index 0000000000..a30cf25d50 --- /dev/null +++ b/src/app/surveys/surveys.component.scss @@ -0,0 +1,59 @@ +@import "../variables.scss"; + +.mat-column-select { + max-width: 44px; +} + +.mat-column-taken, .mat-column-createdDate { + max-width: 150px; +} + +.course-title, .mat-column-name span { + max-width: 250px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + display: block; +} + +.mat-cell button, .mat-cell div button[mat-raised-button] { + width: 150px; + text-align: center; + padding: 8px 12px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +/* Targeting tablet screens */ +@media (max-width: $screen-md) { + + .mat-column-name { + max-width: 125px; + } + + .mat-cell button, .mat-cell div button[mat-raised-button] { + width: 100px; + text-align: center; + padding: 8px 12px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } +} + +/* Targeting mobile screens */ +@media (max-width: $screen-sm) { + + .mat-column-name { + max-width: 80px; + } + + .mat-column-action { + max-width: 125px; + } + + .mat-cell button, .mat-cell div button[mat-raised-button] { + width: 50px; + } +} diff --git a/src/app/surveys/surveys.component.ts b/src/app/surveys/surveys.component.ts index 5b585ac7e9..2f52e9f81f 100644 --- a/src/app/surveys/surveys.component.ts +++ b/src/app/surveys/surveys.component.ts @@ -25,31 +25,8 @@ import { DialogsFormService } from '../shared/dialogs/dialogs-form.service'; import { DialogsAddTableComponent } from '../shared/dialogs/dialogs-add-table.component'; @Component({ - 'templateUrl': './surveys.component.html', - styles: [ ` - /* Column Widths */ - .mat-column-select { - max-width: 44px; - } - .mat-column-taken { - max-width: 150px; - } - .mat-column-createdDate { - max-width: 150px; - } - .btn:disabled{ - pointer-events: none; - } - .course-title { - max-width: 200px; - display: inline-block; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - line-height: 15px; - position: relative; - } - ` ] + templateUrl: './surveys.component.html', + styleUrls: ['./surveys.component.scss'] }) export class SurveysComponent implements OnInit, AfterViewInit, OnDestroy { selection = new SelectionModel(true, []); diff --git a/src/app/teams/teams-reports.component.html b/src/app/teams/teams-reports.component.html index 2a823014c7..4c7b8b9920 100644 --- a/src/app/teams/teams-reports.component.html +++ b/src/app/teams/teams-reports.component.html @@ -2,6 +2,9 @@
+
+

No reports available at the moment.

+
@@ -22,5 +25,3 @@ - - diff --git a/src/app/users/users-achievements/users-achievements.component.html b/src/app/users/users-achievements/users-achievements.component.html index 302c2e603d..8988c3abc6 100644 --- a/src/app/users/users-achievements/users-achievements.component.html +++ b/src/app/users/users-achievements/users-achievements.component.html @@ -5,17 +5,21 @@
- - {{ user.firstName}} {{user.middleName}} {{user.lastName }} - {{ user.name }} + +
+ {{ user.firstName}} {{user.middleName}} {{user.lastName }} + {{ user.name }} +
- - Print Achievements -
- - Add Achievements - Edit Achievements - +
diff --git a/src/app/users/users-achievements/users-achievements.scss b/src/app/users/users-achievements/users-achievements.scss index 53ff2db9fe..814f3ae571 100644 --- a/src/app/users/users-achievements/users-achievements.scss +++ b/src/app/users/users-achievements/users-achievements.scss @@ -1,3 +1,5 @@ +@import '../../variables'; + .achievements-container { max-width: 800px; margin: 0 auto; @@ -56,3 +58,41 @@ text-decoration: underline; } } + +.margin-r-1 { + margin-right: 1rem +} + +@media (max-width: $screen-sm) { + .responsive-toolbar { + display: flex; + flex-direction: column; + align-items: flex-start; + width: 100%; + height: auto; + padding-bottom: 0.5rem; + } + + .auto-adjust-buttons { + display: flex; + gap: 0.2rem; + width: 100%; + } + + .auto-adjust-buttons a { + flex-grow: 1; + text-align: center; + } + + .auto-adjust-buttons span { + font-size: 0.875em; + } + + .margin-r-1 { + margin-right: 0.2rem; + } + + .center-text div { + margin: 0 auto; + } +} \ No newline at end of file