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

Syncing with opensource stable #171

Draft
wants to merge 13 commits into
base: develop
Choose a base branch
from
Draft
4 changes: 2 additions & 2 deletions .firebaserc
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"default": "kai-ai-f63c8"
},
"targets": {
"kai-ai-f63c8": {
"kai-ai-b8ac9": {
"hosting": {
"next": [
"kai-ai-f63c8"
"kai-ai-b8ac9"
]
}
}
Expand Down
141 changes: 6 additions & 135 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,144 +6,15 @@ on:
push:
branches:
- main
- develop
jobs:
build_and_deploy_sandbox:
name: "Deploy to Marvel Develop"
if: ${{ github.ref == 'refs/heads/develop' }}
build_and_deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "18.17.0"

- name: Install Firebase CLI
run: |
npm install -g firebase-tools

- name: Install Functions Dependencies
run: |
cd functions
npm install

- name: Decode Base64 Env Vars for Develop
if: github.ref == 'refs/heads/develop'
run: |
cd functions
echo "${{ secrets.SANDBOX_ENV_FILE_BASE64 }}" | base64 --decode > .env

- name: Deploy Functions to Develop
if: github.ref == 'refs/heads/develop'
run: |
set -o allexport
source functions/.env
set +o allexport
firebase deploy --only functions --force --token ${{ secrets.FIREBASE_TOKEN }} --project kai-platform-sandbox

- name: Decode and create .env file from secret
run: |
echo "${{ secrets.SANDBOX_ENV_FILE_BASE64 }}" | base64 --decode > .env

- name: Set environment variables
run: |
set -a
source .env
set +a

- name: Install Next.js globally
run: npm install -g next

- name: Build Next.js
run: npm run build:next

- name: Set Channel ID
id: set_channel_id
run: |
if [ "${{ github.event_name }}" = "push" ]; then
echo "channel_id=live" >> $GITHUB_ENV
else
echo "channel_id=pr-${{ github.event.pull_request.number }}" >> $GITHUB_ENV
fi

- name: Deploy to Firebase
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GIT_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_SANDBOX }}
projectId: kai-platform-sandbox
channelId: ${{ env.channel_id }}

build_and_deploy_production:
name: "Deploy to Marvel Production"
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "18.17.0"

- name: Install Firebase CLI
run: |
npm install -g firebase-tools

- name: Install Functions Dependencies
run: |
cd functions
npm install

- name: Decode Base64 Env Vars for Specific Branches
if: github.ref == 'refs/heads/main'
run: |
cd functions
echo "${{ secrets.PROD_ENV_FILE_BASE64 }}" | base64 --decode > .env

- name: Deploy Functions to Production
if: github.ref == 'refs/heads/main'
run: |
set -o allexport
source functions/.env
set +o allexport
firebase deploy --only functions --force --token ${{ secrets.FIREBASE_TOKEN }} --project kai-ai-f63c8

- name: Decode and create .env file from secret
run: |
echo "${{ secrets.PROD_ENV_FILE_BASE64 }}" | base64 --decode > .env

- name: Set environment variables
run: |
set -a
source .env
set +a

- name: Install Next.js globally
run: npm install -g next

- name: Build Next.js
run: npm run build:next

- name: Set Channel ID
id: set_channel_id
run: |
if [ "${{ github.event_name }}" = "push" ]; then
echo "channel_id=live" >> $GITHUB_ENV
else
echo "channel_id=pr-${{ github.event.pull_request.number }}" >> $GITHUB_ENV
fi

- name: Deploy to Firebase
uses: FirebaseExtended/action-hosting-deploy@v0
- uses: actions/checkout@v4
- run: next build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GIT_TOKEN }}
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_KAI_AI_F63C8 }}
channelId: live
projectId: kai-ai-f63c8
channelId: ${{ env.channel_id }}
21 changes: 21 additions & 0 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on PR
on: pull_request
permissions:
checks: write
contents: read
pull-requests: write
jobs:
build_and_preview:
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: next build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_KAI_AI_F63C8 }}
projectId: kai-ai-f63c8
7 changes: 4 additions & 3 deletions firestore.rules
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId} {
allow read: if true; // Allow all read operations
allow write: if request.auth.uid != null; // Allow write if user is authenticated
allow write: if request.auth.uid != null
&& request.auth.uid == userId // Ensure the user is the owner
}

