-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #154 from weni-ai/feature/ai-and-reviews
[ENGAGE-1649] Feature/ai and reviews
- Loading branch information
Showing
25 changed files
with
2,281 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
VITE_GPT_URL="" | ||
VITE_GPT_AUTH="" | ||
VITE_FIREBASE_CONFIG="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
#!/bin/sh | ||
|
||
ESCAPED_FIREBASE_CONFIG=$(echo "${VITE_FIREBASE_CONFIG}" | sed 's/\//\\\//g') | ||
|
||
export JSON_STRING='window.configs = { \ | ||
"VITE_GPT_URL":"'${VITE_GPT_URL}'", \ | ||
"VITE_GPT_AUTH":"'${VITE_GPT_AUTH}'", \ | ||
"VITE_INSIGHTS_API_URL":"'${VITE_INSIGHTS_API_URL}'", \ | ||
"VITE_HOTJAR_ID":"'${VITE_HOTJAR_ID}'", \ | ||
"VITE_INSIGHTS_API_URL": "'${VITE_INSIGHTS_API_URL}'", \ | ||
"VITE_FIREBASE_CONFIG": '${ESCAPED_FIREBASE_CONFIG}', \ | ||
"VITE_HOTJAR_ID": "'${VITE_HOTJAR_ID}'" \ | ||
}' | ||
|
||
sed "s|//CONFIGURATIONS_PLACEHOLDER|${JSON_STRING}|" /usr/share/nginx/html/insights/index.html.tmpl > /tmp/index.html | ||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<template> | ||
Check warning on line 1 in src/components/Markdown.vue GitHub Actions / lint-test-build
|
||
<section | ||
class="content-section" | ||
v-html="html" | ||
Check warning on line 4 in src/components/Markdown.vue GitHub Actions / lint-test-build
|
||
/> | ||
</template> | ||
|
||
<script> | ||
import DOMPurify from 'dompurify'; | ||
import { marked } from 'marked'; | ||
export default { | ||
props: { | ||
content: { | ||
type: String, | ||
default: '', | ||
}, | ||
}, | ||
computed: { | ||
html() { | ||
return DOMPurify.sanitize(marked.parse(this.content)); | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
.content-section { | ||
white-space: pre-wrap; | ||
word-wrap: break-word; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
src/components/insights/Layout/HeaderGenerateInsights/HeaderGenerateInsightButton.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<template> | ||
<button | ||
class="header-generate-insight-button" | ||
:disabled="isDisableBtn" | ||
@click="openModal" | ||
> | ||
<img src="@/assets/images/shine.svg" /> | ||
{{ $t('insights_header.generate_insight.title') }} | ||
|
||
<HeaderGenerateInsightModal | ||
:show="isGenerateInsightModalOpen" | ||
@close="closeModal" | ||
/> | ||
</button> | ||
</template> | ||
|
||
<script> | ||
import { mapState } from 'vuex'; | ||
import HeaderGenerateInsightModal from './HeaderGenerateInsightModal.vue'; | ||
export default { | ||
name: 'HeaderGenerateInsightButton', | ||
components: { | ||
HeaderGenerateInsightModal, | ||
}, | ||
data() { | ||
return { | ||
isGenerateInsightModalOpen: false, | ||
}; | ||
}, | ||
computed: { | ||
...mapState({ | ||
token: (state) => state.config.token, | ||
}), | ||
isDisableBtn() { | ||
return this.$store.state.widgets.isLoadingCurrentDashboardWidgets; | ||
}, | ||
}, | ||
methods: { | ||
openModal() { | ||
this.isGenerateInsightModalOpen = true; | ||
}, | ||
closeModal() { | ||
this.isGenerateInsightModalOpen = false; | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
.header-generate-insight-button { | ||
position: relative; | ||
border: none; | ||
display: flex; | ||
gap: $unnnic-spacing-nano; | ||
justify-content: center; | ||
align-items: center; | ||
padding: $unnnic-spacing-ant $unnnic-spacing-sm; | ||
border-radius: $unnnic-border-radius-sm; | ||
background: $unnnic-color-neutral-darkest; | ||
color: $unnnic-color-weni-300; | ||
font-family: $unnnic-font-family-secondary; | ||
font-size: $unnnic-font-size-body-gt; | ||
cursor: pointer; | ||
} | ||
</style> |
Oops, something went wrong.