diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 68576a2..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: BuildPlugin -on: - push: - branches: - - '0.3' - -jobs: - build: - uses: FriendsOfShopware/actions/.github/workflows/store-shopware-cli.yml@main - with: - extensionName: ${{ github.event.repository.name }} - secrets: - accountUser: ${{ secrets.ACCOUNT_USER }} - accountPassword: ${{ secrets.ACCOUNT_PASSWORD }} - ghToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore deleted file mode 100644 index ca21e90..0000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/.settings/ -/.buildpath -/.project diff --git a/.shopware-extension.yml b/.shopware-extension.yml deleted file mode 100644 index 05fba82..0000000 --- a/.shopware-extension.yml +++ /dev/null @@ -1,7 +0,0 @@ -build: - zip: - assets: - enabled: true - enable_es_build_for_admin: true - enable_es_build_for_storefront: true - diff --git a/src/Resources/public/administration/css/frosh-platform-mail-archive.css b/src/Resources/public/administration/css/frosh-platform-mail-archive.css new file mode 100644 index 0000000..2451b6c --- /dev/null +++ b/src/Resources/public/administration/css/frosh-platform-mail-archive.css @@ -0,0 +1 @@ +.sw-sidebar-item__scrollable-container{padding:10px}.frosh-mail-archive-detail iframe{width:100%;height:500px;background-color:#fff}.frosh-mail-archive-detail pre{white-space:pre-line} diff --git a/src/Resources/public/administration/js/frosh-platform-mail-archive.js b/src/Resources/public/administration/js/frosh-platform-mail-archive.js new file mode 100644 index 0000000..70e9734 --- /dev/null +++ b/src/Resources/public/administration/js/frosh-platform-mail-archive.js @@ -0,0 +1,109 @@ +(()=>{var l=Shopware.Classes.ApiService,s=class extends l{constructor(t,a,r="frosh-mail-archive"){super(t,a,r)}resendMail(t){let a=this.getBasicHeaders({});return this.httpClient.post(`_action/${this.getApiBasePath()}/resend-mail`,{mailId:t},{...this.basicConfig,headers:a}).then(r=>l.handleResponse(r))}},o=s;var{Application:c}=Shopware;c.addServiceProvider("froshMailArchiveService",e=>{let t=c.getContainer("init");return new o(t.httpClient,e.loginService)});var n=` + + + + + + + + + + + + + + + + + + + {{ $tc('frosh-mail-archive.list.sidebar.filters.resetFilter') }} + + + + +`;var{Component:d,Mixin:p}=Shopware,{Criteria:i}=Shopware.Data,u=Shopware.Utils;d.register("frosh-mail-archive-index",{template:n,inject:["repositoryFactory"],mixins:[p.getByName("listing")],metaInfo(){return{title:this.$createTitle()}},data(){return{page:1,limit:25,total:0,repository:null,items:null,isLoading:!0,filter:{salesChannelId:null,customerId:null,term:null}}},computed:{columns(){return[{property:"createdAt",dataIndex:"createdAt",label:"frosh-mail-archive.list.columns.sentDate",primary:!0,routerLink:"frosh.mail.archive.detail"},{property:"subject",dataIndex:"subject",label:"frosh-mail-archive.list.columns.subject",allowResize:!0,routerLink:"frosh.mail.archive.detail"},{property:"receiver",dataIndex:"receiver",label:"frosh-mail-archive.list.columns.receiver",allowResize:!0}]},mailArchiveRepository(){return this.repositoryFactory.create("frosh_mail_archive")}},methods:{getList(){this.isLoading=!0;let e=new i;return e.setTerm(this.term),this.filter.salesChannelId&&e.addFilter(i.equals("salesChannelId",this.filter.salesChannelId)),this.filter.customerId&&e.addFilter(i.equals("customerId",this.filter.customerId)),this.filter.term&&e.setTerm(this.filter.term),e.addSorting(i.sort("createdAt","DESC")),this.mailArchiveRepository.search(e,Shopware.Context.api).then(t=>{this.items=t,this.total=t.total,this.isLoading=!1})},resetFilter(){this.filter={salesChannelId:null,customerId:null,term:null}}},watch:{filter:{deep:!0,handler:u.debounce(function(){this.getList()},400)}}});var h=` + + + + + + +`;var{Component:v}=Shopware;v.register("frosh-mail-archive-detail",{template:h,inject:["repositoryFactory","froshMailArchiveService"],data(){return{archive:null,isLoading:!1,isSuccessful:!1}},created(){this.repository=this.repositoryFactory.create("frosh_mail_archive"),this.repository.get(this.$route.params.id,Shopware.Context.api).then(e=>{this.archive=e})},computed:{createdAtDate(){let e=Shopware.State.getters.adminLocaleLanguage||"en",t={day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"};return new Intl.DateTimeFormat(e,t).format(new Date(this.archive.createdAt))},receiverText(){let e=[];return Object.keys(this.archive.receiver).forEach(t=>{e.push(`${this.archive.receiver[t]} <${t}>`)}),e.join(",")},senderText(){let e=[];return Object.keys(this.archive.sender).forEach(t=>{e.push(`${this.archive.sender[t]} <${t}>`)}),e.join(",")},htmlText(){return this.getContent(this.archive.htmlText)},plainText(){return this.getContent(this.archive.plainText)}},methods:{getContent(e){return"data:text/html;base64,"+btoa(unescape(encodeURIComponent(e.replace(/[\u00A0-\u2666]/g,function(t){return"&#"+t.charCodeAt(0)+";"}))))},openCustomer(){this.$router.push({name:"sw.customer.detail",params:{id:this.archive.customer.id}})},resendMail(){this.isLoading=!0,this.froshMailArchiveService.resendMail(this.archive.id).then(()=>{this.isLoading=!1,this.isSuccessful=!0}).catch(()=>{this.isLoading=!1,this.isSuccessful=!1})}}});Shopware.Module.register("frosh-mail-archive",{type:"plugin",name:"frosh-mail-archive.title",title:"frosh-mail-archive.title",description:"",color:"#243758",icon:"default-communication-envelope",entity:"frosh_mail_archive",routes:{list:{component:"frosh-mail-archive-index",path:"list"},detail:{component:"frosh-mail-archive-detail",path:"detail/:id",meta:{parentPath:"frosh.mail.archive.list"}}},settingsItem:[{group:"plugins",to:"frosh.mail.archive.list",icon:"default-communication-envelope",name:"frosh-mail-archive.title"}]});})(); diff --git a/src/Resources/store/de.md b/src/Resources/store/de.md deleted file mode 100644 index 0acdad3..0000000 --- a/src/Resources/store/de.md +++ /dev/null @@ -1,8 +0,0 @@ -Mit diesem Plugin erhalten Sie ein einfaches durchsuchbares Archiv für E-Mails, die aus Shopware versendet werden. -Die E-Mails sind über den Menüpfad erreichbar: Einstellungen/Erweiterungen/Main Archiv. - -Dieses Plugin wird von [@FriendsOfShopware](https://store.shopware.com/friends-of-shopware.html) -entwickelt. -Maintainer dieses Plugins ist: [Soner Sayakci](https://github.com/shyim) - -Bei Fragen / Fehlern bitte ein [Github Issue](https://github.com/FriendsOfShopware/FroshPlatformMailArchive/issues/new) erstellen diff --git a/src/Resources/store/en.md b/src/Resources/store/en.md deleted file mode 100644 index 293d8c5..0000000 --- a/src/Resources/store/en.md +++ /dev/null @@ -1,7 +0,0 @@ -With this plugin you get a simple searchable archive for emails that are sent from Shopware. -The e-mails can be found via the menu path Settings/Extensions/Main Archive. - -This plugin is part of [@FriendsOfShopware](https://store.shopware.com/en/friends-of-shopware.html). -Maintainer from the plugin is: [Soner Sayakci](https://github.com/shyim) - -For questions or bugs please create a [Github Issue](https://github.com/FriendsOfShopware/FroshPlatformMailArchive/issues/new) diff --git a/src/Resources/store/icon.png b/src/Resources/store/icon.png deleted file mode 100644 index 885856b..0000000 Binary files a/src/Resources/store/icon.png and /dev/null differ diff --git a/src/Resources/store/images/1.png b/src/Resources/store/images/1.png deleted file mode 100644 index 4d8aa2f..0000000 Binary files a/src/Resources/store/images/1.png and /dev/null differ diff --git a/src/Resources/store/images/2.png b/src/Resources/store/images/2.png deleted file mode 100644 index b463f64..0000000 Binary files a/src/Resources/store/images/2.png and /dev/null differ diff --git a/src/Resources/store/store.json b/src/Resources/store/store.json deleted file mode 100644 index c88bf65..0000000 --- a/src/Resources/store/store.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "storeAvailabilities": [ - "International", - "German" - ], - "standardLocale": "en_GB", - "localizations": ["de_DE","en_GB","fr_FR","nl_NL","es_ES","it_IT"], - "categories": ["BackendBearbeitung"], - "productType": "extension", - "responsive": true, - "tags": { - "en": [ - "mail", - "archive" - ], - "de": [ - "mail", - "archive" - ] - } -}