Skip to content

Commit

Permalink
moved Dashboard related logic to its own package
Browse files Browse the repository at this point in the history
  • Loading branch information
YoussefSell committed Jul 30, 2022
1 parent 919cfc7 commit ff9d005
Show file tree
Hide file tree
Showing 138 changed files with 4,622 additions and 24 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
- name: Pack RavenSMS
run: dotnet pack --include-symbols -p:SymbolPackageFormat=snupkg --no-build -c Release src/RavenSMS/RavenSMS.csproj -o .

- name: Pack RavenSMS.Dashboard
run: dotnet pack --include-symbols -p:SymbolPackageFormat=snupkg --no-build -c Release src/RavenSMS.Dashboard/RavenSMS.Dashboard.csproj -o .

- name: Pack RavenSMS.Storage.EntityFramework
run: dotnet pack --include-symbols -p:SymbolPackageFormat=snupkg --no-build -c Release src/Storages/RavenSMS.Storage.EntityFramework/RavenSMS.Storage.EntityFramework.csproj -o .

Expand Down
7 changes: 7 additions & 0 deletions RavenSMS.sln
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RavenSMS.Queue.Hangfire", "
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RavenSMS.Storage.EntityFramework", "src\Storages\RavenSMS.Storage.EntityFramework\RavenSMS.Storage.EntityFramework.csproj", "{5FCC1F31-A0AA-40A3-A9B0-A532192CE385}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RavenSMS.Dashboard", "src\RavenSMS.Dashboard\RavenSMS.Dashboard.csproj", "{B07E56CC-D508-4482-A266-E442E6140F32}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -65,6 +67,10 @@ Global
{5FCC1F31-A0AA-40A3-A9B0-A532192CE385}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5FCC1F31-A0AA-40A3-A9B0-A532192CE385}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5FCC1F31-A0AA-40A3-A9B0-A532192CE385}.Release|Any CPU.Build.0 = Release|Any CPU
{B07E56CC-D508-4482-A266-E442E6140F32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B07E56CC-D508-4482-A266-E442E6140F32}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B07E56CC-D508-4482-A266-E442E6140F32}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B07E56CC-D508-4482-A266-E442E6140F32}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -78,6 +84,7 @@ Global
{C4BEFCCD-E8AD-40E7-B06C-3D704C5EED2A} = {57788BE8-09B8-4941-952B-4FFA6761EA1F}
{61BE2583-137C-43FA-93D5-2256A19DDD33} = {57788BE8-09B8-4941-952B-4FFA6761EA1F}
{5FCC1F31-A0AA-40A3-A9B0-A532192CE385} = {ECCF0CC7-8162-4213-91CF-5E97DAD0E5CA}
{B07E56CC-D508-4482-A266-E442E6140F32} = {34944EE8-4EC1-4088-B8B6-060042EFF8E0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4B897765-B7F9-489A-867D-DD0BA98C6A36}
Expand Down
2 changes: 2 additions & 0 deletions samples/RavenSMS.Samples.AspCore/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
builder.Services
.AddRavenSMS(config =>
{
config.UseDashboard();

config.UseInMemoryQueue();
config.UseInMemoryStores();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<ItemGroup>
<ProjectReference Include="..\..\src\Queues\RavenSMS.Queue.Coravel\RavenSMS.Queue.Coravel.csproj" />
<ProjectReference Include="..\..\src\Queues\RavenSMS.Queue.Hangfire\RavenSMS.Queue.Hangfire.csproj" />
<ProjectReference Include="..\..\src\RavenSMS.Dashboard\RavenSMS.Dashboard.csproj" />
<ProjectReference Include="..\..\src\RavenSMS\RavenSMS.csproj" />
<ProjectReference Include="..\..\src\Storages\RavenSMS.Storage.EntityFramework\RavenSMS.Storage.EntityFramework.csproj" />
</ItemGroup>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions src/RavenSMS.Dashboard/Configurations.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace Microsoft.Extensions.DependencyInjection;

/// <summary>
/// the Configurations class
/// </summary>
public static class Configurations
{
/// <summary>
/// configure the registration of the Dashboard
/// </summary>
/// <param name="builder">the <see cref="RavenSmsBuilder"/> instance</param>
public static RavenSmsBuilder UseDashboard(this RavenSmsBuilder builder)
{
builder.ServiceCollection.ConfigureOptions(typeof(RavenSmsUIConfigureOptions));
return builder;
}
}
File renamed without changes.
File renamed without changes.
178 changes: 178 additions & 0 deletions src/RavenSMS.Dashboard/Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

// clean the outputs folders
clean: ['Assets/build/*', 'Assets/temp/'],

// load images and fonts
copy: {
fonts: {
expand: true,
flatten: true,
src: 'node_modules/@fortawesome/fontawesome-free/webfonts/*',
dest: 'Assets/build/webfonts/',
},
images: {
expand: true,
flatten: true,
src: 'Assets/src/images/**',
dest: 'Assets/build/media/images/',
},
},

// process css
sass: {
'app-styles': {
files: {
'Assets/temp/css/app.css': 'Assets/src/scss/styles.scss',
},
},
'app-pages-messages-preview': {
files: {
'Assets/temp/css/messages.preview.page.min.css': 'Assets/src/scss/pages/messages/preview.page.scss',
},
},
},

// minify css files
cssmin: {
css: {
files: {
'Assets/build/css/app.min.css': 'Assets/temp/css/app.css',
'Assets/build/css/messages.preview.page.min.css': 'Assets/temp/css/messages.preview.page.min.css',
'Assets/build/css/vendor.min.css': ['node_modules/jquery-toast-plugin/dist/jquery.toast.min.css', 'node_modules/@fortawesome/fontawesome-free/css/all.min.css'],
},
},
},

// process js
concat: {
'vendor-js': {
src: [
'node_modules/@fortawesome/fontawesome-free/js/fontawesome.min.js',
'node_modules/@popperjs/core/dist/umd/popper.min.js',
'node_modules/bootstrap/dist/js/bootstrap.min.js',
'node_modules/jquery/dist/jquery.min.js',
'node_modules/moment/min/moment.min.js',
],
dest: 'Assets/temp/js/vendor.js',
},
'jquery-validation': {
src: [
'node_modules/jquery-validation/dist/jquery.validate.min.js', //
'node_modules/jquery-validation-unobtrusive/dist/jquery.validate.unobtrusive.min.js',
'node_modules/jquery-ajax-unobtrusive/dist/jquery.unobtrusive-ajax.min.js',
],
dest: 'Assets/temp/js/jquery.validation.js',
},
'app-js': {
src: ['Assets/src/js/app.js'],
dest: 'Assets/temp/js/app.js',
},
// the dashboard
'app-js-pages-dashboard': {
src: ['node_modules/chart.js/dist/chart.min.js', 'Assets/src/js/pages/dashboard.js'],
dest: 'Assets/temp/js/dashboard.page.js',
},
// the messages management pages
'app-js-pages-messages-index': {
src: ['Assets/src/js/pages/messages/index.js'],
dest: 'Assets/temp/js/messages.index.page.js',
},
'app-js-pages-messages-preview': {
src: ['node_modules/jquery-toast-plugin/dist/jquery.toast.min.js', 'Assets/src/js/pages/messages/preview.js'],
dest: 'Assets/temp/js/messages.preview.page.js',
},
'app-js-pages-messages-add': {
src: ['Assets/src/js/pages/messages/add.js'],
dest: 'Assets/temp/js/messages.add.page.js',
},
// the clients management pages
'app-js-pages-clients-index': {
src: ['node_modules/jquery-toast-plugin/dist/jquery.toast.min.js', 'Assets/src/js/pages/clients/index.js'],
dest: 'Assets/temp/js/clients.index.page.js',
},
'app-js-pages-clients-preview': {
src: ['Assets/src/js/libs/qrcode.min.js', 'Assets/src/js/pages/clients/preview.js'],
dest: 'Assets/temp/js/clients.preview.page.js',
},
'app-js-pages-clients-add': {
src: ['Assets/src/js/pages/clients/add.js'],
dest: 'Assets/temp/js/clients.add.page.js',
},
'app-js-pages-clients-setup': {
src: ['Assets/src/js/libs/qrcode.min.js', 'Assets/src/js/pages/clients/setup.js'],
dest: 'Assets/temp/js/clients.setup.page.js',
},
},

// minify js files
uglify: {
// external libs
'vendor-js': {
src: 'Assets/temp/js/vendor.js',
dest: 'Assets/build/js/vendor.min.js',
},
'jquery-validation-js': {
src: 'Assets/temp/js/jquery.validation.js',
dest: 'Assets/build/js/jquery.validation.min.js',
},
// the dashboard
'app-js': {
src: 'Assets/temp/js/app.js',
dest: 'Assets/build/js/app.min.js',
},
'app-js-pages-dashboard': {
src: 'Assets/temp/js/dashboard.page.js',
dest: 'Assets/build/js/dashboard.page.min.js',
},
// the messages management pages
'app-js-pages-messages-add': {
src: 'Assets/temp/js/messages.add.page.js',
dest: 'Assets/build/js/messages.add.page.min.js',
},
'app-js-pages-messages-index': {
src: 'Assets/temp/js/messages.index.page.js',
dest: 'Assets/build/js/messages.index.page.min.js',
},
'app-js-pages-messages-preview': {
src: 'Assets/temp/js/messages.preview.page.js',
dest: 'Assets/build/js/messages.preview.page.min.js',
},
// the clients management pages
'app-js-pages-clients-add': {
src: 'Assets/temp/js/clients.add.page.js',
dest: 'Assets/build/js/clients.add.page.min.js',
},
'app-js-pages-clients-index': {
src: 'Assets/temp/js/clients.index.page.js',
dest: 'Assets/build/js/clients.index.page.min.js',
},
'app-js-pages-clients-preview': {
src: 'Assets/temp/js/clients.preview.page.js',
dest: 'Assets/build/js/clients.preview.page.min.js',
},
'app-js-pages-clients-setup': {
src: 'Assets/temp/js/clients.setup.page.js',
dest: 'Assets/build/js/clients.setup.page.min.js',
},
},
});