match /chatSessions/{sessionId} {
allow read, write: if true; // Example rule allowing all read and write operations
// Adjust read and write rules as per your application's needs
allow read, write: if request.auth != null && resource.data.user.id == request.auth.uid;
allow write: if request.auth.uid != null; // Allow write if user is authenticated
}

match /tools/{toolId} {
Expand Down
6 changes: 6 additions & 0 deletions frontend/assets/svg/ChatBubbleV2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions frontend/assets/svg/ChatHistoryButtonIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions frontend/assets/svg/ChatIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions frontend/assets/svg/ChatIconFill.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions frontend/assets/svg/CircleCheckFilled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions frontend/assets/svg/DefaultPromptStar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions frontend/assets/svg/DiscoveryIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions frontend/assets/svg/HomeIconOutline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions frontend/assets/svg/HomeMenuIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions frontend/assets/svg/KAIAvatar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions frontend/assets/svg/LogoutIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions frontend/assets/svg/PurpleStar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions frontend/assets/urls.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ const ImageURLs = {
'https://firebasestorage.googleapis.com/v0/b/kai-ai-f63c8.appspot.com/o/Purple_Blob_1.png?alt=media&token=e5bce404-78d0-4d9c-9e45-b63bddd936da',
MarvelCircleAvatar:
'https://firebasestorage.googleapis.com/v0/b/kai-ai-f63c8.appspot.com/o/KaiProfilePic.png?alt=media&token=4cfcd644-8d86-4944-82a7-cf83b4519311',
WelcomeBannerImg:
'https://firebasestorage.googleapis.com/v0/b/ui-revamp.appspot.com/o/WelcomeBannerImg.png?alt=media&token=5e3c0e0b-df1f-4264-b616-ba94ebf5cd3c',
CapsulesImg:
'https://firebasestorage.googleapis.com/v0/b/ui-revamp.appspot.com/o/CapsulesImg.png?alt=media&token=ee0cd085-d0d3-4ba9-99b8-59baaa98293e',
GridBg:
'https://firebasestorage.googleapis.com/v0/b/ui-revamp.appspot.com/o/Grid.png?alt=media&token=de10731c-18a1-43cf-9bd9-3adee27f35cf',
};

export default ImageURLs;
12 changes: 9 additions & 3 deletions frontend/components/AccordionInputGroupItem/styles.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
const styles = {
accordianProps: {
sx: {
background: (theme) => theme.palette.Common.White['100p'],
borderRadius: '10px !important',
width: '100%',
border: '2px solid #9D74FF',
borderRadius: '20px !important',
background: '#0F0E14',
},
},
accordionDetailsProps: (extraAccordionDetailsProps) => ({
sx: {
...extraAccordionDetailsProps,
px: '28px',
},
}),
accordionSummaryProps: {
Expand All @@ -30,6 +32,10 @@ const styles = {
justifyContent: 'center',
alignItems: 'center',
mobileSmall: 12,
sx: {
color: 'white',
fontSize: '22px',
},
},
outlinedButtonProps: {
color: 'purple',
Expand All @@ -48,7 +54,7 @@ const styles = {
descriptionGridProps: {
sx: {
fontFamily: 'Satoshi Bold',
fontSize: { laptop: '14px', desktop: '15px', desktopMedium: '16px' },
fontSize: { laptop: '14px', desktop: '15px', desktopMedium: '16.13px' },
color: (theme) => theme.palette.Greyscale[450],
textAlign: 'center',
},
Expand Down
Loading
Loading