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

feat: fix parser #95

Merged
merged 21 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d26e185
chore: update followup questions preliminary
anfibiacreativa Oct 26, 2023
e9075c6
chore: update styles
anfibiacreativa Oct 26, 2023
4868a48
chore: restyle followup questions
anfibiacreativa Oct 26, 2023
fb45e89
chore: fix parser for follow up questions (before TC)
anfibiacreativa Oct 27, 2023
8b04c0b
chore: fix bug and adapt styles
anfibiacreativa Oct 27, 2023
5a9e5aa
chore: add margin to citations
anfibiacreativa Oct 27, 2023
80436e3
chore: remove commented regex
anfibiacreativa Oct 27, 2023
6449f69
fix: remove unnecessary regex and replace
anfibiacreativa Oct 27, 2023
e0de7af
chore: update global config
anfibiacreativa Oct 27, 2023
1362575
chore: add question icon
anfibiacreativa Oct 27, 2023
8fe2d31
chore: update styles
anfibiacreativa Oct 27, 2023
f79735c
chore: update comments to reflect decisions
anfibiacreativa Oct 27, 2023
65d3533
chore: refine cosmetic styles
anfibiacreativa Oct 30, 2023
bb0baf3
chore: replace icons with iconcloud set
anfibiacreativa Oct 30, 2023
3ea28cd
fix: fix minor bug with index replacement
anfibiacreativa Oct 30, 2023
e7b394e
test: add E2E playwright tests for web app (#89)
shibbas Oct 26, 2023
0ff12b6
docs: update readme with auth info
anfibiacreativa Oct 27, 2023
f7e801f
test: add load tests (#93)
shibbas Oct 27, 2023
f6719f1
test: add playwright test for ask interaction (#94)
shibbas Oct 27, 2023
444eeef
ci: disable playwright for demo
anfibiacreativa Oct 31, 2023
7b1abaf
ci: revert previous commit and disable from UI
anfibiacreativa Oct 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"version": "latest",
"installBicep": true
},
"ghcr.io/azure/azure-dev/azd:latest": {}
"ghcr.io/azure/azure-dev/azd:latest": {},
"ghcr.io/devcontainers-contrib/features/k6:1": {}
},

// Configure tool-specific properties.
Expand All @@ -33,7 +34,8 @@
"esbenp.prettier-vscode",
"humao.rest-client",
"GitHub.copilot",
"runem.lit-plugin"
"runem.lit-plugin",
"ms-playwright.playwright"
]
}
},
Expand All @@ -42,7 +44,7 @@
"forwardPorts": [3000, 3001, 5173],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "npm install",
"postCreateCommand": "./.devcontainer/postCreateCommand.sh",

