-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add simple storage portlet - MEED-8221 - Meeds-io/MIPs#176
Add simple storage portlet
- Loading branch information
Showing
12 changed files
with
316 additions
and
1 deletion.
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
9 changes: 9 additions & 0 deletions
9
webapp/src/main/resources/locale/portlet/SimpleStorage_en.properties
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,9 @@ | ||
simpleStorage.title.label=Simple storage | ||
simpleStorage.addImage.label=Add | ||
simpleStorage.filter.placeholder=Filter by name | ||
simpleStorage.name.label=Name | ||
simpleStorage.creationDate.label=Creation Date | ||
simpleStorage.size.label=Size | ||
simpleStorage.actions.label=Actions | ||
simpleStorage.delete.label=Delete | ||
simpleStorage.copyLink.label=Copy link |
9 changes: 9 additions & 0 deletions
9
webapp/src/main/resources/locale/portlet/SimpleStorage_fr.properties
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,9 @@ | ||
simpleStorage.title.label=Stockage simple | ||
simpleStorage.addImage.label=Ajouter | ||
simpleStorage.filter.placeholder=Filtrer par nom | ||
simpleStorage.name.label=Nom | ||
simpleStorage.creationDate.label=Date de cr\u00E9ation | ||
simpleStorage.size.label=Taille | ||
simpleStorage.actions.label=Actions | ||
simpleStorage.delete.label=Supprimer | ||
simpleStorage.copyLink.label=Copier le lien |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div class="VuetifyApp"> | ||
<div id="simpleStorage"> | ||
<script type="text/javascript"> | ||
require(['PORTLET/social/SimpleStorage'], app => app.init()); | ||
</script> | ||
</div> | ||
</div> |
39 changes: 39 additions & 0 deletions
39
webapp/src/main/webapp/vue-apps/simple-storage/components/SimpleStorageApp.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,39 @@ | ||
<!-- | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2025 Meeds Association contact@meeds.io | ||
* | ||
* 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 | ||
class="application-body position-static pb-5" | ||
flat> | ||
<h4 class="text-title px-5 pt-5 ma-0"> | ||
{{ $t('simpleStorage.title.label') }} | ||
</h4> | ||
<simple-storage-toolbar | ||
class="mb-3" /> | ||
<simple-storage-image-list /> | ||
</v-card> | ||
</v-app> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
}; | ||
</script> |
51 changes: 51 additions & 0 deletions
51
webapp/src/main/webapp/vue-apps/simple-storage/components/view/SimpleStorageImageList.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,51 @@ | ||
<!-- | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2025 Meeds Association contact@meeds.io | ||
* | ||
* 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-data-table | ||
:headers="headers" | ||
:items="items" | ||
item-key="name" | ||
class="px-5" | ||
hide-default-footer | ||
dense> | ||
<!-- eslint-disable-next-line vue/valid-v-slot --> | ||
<template #item.actions="{ item }"> | ||
{{ item }} | ||
// | ||
</template> | ||
</v-data-table> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
data() { | ||
return { | ||
headers: [ | ||
{text: this.$t('simpleStorage.name.label'), value: 'name'}, | ||
{text: this.$t('simpleStorage.creationDate.label'), value: 'creationDate'}, | ||
{text: this.$t('simpleStorage.size.label'), value: 'size'}, | ||
{text: this.$t('simpleStorage.actions.label'), value: 'actions', sortable: false}, | ||
], | ||
items: [] | ||
}; | ||
} | ||
}; | ||
</script> |
50 changes: 50 additions & 0 deletions
50
webapp/src/main/webapp/vue-apps/simple-storage/components/view/SimpleStorageToolbar.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,50 @@ | ||
<!-- | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2025 Meeds Association contact@meeds.io | ||
* | ||
* 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> | ||
<application-toolbar | ||
:right-text-filter="{ | ||
minCharacters: 1, | ||
placeholder: $t('simpleStorage.filter.placeholder'), | ||
tooltip: $t('simpleStorage.filter.placeholder'), | ||
}" | ||
class="px-1" | ||
@filter-text-input="$emit('filter-changed', $event)" | ||
@filter-text-input-end-typing="$emit('filter-changed-end-typing', $event)"> | ||
<template #left> | ||
<v-btn | ||
id="applicationToolbarLeftButton" | ||
:aria-label="$t('simpleStorage.addImage.label')" | ||
class="btn btn-primary text-truncate"> | ||
<v-icon | ||
size="18"> | ||
fa-plus | ||
</v-icon> | ||
<span class="text-truncate text-none hidden-xs-only ms-2"> | ||
{{ $t('simpleStorage.addImage.label') }} | ||
</span> | ||
</v-btn> | ||
</template> | ||
</application-toolbar> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
}; | ||
</script> |
33 changes: 33 additions & 0 deletions
33
webapp/src/main/webapp/vue-apps/simple-storage/initComponents.js
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 @@ | ||
/* | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2025 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 SimpleStorageApp from './components/SimpleStorageApp.vue'; | ||
import SimpleStorageToolbar from './components/view/SimpleStorageToolbar.vue'; | ||
import SimpleStorageImageList from './components/view/SimpleStorageImageList.vue'; | ||
|
||
const components = { | ||
'simple-storage-app': SimpleStorageApp, | ||
'simple-storage-toolbar': SimpleStorageToolbar, | ||
'simple-storage-image-list': SimpleStorageImageList | ||
}; | ||
|
||
for (const key in components) { | ||
Vue.component(key, components[key]); | ||
} |
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,50 @@ | ||
/* | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2025 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 './initComponents.js'; | ||
|
||
// get overridden components if exists | ||
if (extensionRegistry) { | ||
const components = extensionRegistry.loadComponents('simpleStorage'); | ||
if (components && components.length > 0) { | ||
components.forEach(cmp => { | ||
Vue.component(cmp.componentName, cmp.componentOptions); | ||
}); | ||
} | ||
} | ||
|
||
const lang = eXo && eXo.env.portal.language || 'en'; | ||
const url = `/social/i18n/locale.portlet.SimpleStorage?lang=${lang}`; | ||
const vuetify = Vue.prototype.vuetifyOptions; | ||
const appId = 'simpleStorage'; | ||
|
||
export function init(languages) { | ||
exoi18n.loadLanguageAsync(lang, url).then(i18n => { | ||
Vue.createApp({ | ||
data: { | ||
languages: languages, | ||
}, | ||
template: '<simple-storage-app />', | ||
vuetify, | ||
i18n | ||
}, `#${appId}`, 'Simple storage'); | ||
}); | ||
} |
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