Skip to content

Commit

Permalink
Merge pull request #401 from weni-ai/vue3/final
Browse files Browse the repository at this point in the history
[FLOWS_1495] - Pull from staging.
  • Loading branch information
acnormun authored May 7, 2024
2 parents bd0aad2 + 4479dbe commit 08d19ba
Show file tree
Hide file tree
Showing 20 changed files with 1,040 additions and 595 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/test-and-build-18.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,5 @@ jobs:
yarn install
- name: Run lint
run: yarn lint
- name: Run tests
run: yarn test:unit
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
- name: Build application
run: yarn build
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.14.0-alpine3.1 as builder
FROM node:18.14.0-alpine3.17 as builder

WORKDIR /app

Expand Down
20 changes: 10 additions & 10 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/bin/sh
export JSON_STRING='window.configs = { \
"VUE_APP_API_BASE_URL":"'${VUE_APP_API_BASE_URL}'", \
"VUE_APP_USE_SENTRY":"'${VUE_APP_USE_SENTRY}'", \
"VUE_APP_SENTRY_DSN":"'${VUE_APP_SENTRY_DSN}'", \
"VUE_APP_FACEBOOK_APP_ID":"'${VUE_APP_FACEBOOK_APP_ID}'", \
"VUE_APP_WHATSAPP_FACEBOOK_APP_ID":"'${VUE_APP_WHATSAPP_FACEBOOK_APP_ID}'", \
"VUE_APP_WHATSAPP_FACEBOOK_APP_CONFIG_ID":"'${VUE_APP_WHATSAPP_FACEBOOK_APP_CONFIG_ID}'", \
"VUE_APP_LOGROCKET_ID":"'${VUE_APP_LOGROCKET_ID}'", \
"VUE_APP_PARENT_IFRAME_DOMAIN":"'${VUE_APP_PARENT_IFRAME_DOMAIN}'", \
"VUE_APP_HELPHERO_ID":"'${VUE_APP_HELPHERO_ID}'", \
"VUE_APP_FLOWS_IFRAME_URL":"'${VUE_APP_FLOWS_IFRAME_URL}'", \
"VITE_APP_API_BASE_URL":"'${VITE_APP_API_BASE_URL}'", \
"VITE_APP_USE_SENTRY":"'${VITE_APP_USE_SENTRY}'", \
"VITE_APP_SENTRY_DSN":"'${VITE_APP_SENTRY_DSN}'", \
"VITE_APP_FACEBOOK_APP_ID":"'${VITE_APP_FACEBOOK_APP_ID}'", \
"VITE_APP_WHATSAPP_FACEBOOK_APP_ID":"'${VITE_APP_WHATSAPP_FACEBOOK_APP_ID}'", \
"VITE_APP_WHATSAPP_FACEBOOK_APP_CONFIG_ID":"'${VITE_APP_WHATSAPP_FACEBOOK_APP_CONFIG_ID}'", \
"VITE_APP_LOGROCKET_ID":"'${VITE_APP_LOGROCKET_ID}'", \
"VITE_APP_PARENT_IFRAME_DOMAIN":"'${VITE_APP_PARENT_IFRAME_DOMAIN}'", \
"VITE_APP_HELPHERO_ID":"'${VITE_APP_HELPHERO_ID}'", \
"VITE_APP_FLOWS_IFRAME_URL":"'${VITE_APP_FLOWS_IFRAME_URL}'", \
}'
sed "s|//CONFIGURATIONS_PLACEHOLDER|${JSON_STRING}|" /usr/share/nginx/html/integrations/index.html.tmpl > /tmp/index.html

Expand Down
28 changes: 17 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Integrations</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>

<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Integrations</title>
<script>
//CONFIGURATIONS_PLACEHOLDER
</script>
</head>

<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>