// load plugins
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');

// tasks aliases
grunt.registerTask('clean_temp', 'clean:1');

// Default task(s).
grunt.registerTask('default', ['clean', 'copy', 'sass', 'cssmin', 'concat', 'uglify', 'clean_temp']);
};
42 changes: 42 additions & 0 deletions src/RavenSMS.Dashboard/RavenSMS.Dashboard.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>true</ImplicitUsings>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
</PropertyGroup>

<PropertyGroup>
<Title>RavenSMS.Dashboard</Title>
<PackageId>RavenSMS.Dashboard</PackageId>
<PackageTags>RavenSMS; SMS; RavenSMS Dashboard</PackageTags>
<Description>RavenSMS SMS delivery channel.</Description>
</PropertyGroup>

<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="6.0.7" />
<PackageReference Include="Result.Net" Version="1.3.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.1" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Assets\build\css\**\*" />
<EmbeddedResource Include="Assets\build\js\**\*" />
<EmbeddedResource Include="Assets\build\media\**\*" />
<EmbeddedResource Include="Assets\build\webfonts\**\*" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\RavenSMS\RavenSMS.csproj" />
</ItemGroup>

</Project>
29 changes: 29 additions & 0 deletions src/RavenSMS.Dashboard/_global.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
global using Microsoft.AspNetCore.Builder;
global using Microsoft.AspNetCore.Hosting;
global using Microsoft.AspNetCore.Mvc;
global using Microsoft.AspNetCore.Mvc.RazorPages;
global using Microsoft.AspNetCore.Routing;
global using Microsoft.AspNetCore.SignalR;
global using Microsoft.AspNetCore.StaticFiles;
global using Microsoft.Extensions.DependencyInjection;
global using Microsoft.Extensions.FileProviders;
global using Microsoft.Extensions.Localization;
global using Microsoft.Extensions.Logging;
global using Microsoft.Extensions.Options;
global using RavenSMS;
global using RavenSMS.Enums;
global using RavenSMS.Exceptions;
global using RavenSMS.Internal.Constants;
global using RavenSMS.Internal.Managers;
global using RavenSMS.Internal.Queues.InMemory;
global using RavenSMS.Internal.Services;
global using RavenSMS.Internal.Stores.InMemory;
global using RavenSMS.Internal.Utilities;
global using RavenSMS.Managers;
global using RavenSMS.Models;
global using RavenSMS.Models.Filters;
global using RavenSMS.Stores;
global using ResultNet;
global using System.Collections.Concurrent;
global using System.ComponentModel.DataAnnotations;
global using RavenSMS.Events;
Loading

0 comments on commit ff9d005

Please sign in to comment.