Skip to content

Commit

Permalink
Merge branch 'fix/favicon' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuseduardomedeiros committed Aug 29, 2024
2 parents 1e59fe2 + e269f0a commit a5462ae
Show file tree
Hide file tree
Showing 23 changed files with 745 additions and 744 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="/favicon.ico">
<link rel="icon" href="./public/favicon.ico">
<title>Weni</title>
<script src="https://js.stripe.com/v3"></script>
<script>
Expand Down Expand Up @@ -47,7 +47,7 @@
};
k.async = true; k.src = 'https://storage.googleapis.com/push-webchat/wwc-latest.js';
h.parentNode.insertBefore(k, h);
})(document, 'script', 'https://weni-sp-integrations-production.s3.amazonaws.com/apptypes/wwc/5579760a-a4f0-4296-a177-0322d52cfbb5/script.js');
})(document, 'script', 'https://weni-sp-integrations-production.s3.amazonaws.com/apptypes/wwc/1807661c-caf2-4a13-9c64-b2006c4f15dd/script.js');
</script>
</body>

Expand Down
6 changes: 0 additions & 6 deletions public/assets/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@
height: 100vh;
}

.weni-navbar {
display: flex;
flex-direction: column;
flex: 1;
}

body {
margin: 0;
}
Expand Down
17 changes: 13 additions & 4 deletions src/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ export default {
],
unreadMessages: 0,
championChatbotsByProject: {},
isComercialTiming: false,
isComercialTimingInterval: null,
};
},
Expand Down Expand Up @@ -272,11 +274,8 @@ export default {
showHelpBot() {
if (!this.currentOrg?.uuid) return false;
const hour = moment().hours();
const isComercialTiming = hour >= 8 && hour < 19;
return (
isComercialTiming &&
this.isComercialTiming &&
this.currentOrg?.show_chat_help &&
this.$route.name !== 'projects'
);
Expand All @@ -293,6 +292,11 @@ export default {
`Hash %c${getEnv('VITE_HASH')}`,
'background: #00DED2; color: #262626',
);
this.checkIsComercialTiming();
this.isComercialTimingInterval = setInterval(() => {
this.checkIsComercialTiming();
}, 1000 * 60);
window.addEventListener('openModalAddedFirstInfos', () => {
this.isModalCreatedProjectOpen = true;
Expand Down Expand Up @@ -567,6 +571,11 @@ export default {
'changeReadyMadeProjectProperties',
]),
checkIsComercialTiming() {
const hour = moment().hours();
this.isComercialTiming = hour >= 8 && hour < 18;
},
registerNotificationSupport() {
if (!('Notification' in window)) {
console.error('This browser does not support desktop notification');
Expand Down
33 changes: 20 additions & 13 deletions src/components/Topbar/ProfileDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
slot="trigger"
class="profile"
:class="{ 'profile--selected': isProfileDropdownOpen }"
data-test="dropdown-trigger"
>
<ProfilePictureDefault
v-if="photoWithError || !photo"
Expand All @@ -20,6 +21,7 @@
:src="photo"
class="profile__picture"
@error="photoWithError = true"
data-test="profile-image"
/>

<p class="profile__name">{{ firstName }}</p>
Expand All @@ -41,6 +43,7 @@
:key="`link-${index}`"
class="action"
:class="[action.scheme && `action--scheme-${action.scheme}`]"
:data-test="action.testId"
>
<UnnnicIcon
:icon="action.icon"
Expand All @@ -57,6 +60,7 @@
class="action"
:class="[action.scheme && `action--scheme-${action.scheme}`]"
@click="action.onClick"
:data-test="action.testId"
>
<UnnnicIcon
:icon="action.icon"
Expand Down Expand Up @@ -91,15 +95,12 @@ import {
const instance = getCurrentInstance();
function use(name) {
return computed(() => {
const { proxy } = instance;
const item = proxy[`$${name}`];
return item;
});
const { proxy } = instance;
const module = proxy[`$${name}`];
return module;
}
const store = use('store');
const route = use('route');
const keycloak = use('keycloak');
const photoWithError = ref(false);
Expand All @@ -111,7 +112,7 @@ const firstName = computed(() => {
const initialLetters = computed(() => {
return [getProfileProperty('first_name'), getProfileProperty('last_name')]
.map((name) => name.trim().slice(0, 1))
.map((name) => String(name).trim().slice(0, 1))
.join('')
.toUpperCase();
});
Expand All @@ -121,7 +122,7 @@ const photo = computed(() => {
});
function getProfileProperty(property) {
return store.value.state.Account.profile?.[property] || '';
return store.state.Account.profile?.[property];
}
const actions = computed(() => {
Expand All @@ -133,27 +134,32 @@ const actions = computed(() => {
icon: 'person',
label: i18n.t('NAVBAR.ACCOUNT'),
viewUrl: '/account/edit',
testId: 'account',
},
{
icon: 'swap_horiz',
label: i18n.t('NAVBAR.CHANGE_ORG'),
viewUrl: '/orgs',
testId: 'see-all-orgs',
},
],
);
const routeParams = instance.proxy['$route'].params;
if (
(route.value.params.orgUuid || route.value.params.projectUuid) &&
(routeParams.orgUuid || routeParams.projectUuid) &&
[ORG_ROLE_ADMIN, ORG_ROLE_FINANCIAL].includes(
store.value.getters.org?.authorization.role,
store.getters.org?.authorization.role,
)
) {
actions.push(
...[
{
icon: 'paid',
label: i18n.t('NAVBAR.YOUR_PLAN'),
viewUrl: `/orgs/${store.value.getters.org?.uuid}/billing`,
viewUrl: `/orgs/${store.getters.org?.uuid}/billing`,
testId: 'billing',
},
],
);
Expand All @@ -166,6 +172,7 @@ const actions = computed(() => {
scheme: 'error',
label: i18n.t('NAVBAR.LOGOUT'),
onClick: showLogoutModal,
testId: 'logout',
},
],
);
Expand All @@ -174,7 +181,7 @@ const actions = computed(() => {
});
function showLogoutModal() {
store.value.dispatch('openModal', {
store.dispatch('openModal', {
type: 'confirm',
data: {
icon: 'logout',
Expand All @@ -185,7 +192,7 @@ function showLogoutModal() {
confirmText: i18n.t('NAVBAR.LOGOUT'),
onConfirm: (justClose) => {
justClose();
keycloak.value.logout();
keycloak.logout();
},
},
});
Expand Down
17 changes: 12 additions & 5 deletions src/components/Topbar/ProfileLanguageSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
class="language"
:class="{ 'language--selected': isSelectedLanguage(language) }"
@click.stop="changeLanguage(language)"
:data-test="language"
>
<img :src="flag" />

Expand All @@ -18,6 +19,10 @@
</section>
</template>

<script>
export default { name: 'ProfileLanguageSelector' };
</script>

<script setup>
import { computed, getCurrentInstance } from 'vue';
import i18n from '@/utils/plugins/i18n.js';
Expand All @@ -28,11 +33,13 @@ import FlagEs from '@/assets/flags/es.png';
const instance = getCurrentInstance();
const store = computed(() => {
function use(name) {
const { proxy } = instance;
const store = proxy.$store;
return store;
});
const module = proxy[`$${name}`];
return module;
}
const store = use('store');
const languages = computed(() => [
{
Expand All @@ -54,7 +61,7 @@ function isSelectedLanguage(language) {
}
function changeLanguage(language) {
store.value.dispatch('updateAccountLanguage', {
store.dispatch('updateAccountLanguage', {
language,
});
}
Expand Down
4 changes: 4 additions & 0 deletions src/components/Topbar/ProfilePictureDefault.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
</svg>
</template>

<script>
export default { name: 'ProfilePictureDefault' };
</script>

<script setup>
defineProps({
text: String,
Expand Down
6 changes: 6 additions & 0 deletions src/components/Topbar/Topbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
</section>
</template>

<script>
export default {
name: 'TopbarComponent',
};
</script>

<script setup>
import { computed, getCurrentInstance } from 'vue';
Expand Down
10 changes: 4 additions & 6 deletions src/components/common/RightBar/LearningCenter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,15 @@ import { computed, getCurrentInstance } from 'vue';
const instance = getCurrentInstance();
function use(name) {
return computed(() => {
const { proxy } = instance;
const item = proxy[`$${name}`];
return item;
});
const { proxy } = instance;
const module = proxy[`$${name}`];
return module;
}
const route = use('route');
const projectSelected = computed(() => {
return route.value.params?.projectUuid;
return route.params?.projectUuid;
});
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@
</section>
</template>

<script>
export default { name: 'LearningCenterChampionChatbot' };
</script>

<script setup>
import { computed, getCurrentInstance, ref } from 'vue';
import i18n from '../../../utils/plugins/i18n';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
:style="{
backgroundImage: `url('https://i.ytimg.com/vi_webp/${videoId}/maxresdefault.webp')`,
}"
data-test="video-preview"
>
<img
class="youtube-preview__play-button"
Expand Down
5 changes: 5 additions & 0 deletions src/components/common/RightBar/LearningCenterResources.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
:is="resource.route ? 'RouterLink' : 'a'"
class="resource"
:class="[`resource--${resource.id}`]"
:data-test="resource.id"
v-bind="propsByResource(resource)"
@click.native="handleNativeClick(resource)"
>
Expand All @@ -26,6 +27,10 @@
</section>
</template>

<script>
export default { name: 'LearningCenterResources' };
</script>

<script setup>
import { computed } from 'vue';
import i18n from '../../../utils/plugins/i18n';
Expand Down
Loading

0 comments on commit a5462ae

Please sign in to comment.