Skip to content

Commit

Permalink
MEED-3206 Add the extension registry for event to add properties
Browse files Browse the repository at this point in the history
  • Loading branch information
MayTekayaa committed Feb 29, 2024
1 parent 5bd5137 commit 032c27a
Show file tree
Hide file tree
Showing 7 changed files with 155 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* 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.
*
*/
package io.meeds.gamification.evm.plugin;

import io.meeds.gamification.plugin.EventPlugin;

import java.util.List;
import java.util.Map;
import java.util.HashMap;

import static io.meeds.gamification.evm.utils.Utils.*;

public class EvmEventPlugin extends EventPlugin{
public static final String EVENT_TYPE = "evm";

@Override
public String getEventType() {
return EVENT_TYPE;
}

public List<String> getTriggers() {
return List.of(HOLD_TOKEN_EVENT);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,25 @@
</depends>
</module>

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

</gatein-resources>

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!--
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-card-text class="px-0 dark-grey-color font-weight-bold">
Evm connector properties
</v-card-text>
</v-app>
</template>

<script>
export default {
props: {
properties: {
type: Object,
default: null
}
}
};
</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.
*
*/

export function init() {
extensionRegistry.registerComponent('engagementCenterEvent', 'connector-event-extensions', {
id: 'evm-event',
name: 'evm',
vueComponent: Vue.options.components['evm-connector-event-form'],
isEnabled: (params) => [
'holdtoken',
].includes(params?.trigger),
rank: 1,
});
}
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 EvmConnectorEventForm from './components/EvmEventForm.vue';

const components = {
'evm-connector-event-form': EvmConnectorEventForm,
};

for (const key in components) {
Vue.component(key, components[key]);
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export function init() {
return realization.link;
}
},
isExtensible: true
}
});
}
1 change: 1 addition & 0 deletions gamification-evm-webapp/webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const config = merge(webpackCommonConfig, {
entry: {
engagementCenterExtensions: './src/main/webapp/vue-app/engagementCenterExtensions/extensions.js',
connectorExtensions: './src/main/webapp/vue-app/connectorExtensions/extensions.js',
connectorEventExtensions: './src/main/webapp/vue-app/connectorEventExtensions/extensions.js',
},
output: {
path: path.join(__dirname, 'target/gamification-evm/'),
Expand Down

0 comments on commit 032c27a

Please sign in to comment.