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: Add remind where or what to do the action for kudos events - MEED-3284 - Meeds-io/MIPs#105 #467

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ gamification.event.title.sendKudos=Kudos : Send kudos
gamification.event.description.sendKudos=You sent a Kudos
gamification.event.title.receiveKudos=Kudos : Receive kudos
gamification.event.description.receiveKudos=You received a Kudos
gamification.event.display.congratulate=Congratulate
23 changes: 23 additions & 0 deletions kudos-webapps/src/main/webapp/WEB-INF/gatein-resources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,27 @@
</depends>
</module>

<module>
<name>engagementCenterConnectorEventsKudosExtensions</name>
<load-group>engagement-center-connector-event-extensions</load-group>
<script>
<path>/js/connectorEventExtensions.bundle.js</path>
</script>
<depends>
<module>vue</module>
</depends>
<depends>
<module>vuetify</module>
</depends>
<depends>
<module>eXoVueI18n</module>
</depends>
<depends>
<module>extensionRegistry</module>
</depends>
<depends>
<module>commonVueComponents</module>
</depends>
</module>

</gatein-resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!--
This file is part of the Meeds project (https://meeds.io/).
Copyright (C) 2020 - 2024 Meeds Association [email protected]
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-->
<template>
<v-app v-if="!isEditing">
<div class="subtitle-1 font-weight-bold mb-2">
{{ $t('gamification.event.display.doItNow') }}
</div>
<div class="d-flex justify-center">
<v-btn
max-width="250"
class="ignore-vuetify-classes text-capitalize btn btn-primary"
@click="openKudosDrawer">
{{ $t('gamification.event.display.congratulate') }}
</v-btn>
</div>
</v-app>
</template>
<script>
export default {
props: {
properties: {
type: Object,
default: null
},
trigger: {
type: String,
default: null
},
isEditing: {
type: Boolean,
default: false
}
},
methods: {
openKudosDrawer() {
this.$root.$emit('rule-detail-drawer-close');
document.dispatchEvent(new CustomEvent('exo-kudos-open-send-modal', {detail: {
id: eXo.env.portal.userIdentityId,
type: 'USER_PROFILE',
parentId: '',
owner: eXo.env.portal.userName,
}}));
},
}
};
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* This file is part of the Meeds project (https://meeds.io/).
*
* Copyright (C) 2020 - 2024 Meeds Association [email protected]
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
import '../connectorEventExtensions/initComponents';

export function init() {
extensionRegistry.registerComponent('engagementCenterEvent', 'connector-event-extensions', {
id: 'kudos-event',
name: 'kudos',
vueComponent: Vue.options.components['kudos-event'],
isEnabled: (params) => [
'sendKudos'
].includes(params?.trigger),
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* This file is part of the Meeds project (https://meeds.io/).
* Copyright (C) 2020 - 2024 Meeds Association [email protected]
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import KudosEvent from './components/KudosEvent.vue';

const components = {
'kudos-event': KudosEvent,
};

for (const key in components) {
Vue.component(key, components[key]);
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,11 @@ export function init() {
}
},
});

extensionRegistry.registerExtension('engagementCenterActions', 'activity-icon', {
id: 'kudos-icon',
type: 'exokudos:activity',
icon: 'fas fa-award',
class: 'primary--text',
});
}
1 change: 1 addition & 0 deletions kudos-webapps/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const config = {
kudosAdmin: './src/main/webapp/vue-app/kudos-admin/main.js',
kudosOverview: './src/main/webapp/vue-app/kudos-overview/main.js',
engagementCenterExtensions: './src/main/webapp/vue-app/engagementCenterExtensions/extensions.js',
connectorEventExtensions: './src/main/webapp/vue-app/connectorEventExtensions/extensions.js',
notificationExtension: './src/main/webapp/vue-app/notification-extension/main.js',
},
module: {
Expand Down
Loading