</html>
4 changes: 2 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
this.retriveSelectedOrg();
this.retriveSelectedProject();
this.retriveSelectedFlowOrg();
if (getEnv('VUE_APP_HELPHERO_ID')) {
const hlp = initHelpHero(getEnv('VUE_APP_HELPHERO_ID'));
if (getEnv('VITE_APP_HELPHERO_ID')) {
const hlp = initHelpHero(getEnv('VITE_APP_HELPHERO_ID'));
hlp.anonymous();
}
Expand Down
143 changes: 143 additions & 0 deletions src/components/Alert/Alert.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
<template>
<div v-if="version === '1.0'" :class="['unnnic-alert', `unnnic-alert-position--${position}`]">
<unnnic-icon-svg :icon="icon" :scheme="scheme" size="sm" />
<div class="unnnic-alert__content">
<div class="unnnic-alert__title">
{{ title.toUpperCase() }}
</div>
<div class="unnnic-alert__text">
{{ text }}
</div>
</div>
<div v-if="closeText" class="unnnic-alert__close-text unnnic--clickable" @click="onClose()">
{{ closeText.toUpperCase() }}
</div>
<unnnic-icon icon="close-1" scheme="white" size="xs" @click="onClose" />
</div>

<component
v-else
:is="'version' + version.replace(/\./g, 'dot')"
v-bind="{ ...$props }"
></component>
</template>

<script>
import Version1dot1 from './Version1dot1.vue';
export default {
name: 'unnnicAlert',
components: {
Version1dot1,
},
props: {
version: {
type: String,
default: '1.1',
},
title: {
type: String,
default: null,
},
text: {
type: String,
default: null,
},
scheme: {
type: String,
default: null,
},
icon: {
type: String,
default: null,
},
onClose: {
type: Function,
default: () => {},
},
closeText: {
type: String,
},
position: {
type: String,
default: 'top-right',
},
linkHref: {
type: String,
},
linkTarget: {
type: String,
},
linkText: {
type: String,
},
type: {
type: String,
},
},
};
</script>

<style lang="scss" scoped>
.unnnic-alert {
position: fixed;
padding: $unnnic-inset-xs;
min-width: 12.5 * $unnnic-font-size;
display: inline-flex;
align-items: center;
font-family: $unnnic-font-family-secondary;
border-radius: $unnnic-border-radius-sm;
background-color: $unnnic-color-background-snow;
box-shadow: $unnnic-shadow-level-near;
position: fixed;
z-index: 9999;
&-position {
&--top-right {
top: 1 * $unnnic-font-size;
right: 1 * $unnnic-font-size;
}
&--top-left {
top: 1 * $unnnic-font-size;
left: 1 * $unnnic-font-size;
}
&--bottom-right {
bottom: 1 * $unnnic-font-size;
right: 1 * $unnnic-font-size;
}
&--bottom-left {
bottom: 1 * $unnnic-font-size;
left: 1 * $unnnic-font-size;
}
}
&__content {
flex: 1;
margin: 0 $unnnic-inline-xs;
}
&__title {
font-size: $unnnic-font-size-body-sm;
font-weight: $unnnic-font-weight-bold;
color: $unnnic-color-neutral-darkest;
}
&__text {
font-size: $unnnic-font-size-body-md;
font-weight: $unnnic-font-weight-regular;
color: $unnnic-color-neutral-dark;
}
&__close {
&-text {
color: $unnnic-color-brand-sec;
font-size: $unnnic-font-size-body-md;
}
}
}
</style>
49 changes: 49 additions & 0 deletions src/components/Alert/AlertCaller.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<template>
<button @click="callAlert">Launch alert</button>
</template>

<script>
import alert from '../../utils/call';
export default {
props: {
title: {
type: String,
default: null,
},
text: {
type: String,
default: null,
},
icon: {
type: String,
default: null,
},
enabled: {
type: Boolean,
default: true,
},
scheme: {
type: String,
default: null,
},
seconds: {
type: Number,
default: 3,
},
closeText: {
type: String,
default: null,
},
position: {
type: String,
default: 'top-right',
},
},
methods: {
callAlert() {
alert.callAlert({ props: this.$props, seconds: this.seconds });
},
},
};
</script>
Loading

0 comments on commit 08d19ba

Please sign in to comment.