commit 9fd12b6d554e9391161e97ad092021a6bde07ed2 Author: Tobias Klika Date: Sun Mar 22 14:18:34 2020 +0100 hi diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..1ff0c423 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..7d02347b --- /dev/null +++ b/.gitignore @@ -0,0 +1,269 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +project.fragment.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +#*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets +package-lock.json + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Media folder + app_data +App_Data/ +**/Media/ +Temp/ +**/Assets/app.* +deps/*.dll \ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/readme.md @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/unjo.Core/Constants.cs b/unjo.Core/Constants.cs new file mode 100644 index 00000000..b8f34184 --- /dev/null +++ b/unjo.Core/Constants.cs @@ -0,0 +1,18 @@ +namespace unjo.Core +{ + public static class Constants + { + public static class Sections + { + public const string Dashboard = "dashboard"; + + public const string Pages = "pages"; + + public const string Lists = "lists"; + + public const string Media = "media"; + + public const string Settings = "settings"; + } + } +} diff --git a/unjo.Core/Entities/Sections/IChildSection.cs b/unjo.Core/Entities/Sections/IChildSection.cs new file mode 100644 index 00000000..a1e1c1f9 --- /dev/null +++ b/unjo.Core/Entities/Sections/IChildSection.cs @@ -0,0 +1,18 @@ +namespace unjo.Core.Entities.Sections +{ + /// + /// A child section is a sub-navigation item of a section + /// + public interface IChildSection + { + /// + /// The section alias which acts as the url slug for navigation + /// + public string Alias { get; set; } + + /// + /// The name of the section (either a string or a translation key with @ prefix) + /// + public string Name { get; set; } + } +} diff --git a/unjo.Core/Entities/Sections/ISection.cs b/unjo.Core/Entities/Sections/ISection.cs new file mode 100644 index 00000000..d57bb23d --- /dev/null +++ b/unjo.Core/Entities/Sections/ISection.cs @@ -0,0 +1,30 @@ +using System.Collections.Generic; + +namespace unjo.Core.Entities.Sections +{ + /// + /// A section is a main part of the backoffice application + /// + public interface ISection + { + /// + /// The section alias which acts as the url slug for navigation + /// + string Alias { get; } + + /// + /// The name of the section (either a string or a translation key with @ prefix) + /// + string Name { get; } + + /// + /// Icon of the section + /// + string Icon { get; } + + /// + /// Children are displayed as a sub-navigation in the main nav area + /// + IList Children { get; } + } +} diff --git a/unjo.Core/Extensions/StringExtensions.cs b/unjo.Core/Extensions/StringExtensions.cs new file mode 100644 index 00000000..9c38ff23 --- /dev/null +++ b/unjo.Core/Extensions/StringExtensions.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Text; + +namespace unjo.Core.Extensions +{ + public static class StringExtensions + { + public static string EnsureStartsWith(this string input, string toStartWith) + { + if (input.StartsWith(toStartWith)) return input; + return toStartWith + input.TrimStart(toStartWith); + } + + public static string EnsureStartsWith(this string input, char value) + { + return input.StartsWith(value.ToString(CultureInfo.InvariantCulture)) ? input : value + input; + } + + public static string EnsureEndsWith(this string input, char value) + { + return input.EndsWith(value.ToString(CultureInfo.InvariantCulture)) ? input : input + value; + } + + public static string EnsureEndsWith(this string input, string toEndWith) + { + return input.EndsWith(toEndWith.ToString(CultureInfo.InvariantCulture)) ? input : input + toEndWith; + } + } +} diff --git a/unjo.Core/unjo.Core.csproj b/unjo.Core/unjo.Core.csproj new file mode 100644 index 00000000..9bd7f70c --- /dev/null +++ b/unjo.Core/unjo.Core.csproj @@ -0,0 +1,8 @@ + + + + 8.0 + netstandard2.0 + + + diff --git a/unjo.Web/Index.cshtml b/unjo.Web/Index.cshtml new file mode 100644 index 00000000..9b156142 --- /dev/null +++ b/unjo.Web/Index.cshtml @@ -0,0 +1,34 @@ +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers +@inject Microsoft.AspNetCore.Http.IHttpContextAccessor HttpContextAccessor +@{ + string theme = HttpContextAccessor.HttpContext.Request.Cookies["theme"] ?? "dark"; + Layout = null; +} + + + + + + + + + + + + + + + + + + + + + + fifty + + +
+ + + \ No newline at end of file diff --git a/unjo.Web/Program.cs b/unjo.Web/Program.cs new file mode 100644 index 00000000..2b26e428 --- /dev/null +++ b/unjo.Web/Program.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; + +namespace unjo.Web +{ + public class Program + { + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + } +} diff --git a/unjo.Web/Properties/launchSettings.json b/unjo.Web/Properties/launchSettings.json new file mode 100644 index 00000000..01e68750 --- /dev/null +++ b/unjo.Web/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:51017", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "unjo": { + "commandName": "Project", + "launchBrowser": true, + "applicationUrl": "http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/unjo.Web/Sections/DashboardSection.cs b/unjo.Web/Sections/DashboardSection.cs new file mode 100644 index 00000000..fc1a7710 --- /dev/null +++ b/unjo.Web/Sections/DashboardSection.cs @@ -0,0 +1,24 @@ +using System.Collections.Generic; +using unjo.Core; +using unjo.Core.Entities.Sections; + +namespace unjo.Web.Sections +{ + /// + /// The dashboard aggregates data from all sections + /// + public class DashboardSection : ISection + { + /// + public string Alias => Constants.Sections.Dashboard; + + /// + public string Name => "@ui_sections_dashboard"; + + /// + public string Icon => "fth-pie-chart"; + + /// + public IList Children => null; + } +} diff --git a/unjo.Web/Sections/ListsSection.cs b/unjo.Web/Sections/ListsSection.cs new file mode 100644 index 00000000..26382f82 --- /dev/null +++ b/unjo.Web/Sections/ListsSection.cs @@ -0,0 +1,24 @@ +using System.Collections.Generic; +using unjo.Core; +using unjo.Core.Entities.Sections; + +namespace unjo.Web.Sections +{ + /// + /// Global list entities + /// + public class ListsSection : ISection + { + /// + public string Alias => Constants.Sections.Lists; + + /// + public string Name => "@ui_sections_lists"; + + /// + public string Icon => "fth-layers"; + + /// + public IList Children => null; + } +} diff --git a/unjo.Web/Sections/MediaSection.cs b/unjo.Web/Sections/MediaSection.cs new file mode 100644 index 00000000..a7a6e52f --- /dev/null +++ b/unjo.Web/Sections/MediaSection.cs @@ -0,0 +1,24 @@ +using System.Collections.Generic; +using unjo.Core; +using unjo.Core.Entities.Sections; + +namespace unjo.Web.Sections +{ + /// + /// Media items (images, videos, documents) grouped in folders + /// + public class MediaSection : ISection + { + /// + public string Alias => Constants.Sections.Media; + + /// + public string Name => "@ui_sections_media"; + + /// + public string Icon => "fth-image"; + + /// + public IList Children => null; + } +} diff --git a/unjo.Web/Sections/PagesSection.cs b/unjo.Web/Sections/PagesSection.cs new file mode 100644 index 00000000..8855893b --- /dev/null +++ b/unjo.Web/Sections/PagesSection.cs @@ -0,0 +1,24 @@ +using System.Collections.Generic; +using unjo.Core; +using unjo.Core.Entities.Sections; + +namespace unjo.Web.Sections +{ + /// + /// Manage the page tree in this section + /// + public class PagesSection : ISection + { + /// + public string Alias => Constants.Sections.Pages; + + /// + public string Name => "@ui_sections_pages"; + + /// + public string Icon => "fth-folder"; + + /// + public IList Children => null; + } +} diff --git a/unjo.Web/Sections/SettingsSection.cs b/unjo.Web/Sections/SettingsSection.cs new file mode 100644 index 00000000..4ca56bb0 --- /dev/null +++ b/unjo.Web/Sections/SettingsSection.cs @@ -0,0 +1,24 @@ +using System.Collections.Generic; +using unjo.Core; +using unjo.Core.Entities.Sections; + +namespace unjo.Web.Sections +{ + /// + /// Website and backoffice settings + /// + public class SettingsSection : ISection + { + /// + public string Alias => Constants.Sections.Settings; + + /// + public string Name => "@ui_sections_settings"; + + /// + public string Icon => "fth-settings"; + + /// + public IList Children => null; + } +} diff --git a/unjo.Web/Startup.cs b/unjo.Web/Startup.cs new file mode 100644 index 00000000..f43b1faa --- /dev/null +++ b/unjo.Web/Startup.cs @@ -0,0 +1,36 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +namespace unjo.Web +{ + public class Startup + { + // This method gets called by the runtime. Use this method to add services to the container. + // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 + public void ConfigureServices(IServiceCollection services) + { + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseRouting(); + + app.UseEndpoints(endpoints => + { + endpoints.MapGet("/", async context => + { + await context.Response.WriteAsync("Hello World!"); + }); + }); + } + } +} diff --git a/unjo.Web/app.js b/unjo.Web/app.js new file mode 100644 index 00000000..aac70c93 --- /dev/null +++ b/unjo.Web/app.js @@ -0,0 +1,6 @@ +import Vue from 'vue' +import App from 'cmp/app.vue' +import 'filter/generic.js' +import 'directive/filedrop.js' + +new Vue(App).$mount('#app'); \ No newline at end of file diff --git a/unjo.Web/appSettings.Development.json b/unjo.Web/appSettings.Development.json new file mode 100644 index 00000000..85114ea8 --- /dev/null +++ b/unjo.Web/appSettings.Development.json @@ -0,0 +1,26 @@ +{ + "Raven": { + "Url": "http://127.0.0.1:9800", + "Database": "fiftyone" + }, + + "Redis": { + "Url": "127.0.0.1:6379", + "Database": 3 + }, + + "Ebanking": { + "Automation": { + "TwoFactorAppPath": "C:\\Users\\cee\\AppData\\Roaming\\Raiffeisen_pushTAN\\pushTAN\\Raiffeisen_pushTAN.exe" + } + }, + + "Logging": { + "LogLevel": { + "Default": "Warning", + "System": "Warning", + "Microsoft": "Warning", + "Fifty": "Debug" + } + } +} \ No newline at end of file diff --git a/unjo.Web/appSettings.json b/unjo.Web/appSettings.json new file mode 100644 index 00000000..bb1dc7e2 --- /dev/null +++ b/unjo.Web/appSettings.json @@ -0,0 +1,91 @@ +{ + "SystemUserId": "system", + + "SessionDurationInMinutes": 60, + + "SyncStartDate": "2018-01-01T00:00:00", + + "AccountantPdfPassword": "r1528", + + "Reports": { + "StartDate": "2019-04-01T00:00:00", + "ProgressNo": 116, + "DueTo": { + "Months": 1, + "Days": 15 + }, + "InitialShare": { + "tobi": { + "Income_2019": 16367.12, + "Expense_2019": -4456.84, + "Payout_2019": -3600, + "SVA_2019": -2100, + "TAX_E_2019": -658, + "TAX_U_2019": -1040.84, + "Summary": -14493.26 + }, + "chris": { + "Income_2019": 68447.12, + "Expense_2019": -22159.63, + "Payout_2019": -15000, + "SVA_2019": -6000, + "TAX_E_2019": -4424, + "TAX_U_2019": -6743.76, + "Summary": 30444.27 + } + } + }, + + "Folders": { + "Invoices": "Media/Invoices", + "Reports": "Media/Reports", + "Avatars": "Media/Avatars", + "Clients": "Media/Clients", + "Temp": "Temp" + }, + + "Ebanking": { + "Automation": { + "BrowserPath": "C:\\Program Files\\Mozilla Firefox\\firefox.exe", + "TwoFactorAppPath": "C:\\Users\\Administrator\\AppData\\Roaming\\Raiffeisen_pushTAN\\pushTAN\\Raiffeisen_pushTAN.exe" + }, + "Raiffeisen": { + "Username": "3V371389", + "Pin": "20146", + "State": "3", + "IBAN": "AT543406000008237885", + "CreditcardId": "2339d46c6e72eea8472d6b498ac6d603", + "TwoFactorPin": "52777" + }, + "Paypal": { + "Token": "AeQA-N0AviBKvnwM5gVhNyxAiE1Zh5uJftPeuGMHhdtlrzpL6yFB1quDeUsgzSZPtB1z2rUA4xFJjl38", + "Secret": "EIR61tk7l9UELRnq9xB1YrXba2H0gXFgPyUjSP8YamZFR8E-BZ-kpWzPsH1XRJ-OIPpIB6HvGWxm5OXu" + } + }, + + "Raven": { + "Url": "http://127.0.0.1:9800", + "Database": "fifty" + }, + + "Redis": { + "Url": "127.0.0.1:6388", + "Database": 0 + }, + + "Frontend": { + "SearchResultsPerPage": 20, + "FlowPerPage": 30 + }, + + "Logging": { + "Json": true, + "IncludeScopes": false, + "PathFormat": "Logs/log-{Date}.txt", + "LogLevel": { + "Default": "Warning", + "System": "Warning", + "Microsoft": "Warning" + } + } +} \ No newline at end of file diff --git a/unjo.Web/config.js b/unjo.Web/config.js new file mode 100644 index 00000000..367029f3 --- /dev/null +++ b/unjo.Web/config.js @@ -0,0 +1,20 @@ +export default { + + isDebug: process.env.NODE_ENV !== 'production', + + apiBase: '/api', + + countries: [ + { value: 'austria', text: 'Austria' }, + { value: 'germany', text: 'Germany' }, + { value: 'usa', text: 'USA' } + ], + + categories: [ + { value: 'unknown', text: '' }, + { value: 'socialInsurance', text: 'SVA' }, + { value: 'tax', text: 'Tax' }, + { value: 'payout', text: 'Payout' }, + { value: 'payment', text: 'Payment' } + ] +}; \ No newline at end of file diff --git a/unjo.Web/package.json b/unjo.Web/package.json new file mode 100644 index 00000000..2deb8c7c --- /dev/null +++ b/unjo.Web/package.json @@ -0,0 +1,55 @@ +{ + "name": "unjo.web", + "version": "1.0.0", + "description": "", + "bin": { + "unjo.web": "app.js" + }, + "dependencies": { + "axios": "0.19.0", + "dayjs": "1.8.16", + "lodash": "4.17.15", + "tiptap": "1.26.3", + "tiptap-extensions": "1.28.3", + "vue": "2.6.10", + "vue-router": "3.1.3", + "vuex": "3.1.1" + }, + "devDependencies": { + "@babel/core": "7.6.3", + "@babel/preset-env": "7.6.3", + "aspnet-webpack": "3.0.0", + "babel-loader": "8.0.6", + "css-loader": "3.2.0", + "html-webpack-plugin": "3.2.0", + "mini-css-extract-plugin": "0.8.0", + "node-sass": "^4.13.1", + "optimize-css-assets-webpack-plugin": "5.0.3", + "sass-loader": "8.0.0", + "style-loader": "1.0.0", + "uglifyjs-webpack-plugin": "2.2.0", + "vue-loader": "15.7.1", + "vue-template-compiler": "2.6.10", + "webpack": "4.41.0", + "webpack-cli": "3.3.9", + "webpack-dev-server": "3.8.2", + "webpack-hot-middleware": "2.25.0", + "webpack-merge": "4.2.2" + }, + "peerDependencies": { + "vue-template-compiler": "2.6.10" + }, + "scripts": { + "dev": "webpack-dev-server --progress --hot --open", + "debug": "webpack --progress", + "build": "webpack --progress --config webpack.prod.js", + "update:packages": "node wipe.js && rm -rf node_modules && npm update --save-dev && npm update --save" + }, + "babel": { + "presets": [ + "@babel/env" + ] + }, + "author": "", + "license": "ISC" +} diff --git a/unjo.Web/router.js b/unjo.Web/router.js new file mode 100644 index 00000000..572afd38 --- /dev/null +++ b/unjo.Web/router.js @@ -0,0 +1,80 @@ +import Vue from 'vue'; +import VueRouter from 'vue-router'; +import Flow from 'view/flow'; +import Transaction from 'view/transaction'; +import Invoices from 'view/invoices'; +import InvoiceEdit from 'view/invoiceedit'; +import Clients from 'view/clients'; +import Client from 'view/client'; +import Changelog from 'view/changelog'; +import Rules from 'view/rules'; +import Reports from 'view/reports'; +import Report from 'view/report'; +import ReportCreate from 'view/reportcreate'; +import EventHub from 'utils/eventhub.js'; + +Vue.use(VueRouter); + +history.scrollRestoration = 'manual'; + +const routes = [ + + // flow + { path: '/', component: Flow, name: 'flow', meta: { title: 'Flow' } }, + { path: '/provider/:provider', component: Flow, name: 'flowProvider', props: true, meta: { title: 'Flow' } }, + { path: '/provider/:provider/page/:page', component: Flow, name: 'flowProviderAndPage', props: true, meta: { title: 'Flow' } }, + { path: '/page/:page', component: Flow, name: 'flowPage', props: true, meta: { title: 'Flow' } }, + { path: '/transaction/edit/:id', component: Transaction, name: 'transaction', props: true, meta: { title: 'Transaction' } }, + + // invoices + { path: '/invoices', component: Invoices, name: 'invoices', meta: { title: 'Invoices' } }, + { path: '/invoices/create', component: InvoiceEdit, name: 'invoiceCreate', meta: { title: 'Create invoice' } }, + { path: '/invoices/create/:id', component: InvoiceEdit, name: 'invoiceCreateFrom', props: true, meta: { title: 'Create invoice' } }, + { path: '/invoices/edit/:id', component: InvoiceEdit, name: 'invoiceEdit', props: true, meta: { title: 'Edit invoice' } }, + { path: '/invoices/:year', component: Invoices, name: 'invoicesYear', props: true, meta: { title: 'Invoices' } }, + + // clients + { path: '/clients', component: Clients, name: 'clients', meta: { title: 'Clients' } }, + { path: '/clients/edit/:id', component: Client, name: 'client', props: true, meta: { title: 'Client' } }, + + // changelog + { path: '/changelog', component: Changelog, name: 'changelog', meta: { title: 'Changelog' } }, + + // rules + { path: '/rules', component: Rules, name: 'rules', props: true, meta: { title: 'Rules' } }, + { path: '/rules/items', component: Rules, name: 'rulesItems', meta: { title: 'Rules' } }, + { path: '/rules/history', component: Rules, name: 'rulesHistory', meta: { title: 'Rules' } }, + { path: '/rules/edit/:id?', component: Rules, name: 'rules', props: true, meta: { title: 'Rules' } }, + + // reports + { path: '/reports', component: Reports, name: 'reports', meta: { title: 'Reports' } }, + { path: '/reports/edit/:id', component: Report, name: 'report', props: true, meta: { title: 'Report' } }, + { path: '/reports/create/:type?', component: ReportCreate, name: 'reportCreate', props: true, meta: { title: 'Report' } }, + { path: '/reports/:year', component: Reports, name: 'reportsYear', props: true, meta: { title: 'Reports' } } +]; + +const router = new VueRouter({ + mode: 'history', + routes: routes, + scrollBehavior(to, from, savedPosition) + { + return savedPosition ? savedPosition : { x: 0, y: 0 }; + //return new Promise((resolve, reject) => + //{ + // EventHub.$once('page-loaded', () => + // { + // console.info('pos', savedPosition); + // resolve(savedPosition ? savedPosition : { x: 0, y: 0 }); + // }); + //}); + } +}); + +router.beforeEach((to, from, next) => +{ + document.title = to.meta.title !== null ? to.meta.title + " | fifty" : "fifty"; + EventHub.$emit('dialog-close'); + next(); +}); + +export default router; \ No newline at end of file diff --git a/unjo.Web/unjo.Web.csproj b/unjo.Web/unjo.Web.csproj new file mode 100644 index 00000000..92605c5a --- /dev/null +++ b/unjo.Web/unjo.Web.csproj @@ -0,0 +1,7 @@ + + + + netcoreapp3.1 + + + diff --git a/unjo.Web/web.config b/unjo.Web/web.config new file mode 100644 index 00000000..e7635487 --- /dev/null +++ b/unjo.Web/web.config @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/unjo.Web/web.release.config b/unjo.Web/web.release.config new file mode 100644 index 00000000..280fd4a4 --- /dev/null +++ b/unjo.Web/web.release.config @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/unjo.Web/webpack.config.js b/unjo.Web/webpack.config.js new file mode 100644 index 00000000..69191b8f --- /dev/null +++ b/unjo.Web/webpack.config.js @@ -0,0 +1,61 @@ +const path = require('path'); +const VueLoaderPlugin = require('vue-loader/lib/plugin'); + +module.exports = { + + // entry point of the app + context: __dirname, + entry: { app: './app.js' }, + + // dev environment (gets overwritten by prod.js) + mode: 'development', + devtool: 'cheap-module-eval-source-map', + + // output paths + output: { + path: path.resolve(__dirname, 'wwwroot/Assets'), + filename: 'app.js', + publicPath: '/Assets/' + }, + + // map files to vue + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': __dirname, + 'api': path.join(__dirname, 'Api'), + 'cmp': path.join(__dirname, 'Components'), + 'store': path.join(__dirname, 'Utils'), + 'utils': path.join(__dirname, 'Utils'), + 'view': path.join(__dirname, 'Views'), + 'filter': path.join(__dirname, 'Utils'), + 'directive': path.join(__dirname, 'Utils') + } + }, + + // plugins to use + plugins: [ + new VueLoaderPlugin() + ], + + // modules to load + module: { + rules: [ + { + test: /\.vue$/, + exclude: /node_modules/, + loader: 'vue-loader' + }, + { + test: /\.js$/, + exclude: /node_modules/, + loader: 'babel-loader' + }, + { + test: /\.scss$/, + use: ["style-loader", "css-loader", "sass-loader"] + } + ] + } +}; \ No newline at end of file diff --git a/unjo.Web/webpack.prod.js b/unjo.Web/webpack.prod.js new file mode 100644 index 00000000..983c6f6c --- /dev/null +++ b/unjo.Web/webpack.prod.js @@ -0,0 +1,38 @@ +const merge = require('webpack-merge'); +const config = require('./webpack.config.js'); +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); +const UglifyJsPlugin = require("uglifyjs-webpack-plugin"); +const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin"); + +module.exports = merge(config, { + + mode: 'production', + devtool: 'source-map', + + plugins: [ + new MiniCssExtractPlugin({ + filename: "app.css", + chunkFilename: "[id].css" + }) + ], + + module: { + rules: [ + { + test: /\.scss$/, + use: [ MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader' ] + } + ] + }, + + optimization: { + minimizer: [ + new UglifyJsPlugin({ + cache: true, + parallel: true, + sourceMap: true + }), + new OptimizeCSSAssetsPlugin({}) + ] + } +}); \ No newline at end of file diff --git a/unjo.sln b/unjo.sln new file mode 100644 index 00000000..8c3095f0 --- /dev/null +++ b/unjo.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "unjo.Web", "unjo.Web\unjo.Web.csproj", "{8C14E4B1-8C00-4B4B-869B-4D2084ABE1F3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "unjo.Core", "unjo.Core\unjo.Core.csproj", "{7BFF3DDE-F910-4CE1-9B94-846059CE80DA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8C14E4B1-8C00-4B4B-869B-4D2084ABE1F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8C14E4B1-8C00-4B4B-869B-4D2084ABE1F3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8C14E4B1-8C00-4B4B-869B-4D2084ABE1F3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8C14E4B1-8C00-4B4B-869B-4D2084ABE1F3}.Release|Any CPU.Build.0 = Release|Any CPU + {7BFF3DDE-F910-4CE1-9B94-846059CE80DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7BFF3DDE-F910-4CE1-9B94-846059CE80DA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7BFF3DDE-F910-4CE1-9B94-846059CE80DA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7BFF3DDE-F910-4CE1-9B94-846059CE80DA}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {AD3F31B9-8BBB-4334-9571-F556B9E632C9} + EndGlobalSection +EndGlobal