// Set minimal host requirements for the container.
"hostRequirements": {
Expand Down
7 changes: 7 additions & 0 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

echo "Installing dependencies..."
npm install

echo "Installing playwright browsers..."
npx playwright install --with-deps
27 changes: 27 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Playwright Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npm run install:playwright
- name: Run Playwright tests
run: npm run test:playwright
- uses: actions/upload-artifact@v3
if: failure()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ dist/

# misc
TODO
/test-results/
/playwright-report/
/playwright/.cache/
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,12 @@ To do so, follow these steps:
npm start --workspace=webapp
```

## Enabling Authentication

This sample is composed by two applications: a backend service and API, deployed to [Azure Container Apps](https://learn.microsoft.com/azure/container-apps/overview), and a frontend application, deployed to [Azure Static Web Apps](https://azure.microsoft.com/products/app-service/static/). By default, the deployed Azure Container App will have no authentication or access restrictions enabled, meaning anyone with routable network access to the container app can chat with your indexed data. You can require authentication to your Azure Active Directory by following the [Add container app authentication](https://learn.microsoft.com/azure/container-apps/authentication-azure-active-directory) tutorial and set it up against the deployed Azure Container App.

To limit access to a specific set of users or groups, you can follow the steps from [Restrict your Azure AD app to a set of users](https://learn.microsoft.com/azure/active-directory/develop/howto-restrict-your-app-to-a-set-of-users) by changing "Assignment Required?" option under the Enterprise Application, and then assigning users/groups access. Users not granted explicit access will receive the error message -AADSTS50105: Your administrator has configured the application <app_name> to block users unless they are specifically granted ('assigned') access to the application.-

## Productionizing

This sample is designed to be a starting point for your own production application, but you should do a thorough review of the security and performance before deploying to production. Here are some things to consider:
Expand Down
82 changes: 71 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@
"start:search": "npm run dev --workspace=search",
"start:indexer": "npm run dev --workspace=indexer",
"test": "npm run test -ws --if-present",
"test:playwright": "npx playwright test",
"test:load": "k6 run tests/load/index.js",
"build": "npm run build -ws --if-present",
"clean": "npm run clean -ws --if-present",
"docker:build": "npm run docker:build -ws --if-present",
"format": "prettier --list-different --write .",
"format:check": "prettier --check .",
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"prepare": "simple-git-hooks || echo 'simple-git-hooks install skipped'"
"prepare": "simple-git-hooks || echo 'simple-git-hooks install skipped'",
"install:playwright": "npx playwright install --with-deps"
},
"keywords": [],
"author": "Microsoft",
Expand All @@ -28,7 +31,10 @@
"packages/*"
],
"devDependencies": {
"@playwright/test": "^1.39.0",
"@tapjs/nock": "^3.1.13",
"@types/node": "^18.15.3",
"@types/k6": "^0.47.1",
"concurrently": "^8.2.1",
"eslint-config-shared": "^1.0.0",
"lint-staged": "^14.0.1",
Expand Down
4 changes: 3 additions & 1 deletion packages/chat-component/public/svg/close-icon.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: 3 additions & 1 deletion packages/chat-component/public/svg/copy-icon.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: 3 additions & 1 deletion packages/chat-component/public/svg/delete-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion packages/chat-component/public/svg/doublecheck-icon.svg

This file was deleted.

4 changes: 3 additions & 1 deletion packages/chat-component/public/svg/lightbulb-icon.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 packages/chat-component/public/svg/question-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 2 additions & 15 deletions packages/chat-component/public/svg/readme.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
## Icon sources

All icons in this sample are free and open source

- [Trash Can Icon](https://fontawesome.com/icons/trash?f=classic&s=solid)
- [Send Icon](https://fontawesome.com/icons/paper-plane?f=classic&s=solid)
- [Settings Icon](https://fontawesome.com/icons/cog?f=classic&s=solid)
- [Close Icon](https://fontawesome.com/icons/times-circle?f=classic&s=solid)
- [Info Icon](https://fontawesome.com/icons/info-circle?f=classic&s=solid)
- [Copy Icon](https://fontawesome.com/icons/copy?f=classic&s=solid)
- [Double Check Icon](https://fontawesome.com/icons/check-double?f=classic&s=solid)
- [Email Icon](https://fontawesome.com/icons/envelope-open-text?f=classic&s=solid)
- [Lightbulb Icon](https://fontawesome.com/icons/lightbulb?f=classic&s=solid)

## FontAwesome License

For the full information and license, please visit [Font Awesome License](https://github.com/FortAwesome/Font-Awesome/blob/6.x/LICENSE.txt)
All icons in this sample are part of the
https://iconcloud.design/ icon set.
4 changes: 3 additions & 1 deletion packages/chat-component/public/svg/send-icon.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 packages/chat-component/public/svg/success-icon.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: 3 additions & 1 deletion packages/chat-component/src/config/global-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ const globalConfig = {
// This are the labels for the chat button and input
CHAT_BUTTON_LABEL_TEXT: 'Ask Support',
CHAT_INPUT_PLACEHOLDER: 'Type your question, eg. "How to search and book rentals?"',
USER_IS_BOT: 'Support Bot',
USER_IS_BOT: 'Support Assistant',
RESET_BUTTON_LABEL_TEXT: 'X',
RESET_BUTTON_TITLE_TEXT: 'Reset current question',
RESET_CHAT_BUTTON_TITLE: 'Reset chat',
// Copy response to clipboard
COPY_RESPONSE_BUTTON_LABEL_TEXT: 'Copy Response',
COPIED_SUCCESSFULLY_MESSAGE: 'Response copied!',
// Follow up questions text
FOLLOW_UP_QUESTIONS_LABEL_TEXT: 'You can also ask...',
SHOW_THOUGH_PROCESS_BUTTON_LABEL_TEXT: 'Show thought process',
HIDE_THOUGH_PROCESS_BUTTON_LABEL_TEXT: 'Hide thought process',
LOADING_INDICATOR_TEXT: 'Please wait. We are searching for an answer...',
Expand Down
Loading