├── .DS_Store ├── .gitattributes ├── .gitignore ├── CONTRIBUTING.md ├── ENGINEERING-GUIDELINES.md ├── LICENSE ├── NuGet.Config ├── README.md ├── SSW.MusicStore.WebUI.sln ├── global.json └── src ├── .DS_Store └── SSW.MusicStore.Web ├── .DS_Store ├── Program.cs ├── Properties ├── AssemblyInfo.cs ├── PublishProfiles │ ├── angular2-musicstore - Web Deploy-publish.ps1 │ └── angular2-musicstore - Web Deploy.pubxml └── launchSettings.json ├── README.md ├── SSW.MusicStore.Web.xproj ├── Startup.cs ├── app ├── app.module.ts ├── components │ ├── album │ │ ├── album-summary.component.css │ │ ├── album-summary.component.html │ │ ├── album-summary.component.ts │ │ ├── album-template.component.css │ │ ├── album-template.component.html │ │ ├── album-template.component.ts │ │ ├── album.component.html │ │ └── album.component.ts │ ├── app │ │ ├── app.component.css │ │ ├── app.component.html │ │ └── app.component.ts │ ├── cart │ │ ├── cart.component.css │ │ ├── cart.component.html │ │ └── cart.component.ts │ ├── checkout │ │ ├── checkout.component.css │ │ ├── checkout.component.html │ │ └── checkout.component.ts │ ├── dashboard │ │ ├── dashboard.component.css │ │ ├── dashboard.component.html │ │ └── dashboard.component.ts │ ├── genre │ │ ├── genre-detail.component.css │ │ ├── genre-detail.component.html │ │ ├── genre-detail.component.ts │ │ ├── genres.component.css │ │ ├── genres.component.html │ │ └── genres.component.ts │ ├── loading │ │ ├── loading.indicator.component.css │ │ ├── loading.indicator.component.html │ │ └── loading.indicator.component.ts │ ├── login │ │ ├── login.component.css │ │ ├── login.component.html │ │ └── login.component.ts │ ├── order │ │ ├── order.component.css │ │ ├── order.component.html │ │ └── order.component.ts │ └── search │ │ ├── search.component.css │ │ ├── search.component.html │ │ └── search.component.ts ├── config.ts ├── index.html ├── main.ts ├── models.ts ├── polyfills.ts ├── route.config.ts └── services │ ├── album │ └── album.service.ts │ ├── cart │ └── cart.service.ts │ ├── checkout │ └── checkout.service.ts │ ├── genre │ └── genre.service.ts │ ├── loading │ └── loading.service.ts │ └── order │ └── order.service.ts ├── assets ├── img │ ├── BG-Blur.jpg │ ├── angular_logo.jpeg │ ├── banner-image-sale.png │ ├── header-logo-with-text-gray.png │ ├── header-logo.png │ ├── logo.svg │ ├── placeholder.png │ ├── placeholder.svg │ ├── ssw_logo.png │ └── user.png └── styles │ └── styles.css ├── favicon.ico ├── gulpfile.js ├── hosting.json ├── index-dist.html ├── package.json ├── project.json ├── system.js ├── tsconfig.json ├── tslint.json ├── web.Debug.config ├── web.Release.config ├── web.config └── wwwroot ├── assets └── img │ ├── BG-Blur.jpg │ ├── angular_logo.jpeg │ ├── banner-image-sale.png │ ├── header-logo-with-text-gray.png │ ├── header-logo.png │ ├── logo.svg │ ├── placeholder.png │ ├── placeholder.svg │ ├── ssw_logo.png │ └── user.png └── web.config /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSWConsulting/enterprise-musicstore-ui-angular2/ca2947e77a967f91e4b0b0cf080f0d1238ba404c/.DS_Store -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | privatesettings.json 13 | 14 | # Build results 15 | wwwroot/ 16 | node_modules/ 17 | typings/ 18 | staging/ 19 | **/app/**/*.js 20 | **/app/**/*.js.map 21 | 22 | # Build results 23 | [Dd]ebug/ 24 | [Dd]ebugPublic/ 25 | [Rr]elease/ 26 | [Rr]eleases/ 27 | x64/ 28 | x86/ 29 | build/ 30 | bld/ 31 | [Bb]in/ 32 | [Oo]bj/ 33 | 34 | # Visual Studio 2015 cache/options directory 35 | .vs/ 36 | 37 | # MSTest test Results 38 | [Tt]est[Rr]esult*/ 39 | [Bb]uild[Ll]og.* 40 | 41 | # NUNIT 42 | *.VisualState.xml 43 | TestResult.xml 44 | 45 | # Build Results of an ATL Project 46 | [Dd]ebugPS/ 47 | [Rr]eleasePS/ 48 | dlldata.c 49 | 50 | # DNX 51 | project.lock.json 52 | artifacts/ 53 | 54 | *_i.c 55 | *_p.c 56 | *_i.h 57 | *.ilk 58 | *.meta 59 | *.obj 60 | *.pch 61 | *.pdb 62 | *.pgc 63 | *.pgd 64 | *.rsp 65 | *.sbr 66 | *.tlb 67 | *.tli 68 | *.tlh 69 | *.tmp 70 | *.tmp_proj 71 | *.log 72 | *.vspscc 73 | *.vssscc 74 | .builds 75 | *.pidb 76 | *.svclog 77 | *.scc 78 | 79 | # Chutzpah Test files 80 | _Chutzpah* 81 | 82 | # Visual C++ cache files 83 | ipch/ 84 | *.aps 85 | *.ncb 86 | *.opensdf 87 | *.sdf 88 | *.cachefile 89 | 90 | # Visual Studio profiler 91 | *.psess 92 | *.vsp 93 | *.vspx 94 | 95 | # TFS 2012 Local Workspace 96 | $tf/ 97 | 98 | # Guidance Automation Toolkit 99 | *.gpState 100 | 101 | # ReSharper is a .NET coding add-in 102 | _ReSharper*/ 103 | *.[Rr]e[Ss]harper 104 | *.DotSettings.user 105 | 106 | # JustCode is a .NET coding add-in 107 | .JustCode 108 | 109 | # TeamCity is a build add-in 110 | _TeamCity* 111 | 112 | # DotCover is a Code Coverage Tool 113 | *.dotCover 114 | 115 | # NCrunch 116 | _NCrunch_* 117 | .*crunch*.local.xml 118 | 119 | # MightyMoose 120 | *.mm.* 121 | AutoTest.Net/ 122 | 123 | # Web workbench (sass) 124 | .sass-cache/ 125 | 126 | # Installshield output folder 127 | [Ee]xpress/ 128 | 129 | # DocProject is a documentation generator add-in 130 | DocProject/buildhelp/ 131 | DocProject/Help/*.HxT 132 | DocProject/Help/*.HxC 133 | DocProject/Help/*.hhc 134 | DocProject/Help/*.hhk 135 | DocProject/Help/*.hhp 136 | DocProject/Help/Html2 137 | DocProject/Help/html 138 | 139 | # Click-Once directory 140 | publish/ 141 | 142 | # Publish Web Output 143 | *.[Pp]ublish.xml 144 | *.azurePubxml 145 | ## TODO: Comment the next line if you want to checkin your 146 | ## web deploy settings but do note that will include unencrypted 147 | ## passwords 148 | #*.pubxml 149 | 150 | *.publishproj 151 | 152 | # NuGet Packages 153 | *.nupkg 154 | # The packages folder can be ignored because of Package Restore 155 | **/packages/* 156 | # except build/, which is used as an MSBuild target. 157 | !**/packages/build/ 158 | # Uncomment if necessary however generally it will be regenerated when needed 159 | #!**/packages/repositories.config 160 | 161 | # Windows Azure Build Output 162 | csx/ 163 | *.build.csdef 164 | 165 | # Windows Store app package directory 166 | AppPackages/ 167 | 168 | # Visual Studio cache files 169 | # files ending in .cache can be ignored 170 | *.[Cc]ache 171 | # but keep track of directories ending in .cache 172 | !*.[Cc]ache/ 173 | 174 | # Others 175 | ClientBin/ 176 | [Ss]tyle[Cc]op.* 177 | ~$* 178 | *~ 179 | *.dbmdl 180 | *.dbproj.schemaview 181 | *.pfx 182 | *.publishsettings 183 | node_modules/ 184 | orleans.codegen.cs 185 | 186 | # RIA/Silverlight projects 187 | Generated_Code/ 188 | 189 | # Backup & report files from converting an old project file 190 | # to a newer Visual Studio version. Backup files are not needed, 191 | # because we have git ;-) 192 | _UpgradeReport_Files/ 193 | Backup*/ 194 | UpgradeLog*.XML 195 | UpgradeLog*.htm 196 | 197 | # SQL Server files 198 | *.mdf 199 | *.ldf 200 | 201 | # Business Intelligence projects 202 | *.rdl.data 203 | *.bim.layout 204 | *.bim_*.settings 205 | 206 | # Microsoft Fakes 207 | FakesAssemblies/ 208 | 209 | # Node.js Tools for Visual Studio 210 | .ntvs_analysis.dat 211 | 212 | # Visual Studio 6 build log 213 | *.plg 214 | 215 | # Visual Studio 6 workspace options file 216 | *.opt 217 | 218 | # LightSwitch generated files 219 | GeneratedArtifacts/ 220 | _Pvt_Extensions/ 221 | ModelManifest.xml 222 | /src/SSW.MusicStore.Web/app/raygun.ts 223 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contributing 2 | ====== 3 | 4 | Information on contributing to this repo is in the [Contributing Guide](https://github.com/SSWConsulting/Home/blob/master/CONTRIBUTING.md) in the Home repo. 5 | -------------------------------------------------------------------------------- /ENGINEERING-GUIDELINES.md: -------------------------------------------------------------------------------- 1 | Engineering Guildelines 2 | ====== 3 | 4 | Information on engineering guidelines for this repo are in the [Engineering Guidelines](https://github.com/SSWConsulting/Home/blob/master/ENGINEERING-GUIDELINES.md) in the Home repo. 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /NuGet.Config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SSW Enterprise Angular Music Store 2 | 3 | **Note:** that this seed project requires your computer has the following dependencies installed globally at this version or higher (read below for details on how to install these): 4 | - node v4.x.x and npm v2.14.7 5 | - dnvm v1.0.0-rc2 6 | - typescript 1.7x 7 | - gulp v3x 8 | 9 | We recommend you use the latest version of Visual Studio 2015 update 2 or Visual Studio Code 10 | 11 | ### In order to run the Music Store: 12 | #### 1. Clone the project 13 | ```bash 14 | git clone https://github.com/SSWConsulting/enterprise-musicstore-ui-angular2 15 | cd enterprise-musicstore-ui-angular2\src\SSW.MusicStore.Web 16 | ``` 17 | #### 2. Install the project's dependencies 18 | This can also be done in Visual Studio VS2015 by building the project or pressing "ctrl + shft + B" 19 | ```bash 20 | npm install 21 | dnu restore 22 | tsc 23 | ``` 24 | #### 3. Run the project 25 | This can also be done in Visual Studio VS2015 by running the application or pressing "ctrl + F5" to start with out debugging 26 | ```bash 27 | dnx web 28 | ``` 29 | Navigate to http://localhost:5000/dist/app to view the site in the browser. 30 | 31 | # Building to wwwroot for production 32 | 33 | #### 1. Run gulp task to execute production build 34 | ```bash 35 | gulp build 36 | ``` 37 | 38 | ### How to install global dependencies on your computer 39 | 1. Install node v4 or higher from here https://nodejs.org/en/ 40 | Node installs npm at the same time so no need to install it seperately 41 | 2. With npm installed you can now install typescript and gulp globally with the following command 42 | 43 | ```bash 44 | npm install typescipt gulp -g 45 | ``` 46 | 47 | ### Contributing 48 | We would love you to contribute to the solution. Please feel free to improve the project and issue a pull request. 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /SSW.MusicStore.WebUI.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25029.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{754A3217-208E-4C24-A820-64A58F4D2A09}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D086A669-6537-4AC5-B4F7-2A35345C6B37}" 9 | ProjectSection(SolutionItems) = preProject 10 | global.json = global.json 11 | EndProjectSection 12 | EndProject 13 | Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "SSW.MusicStore.Web", "src\SSW.MusicStore.Web\SSW.MusicStore.Web.xproj", "{129405A3-5D2A-4159-BB76-2FE91F98FACA}" 14 | EndProject 15 | Global 16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 17 | Debug|Any CPU = Debug|Any CPU 18 | Release|Any CPU = Release|Any CPU 19 | EndGlobalSection 20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 21 | {129405A3-5D2A-4159-BB76-2FE91F98FACA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 22 | {129405A3-5D2A-4159-BB76-2FE91F98FACA}.Debug|Any CPU.Build.0 = Debug|Any CPU 23 | {129405A3-5D2A-4159-BB76-2FE91F98FACA}.Release|Any CPU.ActiveCfg = Release|Any CPU 24 | {129405A3-5D2A-4159-BB76-2FE91F98FACA}.Release|Any CPU.Build.0 = Release|Any CPU 25 | EndGlobalSection 26 | GlobalSection(SolutionProperties) = preSolution 27 | HideSolutionNode = FALSE 28 | EndGlobalSection 29 | GlobalSection(NestedProjects) = preSolution 30 | {129405A3-5D2A-4159-BB76-2FE91F98FACA} = {754A3217-208E-4C24-A820-64A58F4D2A09} 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "projects": [ "src", "test" ] 3 | } 4 | -------------------------------------------------------------------------------- /src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSWConsulting/enterprise-musicstore-ui-angular2/ca2947e77a967f91e4b0b0cf080f0d1238ba404c/src/.DS_Store -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSWConsulting/enterprise-musicstore-ui-angular2/ca2947e77a967f91e4b0b0cf080f0d1238ba404c/src/SSW.MusicStore.Web/.DS_Store -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/Program.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Microsoft.AspNetCore.Hosting; 3 | 4 | namespace SSW.MusicStore.Web 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | var host = new WebHostBuilder() 11 | .UseKestrel() 12 | .UseContentRoot(Directory.GetCurrentDirectory()) 13 | .UseIISIntegration() 14 | .UseWebRoot("") 15 | .UseStartup() 16 | .Build(); 17 | 18 | host.Run(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SSW.MusicStore.Web")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SSW.MusicStore.Web")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("129405a3-5d2a-4159-bb76-2fe91f98faca")] 24 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/Properties/PublishProfiles/angular2-musicstore - Web Deploy-publish.ps1: -------------------------------------------------------------------------------- 1 | [cmdletbinding(SupportsShouldProcess=$true)] 2 | param($publishProperties, $packOutput, $nugetUrl) 3 | 4 | # to learn more about this file visit http://go.microsoft.com/fwlink/?LinkId=524327 5 | $publishModuleVersion = '1.0.1' 6 | function Get-VisualStudio2015InstallPath{ 7 | [cmdletbinding()] 8 | param() 9 | process{ 10 | $keysToCheck = @('hklm:\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0', 11 | 'hklm:\SOFTWARE\Microsoft\VisualStudio\14.0', 12 | 'hklm:\SOFTWARE\Wow6432Node\Microsoft\VWDExpress\14.0', 13 | 'hklm:\SOFTWARE\Microsoft\VWDExpress\14.0' 14 | ) 15 | [string]$vsInstallPath=$null 16 | 17 | foreach($keyToCheck in $keysToCheck){ 18 | if(Test-Path $keyToCheck){ 19 | $vsInstallPath = (Get-itemproperty $keyToCheck -Name InstallDir -ErrorAction SilentlyContinue | select -ExpandProperty InstallDir -ErrorAction SilentlyContinue) 20 | } 21 | 22 | if($vsInstallPath){ 23 | break; 24 | } 25 | } 26 | 27 | $vsInstallPath 28 | } 29 | } 30 | 31 | $vsInstallPath = Get-VisualStudio2015InstallPath 32 | $publishModulePath = "{0}Extensions\Microsoft\Web Tools\Publish\Scripts\{1}\" -f $vsInstallPath, $publishModuleVersion 33 | 34 | if(!(Test-Path $publishModulePath)){ 35 | $publishModulePath = "{0}VWDExpressExtensions\Microsoft\Web Tools\Publish\Scripts\{1}\" -f $vsInstallPath, $publishModuleVersion 36 | } 37 | 38 | $defaultPublishSettings = New-Object psobject -Property @{ 39 | LocalInstallDir = $publishModulePath 40 | } 41 | 42 | function Enable-PackageDownloader{ 43 | [cmdletbinding()] 44 | param( 45 | $toolsDir = "$env:LOCALAPPDATA\Microsoft\Web Tools\Publish\package-downloader-$publishModuleVersion\", 46 | $pkgDownloaderDownloadUrl = 'http://go.microsoft.com/fwlink/?LinkId=524325') # package-downloader.psm1 47 | process{ 48 | if(get-module package-downloader){ 49 | remove-module package-downloader | Out-Null 50 | } 51 | 52 | if(!(get-module package-downloader)){ 53 | if(!(Test-Path $toolsDir)){ New-Item -Path $toolsDir -ItemType Directory -WhatIf:$false } 54 | 55 | $expectedPath = (Join-Path ($toolsDir) 'package-downloader.psm1') 56 | if(!(Test-Path $expectedPath)){ 57 | 'Downloading [{0}] to [{1}]' -f $pkgDownloaderDownloadUrl,$expectedPath | Write-Verbose 58 | (New-Object System.Net.WebClient).DownloadFile($pkgDownloaderDownloadUrl, $expectedPath) 59 | } 60 | 61 | if(!$expectedPath){throw ('Unable to download package-downloader.psm1')} 62 | 63 | 'importing module [{0}]' -f $expectedPath | Write-Output 64 | Import-Module $expectedPath -DisableNameChecking -Force 65 | } 66 | } 67 | } 68 | 69 | function Enable-PublishModule{ 70 | [cmdletbinding()] 71 | param() 72 | process{ 73 | if(get-module publish-module){ 74 | remove-module publish-module | Out-Null 75 | } 76 | 77 | if(!(get-module publish-module)){ 78 | $localpublishmodulepath = Join-Path $defaultPublishSettings.LocalInstallDir 'publish-module.psm1' 79 | if(Test-Path $localpublishmodulepath){ 80 | 'importing module [publish-module="{0}"] from local install dir' -f $localpublishmodulepath | Write-Verbose 81 | Import-Module $localpublishmodulepath -DisableNameChecking -Force 82 | $true 83 | } 84 | } 85 | } 86 | } 87 | 88 | try{ 89 | 90 | if (!(Enable-PublishModule)){ 91 | Enable-PackageDownloader 92 | Enable-NuGetModule -name 'publish-module' -version $publishModuleVersion -nugetUrl $nugetUrl 93 | } 94 | 95 | 'Calling Publish-AspNet' | Write-Verbose 96 | # call Publish-AspNet to perform the publish operation 97 | Publish-AspNet -publishProperties $publishProperties -packOutput $packOutput 98 | } 99 | catch{ 100 | "An error occurred during publish.`n{0}" -f $_.Exception.Message | Write-Error 101 | } -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/Properties/PublishProfiles/angular2-musicstore - Web Deploy.pubxml: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | MSDeploy 9 | False 10 | AzureWebSite 11 | Release 12 | Any CPU 13 | http://angular2-musicstore.azurewebsites.net 14 | True 15 | False 16 | False 17 | <_DefaultDNXVersion>dnx-clr-win-x86.1.0.0-rc1-final 18 | True 19 | web 20 | wwwroot 21 | wwwroot 22 | False 23 | False 24 | False 25 | angular2-musicstore.scm.azurewebsites.net:443 26 | angular2-musicstore 27 | 28 | False 29 | WMSVC 30 | True 31 | $angular2-musicstore 32 | <_SavePWD>True 33 | <_DestinationType>AzureWebSite 34 | 35 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5000", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "Hosting:Environment": "Development" 16 | } 17 | }, 18 | "web": { 19 | "commandName": "web", 20 | "environmentVariables": { 21 | "Hosting:Environment": "Development" 22 | } 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/README.md: -------------------------------------------------------------------------------- 1 | # SSW Angular Music Store 2 | ### Introduction Video 3 | https://youtu.be/HryBwVOJhDs 4 | 5 | **Note:** that this seed project requires: 6 | - node v4.x.x and npm v2.14.7 or higher 7 | - dnvm v1.0.0-rc2 8 | 9 | We recommend you use the latest version of Visual Studio 2015 update 2 or Visual Studio Code 10 | 11 | ### In order to run the Musc Store: 12 | #### 1. Clone the project 13 | ```bash 14 | git clone https://github.com/SSWConsulting/enterprise-musicstore-ui-angular2 15 | cd enterprise-musicstore-ui-angular2\src>cd SSW.MusicStore.Web 16 | ``` 17 | #### 2. Install the project's dependencies 18 | This can also be done in Visual Studio VS2015 by building the project or pressing "ctrl + shft + B" 19 | ```bash 20 | npm install 21 | dnu restore 22 | tsc 23 | ``` 24 | #### 3. Run the project 25 | This can also be done in Visual Studio VS2015 by running the application or pressing "ctrl + F5" to start with out debugging 26 | ```bash 27 | dnx web 28 | ``` 29 | 30 | # Building to wwwroot for production 31 | 32 | #### 1. Run gulp task to execute production build 33 | ```bash 34 | gulp build 35 | ``` 36 | 37 | ### Contributing 38 | We would love you to contribute to the solution. Please feel free to improve the project and issue a pull request. 39 | 40 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/SSW.MusicStore.Web.xproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | False 5 | 14.0 6 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 7 | 8 | 9 | 10 | 129405a3-5d2a-4159-bb76-2fe91f98faca 11 | SSW.MusicStore.Web 12 | ..\..\artifacts\obj\$(MSBuildProjectName) 13 | .\bin\ 14 | 15 | 16 | 2.0 17 | 33961 18 | True 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/Startup.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Microsoft.AspNetCore.Builder; 3 | using Microsoft.AspNetCore.Hosting; 4 | using Microsoft.Extensions.DependencyInjection; 5 | using Microsoft.Extensions.FileProviders; 6 | 7 | namespace SSW.MusicStore.Web 8 | { 9 | public class Startup 10 | { 11 | public void ConfigureServices(IServiceCollection services) 12 | { 13 | } 14 | 15 | public void Configure(IApplicationBuilder app, IHostingEnvironment environment) 16 | { 17 | // Route all unknown requests to app root 18 | app.Use(async (context, next) => 19 | { 20 | await next(); 21 | 22 | // If there's no available file and the request doesn't contain an extension, we're probably trying to access a page. 23 | // Rewrite request to use app root 24 | if (context.Response.StatusCode == 404 && !Path.HasExtension(context.Request.Path.Value)) 25 | { 26 | context.Request.Path = "/app/index.html"; 27 | await next(); 28 | } 29 | }); 30 | 31 | // Serve wwwroot as root 32 | app.UseFileServer(); 33 | 34 | var nodeModulesPath = 35 | Path.Combine(environment.ContentRootPath, "node_modules"); 36 | 37 | createFolderIfItDoesNotExist(nodeModulesPath); 38 | 39 | // Serve /node_modules as a separate root (for packages that use other npm modules client side) 40 | app.UseFileServer(new FileServerOptions() 41 | { 42 | // Set root of file server 43 | FileProvider = new PhysicalFileProvider(nodeModulesPath), 44 | // Only react to requests that match this path 45 | RequestPath = "/node_modules", 46 | // Don't expose file system 47 | EnableDirectoryBrowsing = false 48 | }); 49 | } 50 | 51 | private static void createFolderIfItDoesNotExist(string nodeModulesPath) 52 | { 53 | bool exists = System.IO.Directory.Exists(nodeModulesPath); 54 | 55 | if (!exists) 56 | System.IO.Directory.CreateDirectory(nodeModulesPath); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; 4 | import { HttpModule, Http } from '@angular/http'; 5 | import { RouterModule } from '@angular/router'; 6 | 7 | import { AppComponent } from './components/app/app.component'; 8 | import { AlbumDetailComponent } from './components/album/album.component'; 9 | import { AlbumSummary } from './components/album/album-summary.component'; 10 | import { AlbumTemplate } from './components/album/album-template.component'; 11 | import { CartComponent } from './components/cart/cart.component'; 12 | import { CheckoutComponent } from './components/checkout/checkout.component'; 13 | import { DashboardComponent } from './components/dashboard/dashboard.component'; 14 | import { GenreDetailComponent } from './components/genre/genre-detail.component'; 15 | import { GenresComponent } from './components/genre/genres.component'; 16 | import { LoadingIndicator } from './components/loading/loading.indicator.component'; 17 | import { LoginComponent } from './components/login/login.component'; 18 | import { OrderComponent } from './components/order/order.component'; 19 | import { Search } from './components/search/search.component'; 20 | 21 | import { AUTH_PROVIDERS } from 'angular2-jwt'; 22 | 23 | import { AlbumService } from './services/album/album.service'; 24 | import { GenreService } from './services/genre/genre.service'; 25 | import { CartService } from './services/cart/cart.service'; 26 | import { OrderService } from './services/order/order.service'; 27 | import { LoadingService } from './services/loading/loading.service'; 28 | import { CheckoutService } from './services/checkout/checkout.service'; 29 | 30 | import { ROUTES } from './route.config'; 31 | 32 | @NgModule({ 33 | declarations: [ 34 | AppComponent, 35 | AlbumDetailComponent, 36 | AlbumSummary, 37 | AlbumTemplate, 38 | CartComponent, 39 | CheckoutComponent, 40 | DashboardComponent, 41 | GenreDetailComponent, 42 | GenresComponent, 43 | LoadingIndicator, 44 | LoginComponent, 45 | OrderComponent, 46 | Search 47 | ], 48 | imports: [ 49 | BrowserModule, 50 | FormsModule, 51 | HttpModule, 52 | ReactiveFormsModule, 53 | RouterModule.forRoot(ROUTES, { useHash: false }) 54 | ], 55 | providers: [ 56 | ...AUTH_PROVIDERS, 57 | GenreService, 58 | AlbumService, 59 | CartService, 60 | OrderService, 61 | CheckoutService, 62 | LoadingService 63 | ], 64 | bootstrap: [AppComponent] 65 | }) 66 | export class AppModule { } 67 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/album/album-summary.component.css: -------------------------------------------------------------------------------- 1 | .card:hover { 2 | cursor: pointer; 3 | } 4 | 5 | .card { 6 | float: left; 7 | width: 32%; 8 | padding: .75rem; 9 | margin: 0.25rem; 10 | background-color: #fff; 11 | } 12 | 13 | .card > img { 14 | margin-bottom: .75rem; 15 | } 16 | 17 | .card-text { 18 | font-size: 75%; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/album/album-summary.component.html: -------------------------------------------------------------------------------- 1 |
2 | Album cover image 3 |

{{album.title}}

4 |
-------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/album/album-summary.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, Input} from '@angular/core'; 2 | import {Album} from '../../models'; 3 | 4 | @Component({ 5 | selector: 'album-summary', 6 | templateUrl: 'app/components/album/album-summary.component.html', 7 | styleUrls: ['app/components/album/album-summary.component.css'], 8 | }) 9 | 10 | export class AlbumSummary { 11 | @Input() album: Album; 12 | } 13 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/album/album-template.component.css: -------------------------------------------------------------------------------- 1 | .ms-album-detail { 2 | margin-top: 10px; 3 | background-color:#fff; 4 | } 5 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/album/album-template.component.html: -------------------------------------------------------------------------------- 1 |
2 | Card image cap 3 |
4 |

{{album?.title}}

5 |
6 | {{album?.price | currency}} 7 |
8 |
9 | {{album?.created | date}} 10 |
11 | 12 |

Please log in to add this item to your cart

13 |
14 |
-------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/album/album-template.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, Input, Output, EventEmitter} from '@angular/core'; 2 | import {Album, User} from '../../models'; 3 | import {tokenNotExpired} from 'angular2-jwt'; 4 | 5 | @Component({ 6 | selector: 'album-template', 7 | styleUrls: [ 8 | 'app/components/album/album-template.component.css' 9 | ], 10 | templateUrl: 'app/components/album/album-template.component.html' 11 | }) 12 | export class AlbumTemplate { 13 | @Input() album: Album; 14 | @Input() user: User; 15 | @Output('selected') selected = new EventEmitter(); 16 | 17 | onSelect(album) { 18 | this.selected.next(album); 19 | } 20 | 21 | loggedIn() { 22 | return tokenNotExpired(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/album/album.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Album Details

4 | 5 | 6 |
7 |
8 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/album/album.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, OnInit} from '@angular/core'; 2 | import {ActivatedRoute, Router} from '@angular/router'; 3 | import {Album} from '../../models'; 4 | import {AlbumService} from '../../services/album/album.service'; 5 | import {CartService} from '../../services/cart/cart.service'; 6 | 7 | @Component({ 8 | selector: 'album-detail', 9 | templateUrl: 'app/components/album/album.component.html' 10 | }) 11 | export class AlbumDetailComponent implements OnInit { 12 | album: Album; 13 | id: number; 14 | user: any; 15 | subscription: any; 16 | 17 | constructor(private _albumService: AlbumService, 18 | private _cartService: CartService, 19 | private _route: ActivatedRoute, private _router: Router) { 20 | this.setUser(); 21 | } 22 | 23 | ngOnInit() { 24 | if (!this.album) { 25 | this.subscription = this._route 26 | .params 27 | .subscribe((params) => { 28 | let id = +params['id']; 29 | 30 | this.id = parseInt(id.toString()); 31 | this.getAlbum(this.id); 32 | }); 33 | } 34 | } 35 | 36 | getAlbum(id: number) { 37 | this._albumService.getAlbum(id) 38 | .subscribe(album => { 39 | album.created = new Date(album.created.toString()); 40 | this.album = album; 41 | }, 42 | e => (window).toastr.error(`${e}`) 43 | ); 44 | } 45 | 46 | setUser() { 47 | let savedUser = JSON.parse(localStorage.getItem('user')); 48 | if (savedUser) { 49 | this.user = savedUser; 50 | }; 51 | } 52 | 53 | addToCart(album: Album) { 54 | this._cartService.addCartItem(album) 55 | .subscribe((cart) => { 56 | (window).toastr.success(`${album.title} successfully added to cart`); 57 | this._router.navigate([`/cart`]); 58 | } 59 | ); 60 | } 61 | 62 | goToGenre(album: Album) { 63 | this._router.navigate([`/genres`]); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/app/app.component.css: -------------------------------------------------------------------------------- 1 | 2 | .btn-group > .menu-dropdown { 3 | background-color: transparent; 4 | } 5 | 6 | .router-link { 7 | padding: 5px; 8 | text-decoration: none; 9 | } 10 | 11 | .router-link:visited, .router-link:link { 12 | color: #444; 13 | } 14 | 15 | .router-link:hover { 16 | color: white; 17 | text-decoration: none; 18 | } 19 | 20 | .router-link.router-link-active { 21 | color: white; 22 | } 23 | 24 | 25 | .header-bg { 26 | background-color: #373a3c; 27 | } 28 | 29 | .navbar-brand { 30 | margin:0; 31 | padding:0 32 | } 33 | 34 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/app/app.component.html: -------------------------------------------------------------------------------- 1 | 17 | 66 |
67 | 68 |
69 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import {Component} from '@angular/core'; 2 | import {Router } from '@angular/router'; 3 | import {GenreService} from '../../services/genre/genre.service'; 4 | import {Genre, User} from '../../models'; 5 | import {AUTH0_DOMAIN, AUTH0_CLIENT_ID } from '../../config'; 6 | import {tokenNotExpired, JwtHelper} from 'angular2-jwt'; 7 | 8 | declare var Auth0Lock: any; 9 | 10 | @Component({ 11 | selector: 'app', 12 | templateUrl: 'app/components/app/app.component.html', 13 | styleUrls: ['app/components/app/app.component.css'], 14 | }) 15 | export class AppComponent { 16 | title = 'SSW Angular 2 Music Store'; 17 | genres: Genre[] = []; 18 | user: User; 19 | lock: any; 20 | jwtHelper: JwtHelper = new JwtHelper(); 21 | 22 | constructor(private genreService: GenreService, public router: Router) { 23 | this.lock = new Auth0Lock(AUTH0_CLIENT_ID, AUTH0_DOMAIN); 24 | this.getGenres(); 25 | this.setUser(); 26 | (window).toastr.options.positionClass = 'toast-bottom-right'; 27 | } 28 | 29 | login() { 30 | this.lock.show((err: string, profile: string, id_token: string) => { 31 | 32 | if (err) { 33 | throw new Error(err); 34 | } 35 | 36 | localStorage.setItem('profile', JSON.stringify(profile)); 37 | localStorage.setItem('id_token', id_token); 38 | this.setUser(); 39 | location.reload(); 40 | }); 41 | } 42 | 43 | logout() { 44 | localStorage.removeItem('profile'); 45 | localStorage.removeItem('id_token'); 46 | localStorage.removeItem('user'); 47 | this.router.navigate([`/`]); 48 | } 49 | 50 | 51 | setUser() { 52 | let savedUser = JSON.parse(localStorage.getItem('profile')); 53 | if (savedUser) { 54 | this.user = savedUser; 55 | }; 56 | } 57 | 58 | loggedIn() { 59 | return tokenNotExpired(); 60 | } 61 | 62 | getGenres() { 63 | this.genreService.getGenres() 64 | .subscribe((genres) => { 65 | this.genres = genres; 66 | }); 67 | } 68 | 69 | goToGenre(genre: Genre) { 70 | this.router.navigate([`/genres/genre`, genre.name]); 71 | } 72 | 73 | 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/cart/cart.component.css: -------------------------------------------------------------------------------- 1 | table { 2 | background-color: #fff; 3 | } 4 | 5 | .card { 6 | background-color: #fff; 7 | border-radius: 0; 8 | } 9 | 10 | .ms-item .btn { 11 | display: none; 12 | } 13 | 14 | .ms-item:hover .btn { 15 | display: inline; 16 | } 17 | 18 | .ms-item:hover { 19 | background-color: #ededed 20 | } 21 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/cart/cart.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 |

No items in the cart

8 |
9 |
10 |
11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 25 | 26 | 27 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 |
ItemAmountPrice
22 | 23 | {{item.album.title}} 24 | {{item.count}}{{item.album.price}} 28 | 29 |
Total{{cart?.cartTotal}}
39 |
40 | 41 |
42 |
43 |
44 |
45 |
46 |
47 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/cart/cart.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { CartService } from '../../services/cart/cart.service'; 3 | import { CartItems } from '../../models'; 4 | import { Observable } from 'rxjs/Observable'; 5 | import { ActivatedRoute, Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; 6 | import { tokenNotExpired } from 'angular2-jwt'; 7 | 8 | 9 | @Component({ 10 | selector: 'cart', 11 | templateUrl: 'app/components/cart/cart.component.html', 12 | styleUrls: ['app/components/cart/cart.component.css'], 13 | }) 14 | 15 | export class CartComponent implements OnInit, CanActivate { 16 | cart: CartItems; 17 | 18 | canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | boolean { 19 | return tokenNotExpired(); 20 | } 21 | 22 | constructor(private _cartService: CartService, 23 | private _router: Router) { 24 | } 25 | 26 | ngOnInit() { 27 | this.getCart(); 28 | } 29 | 30 | getCart() { 31 | this._cartService.getCartItems() 32 | .subscribe(cart => { 33 | this.cart = cart; 34 | }); 35 | } 36 | 37 | removeCartItem(item) { 38 | this._cartService.removeItem(item) 39 | .subscribe(cart => { 40 | (window).toastr.error(`${item.album.title} successfully removed from the cart`); 41 | this.cart = cart; 42 | }); 43 | } 44 | 45 | gotToCheckout() { 46 | this._router.navigate([`/checkout`]); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/checkout/checkout.component.css: -------------------------------------------------------------------------------- 1 | .ng-valid[required] { 2 | border-left: 5px solid #42A948; 3 | } 4 | .ng-valid[required]:focus { 5 | border-color: rgba(66,169, 72, 0.7 ); 6 | box-shadow: 0 1px 1px rgba(66,169, 72, 0.7 ) inset, 0 0 8px rgba(66,169, 72, 0.7 ); 7 | outline: 0 none; 8 | } 9 | 10 | .ng-invalid { 11 | border-left: 5px solid #a94442; 12 | } 13 | 14 | .card { 15 | background-color: #fff; 16 | } -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/checkout/checkout.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |

Shopping Cart Form

7 |
8 |
9 | 10 | 13 |
14 | First Name is required 15 |
16 |
17 |
18 | 19 | 22 |
23 | Last Name is required 24 |
25 |
26 |
27 | 28 | 31 |
32 | Email is required 33 |
34 |
35 |
36 | 37 | 40 |
41 | Phone is required 42 |
43 |
44 |
45 | 46 | 49 |
50 | Address is required 51 |
52 |
53 |
54 |
55 |
56 | 57 | 60 |
61 | City is required 62 |
63 |
64 |
65 |
66 |
67 | 68 | 71 |
72 | Post code is required 73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | 81 | 86 |
87 | State is required 88 |
89 |
90 |
91 |
92 |
93 | 94 | 97 |
98 | Country is required 99 |
100 |
101 |
102 |
103 | 107 |
108 |
109 |
110 |
111 |
112 |
113 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/checkout/checkout.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { Order } from '../../models'; 3 | import { CheckoutService } from '../../services/checkout/checkout.service'; 4 | import { Observable } from 'rxjs/Observable'; 5 | import { ActivatedRoute, Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; 6 | import { tokenNotExpired } from 'angular2-jwt'; 7 | 8 | 9 | @Component({ 10 | selector: 'checkout', 11 | templateUrl: 'app/components/checkout/checkout.component.html', 12 | styleUrls: ['app/components/checkout/checkout.component.css'] 13 | }) 14 | export class CheckoutComponent { 15 | states = ['NSW', 'VIC', 'TAS', 'WA', 'SA', 'NT', 'QLD']; 16 | public submitted = false; 17 | 18 | canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | boolean { 19 | return tokenNotExpired(); 20 | } 21 | 22 | constructor(private _checkoutService: CheckoutService, 23 | private _router: Router) { 24 | } 25 | 26 | model = new Order(); 27 | 28 | onSubmit() { 29 | console.log(JSON.stringify(this.model)); 30 | this._checkoutService.postOrder(this.model). 31 | subscribe((order) => { 32 | (window).toastr.success(`successfully added order`); 33 | this._router.navigate([`/orders`]); 34 | }); 35 | 36 | this.submitted = true; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/dashboard/dashboard.component.css: -------------------------------------------------------------------------------- 1 | .ms-jumbotron { 2 | padding:35px 0; 3 | } 4 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/dashboard/dashboard.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 |
6 | 7 |
8 | 9 |
10 | 11 |
12 |
13 | 14 | 17 | 18 |
19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/dashboard/dashboard.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Album } from '../../models'; 3 | import { AlbumService } from '../../services/album/album.service'; 4 | import { LoadingService } from '../../services/loading/loading.service'; 5 | import { LoadingIndicator } from '../loading/loading.indicator.component'; 6 | import { Search } from '../search/search.component'; 7 | import { Router } from '@angular/router'; 8 | 9 | @Component({ 10 | selector: 'dashboard', 11 | templateUrl: 'app/components/dashboard/dashboard.component.html', 12 | styleUrls: ['app/components/dashboard/dashboard.component.css'] 13 | }) 14 | export class DashboardComponent implements OnInit { 15 | public albums: Album[] = []; 16 | searching: boolean; 17 | 18 | constructor(private _albumService: AlbumService, private _router: Router, private _loadingService: LoadingService) { 19 | } 20 | 21 | ngOnInit() { 22 | this.getPopularAlbums(); 23 | this._loadingService.toggleLoadingIndicator(true); 24 | } 25 | 26 | hide() { 27 | this.searching = true; 28 | alert(this.searching); 29 | } 30 | 31 | goToAlbumDetail(album: Album) { 32 | this._router.navigate([`/album`, album.albumId]); 33 | } 34 | 35 | getPopularAlbums() { 36 | this._albumService.getPopularAlbums() 37 | .subscribe(albums => { 38 | this.albums = albums; 39 | this._loadingService.toggleLoadingIndicator(false); 40 | }); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/genre/genre-detail.component.css: -------------------------------------------------------------------------------- 1 | [class*='col-'] { float: left; } 2 | 3 | *, *:after, *:before { 4 | -webkit-box-sizing: border-box; 5 | -moz-box-sizing: border-box; 6 | box-sizing: border-box; 7 | } 8 | 9 | h3 { text-align: center; margin-bottom: 0; } 10 | 11 | [class*='col-'] { padding-right: 20px; padding-bottom: 20px;} 12 | [class*='col-']:last-of-type { padding-right: 0; } 13 | 14 | .grid { margin: 0 10em; } 15 | .col-1-4 { width: 25%; } 16 | .module { 17 | padding: 20px; 18 | text-align: center; 19 | color: #eee; 20 | max-height: 120px; 21 | min-width: 120px; 22 | background-color: #1171a3; 23 | } 24 | 25 | .module:hover { background-color: #52b9e9; cursor: pointer; } 26 | 27 | .grid-pad { padding: 20px 0 20px 20px; } 28 | .grid-pad > [class*='col-']:last-of-type { padding-right: 20px; } 29 | 30 | @media (max-width: 600px) { 31 | .module { font-size: 10px; max-height: 75px; } 32 | } 33 | 34 | @media (max-width: 1024px) { 35 | .grid { margin: 0; } 36 | .module { min-width: 60px; } 37 | } 38 | 39 | .card { 40 | background-color :white; 41 | } 42 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/genre/genre-detail.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |

{{name}} Albums

6 |
7 |
8 | 11 | 12 |
13 |
-------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/genre/genre-detail.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, OnInit} from '@angular/core'; 2 | import {ActivatedRoute, Router} from '@angular/router'; 3 | import {Album} from '../../models'; 4 | import {GenreService} from '../../services/genre/genre.service'; 5 | import {AlbumSummary} from '../album/album-summary.component'; 6 | 7 | @Component({ 8 | selector: 'genre-detail', 9 | templateUrl: 'app/components/genre/genre-detail.component.html', 10 | styleUrls: ['app/components/genre/genre-detail.component.css'], 11 | inputs: ['genre'] 12 | }) 13 | export class GenreDetailComponent implements OnInit { 14 | albums: Album[]; 15 | subscription: any; 16 | 17 | constructor(private _genreService: GenreService, 18 | private _route: ActivatedRoute, private _router: Router) { 19 | } 20 | 21 | ngOnInit() { 22 | if (!this.albums) { 23 | this.subscription = this._route 24 | .params 25 | .subscribe((params) => { 26 | let name = params['name'].toString(); 27 | this.getGenreAlbums(name); 28 | }); 29 | } 30 | } 31 | 32 | getGenreAlbums(name: string) { 33 | this._genreService.getGenreAlbums(name) 34 | .subscribe(albums => 35 | this.albums = albums 36 | ); 37 | } 38 | 39 | goToAlbumDetail(album: Album) { 40 | this._router.navigate([`/album`, album.albumId]); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/genre/genres.component.css: -------------------------------------------------------------------------------- 1 | .genres {list-style-type: none; margin-left: 1em; padding: 0; width: 10em;} 2 | 3 | .genres li { cursor: pointer; position: relative; left: 0; transition: all 0.2s ease; } 4 | 5 | .genres li:hover {color: #369; background-color: #EEE; left: .2em;} 6 | 7 | .genres .badge { 8 | font-size: small; 9 | color: white; 10 | padding: 0.1em 0.7em; 11 | background-color: #369; 12 | line-height: 1em; 13 | position: relative; 14 | left: -1px; 15 | top: -1px; 16 | } 17 | .selected { background-color: #EEE; color: #369; } 18 | 19 | .list-group { 20 | margin-top: 15px; 21 | } -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/genre/genres.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 | 10 |
11 |
12 |
13 | 14 |
15 |
16 |
17 |
18 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/genre/genres.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Router } from '@angular/router'; 3 | import { GenreService } from '../../services/genre/genre.service'; 4 | import { Genre } from '../../models'; 5 | 6 | @Component({ 7 | selector: 'genres', 8 | templateUrl: 'app/components/genre/genres.component.html', 9 | styleUrls: ['app/components/genre/genres.component.css'] 10 | }) 11 | export class GenresComponent implements OnInit { 12 | public genres: Genre[]; 13 | 14 | constructor(private _genreService: GenreService, private _router: Router) { 15 | } 16 | 17 | ngOnInit() { 18 | this.getGenres(); 19 | } 20 | 21 | getGenres() { 22 | this.genres = []; 23 | this._genreService.getGenres() 24 | .subscribe(genres => this.genres = genres); 25 | } 26 | 27 | goToGenre(genre: Genre) { 28 | this._router.navigate([`/genres/genre`, genre.name]); 29 | } 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/loading/loading.indicator.component.css: -------------------------------------------------------------------------------- 1 | div { 2 | color: #fff; 3 | } -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/loading/loading.indicator.component.html: -------------------------------------------------------------------------------- 1 |
2 |   Loading... 3 |
-------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/loading/loading.indicator.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, ElementRef, OnInit, OnDestroy} from '@angular/core'; 2 | import {LoadingService} from '../../services/loading/loading.service'; 3 | 4 | @Component({ 5 | selector: 'loading-indicator', 6 | templateUrl: 'app/components/loading/loading.indicator.component.html', 7 | styleUrls: ['app/components/loading/loading.indicator.component.css'] 8 | }) 9 | export class LoadingIndicator implements OnInit, OnDestroy { 10 | private isLoading = false; 11 | private subscription: any; 12 | 13 | //we probably want a reference to ElementRef here to do some DOM manipulations 14 | constructor(public el: ElementRef, public loadingService: LoadingService) {} 15 | 16 | showOrHideLoadingIndicator(loading) { 17 | this.isLoading = loading; 18 | if (this.isLoading) this.playLoadingAnimation(); 19 | //else cancel the animation? 20 | } 21 | 22 | playLoadingAnimation() { 23 | //this will be your implementation to start the loading animation 24 | } 25 | 26 | ngOnInit() { 27 | this.subscription = this.loadingService.loading$.subscribe(loading => this.showOrHideLoadingIndicator(loading)); 28 | } 29 | 30 | ngOnDestroy() { 31 | this.subscription.unsubscribe(); 32 | } 33 | } -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/login/login.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSWConsulting/enterprise-musicstore-ui-angular2/ca2947e77a967f91e4b0b0cf080f0d1238ba404c/src/SSW.MusicStore.Web/app/components/login/login.component.css -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/login/login.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | Please login or register to acces this page 4 |
5 |
6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/login/login.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'login', 5 | templateUrl: 'app/components/login/login.component.html', 6 | styleUrls: ['app/components/login/login.component.css'] 7 | }) 8 | export class LoginComponent { } 9 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/order/order.component.css: -------------------------------------------------------------------------------- 1 | .card { 2 | background-color:#fff; 3 | } 4 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/order/order.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |

Orders

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
IdDateCost
{{order.orderId}}{{order.orderDate | date}}${{order.total}}
20 | 21 |
22 |
23 |
24 |
25 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/order/order.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { OrderService } from '../../services/order/order.service'; 3 | import { Order } from '../../models'; 4 | 5 | @Component({ 6 | selector: 'orders', 7 | templateUrl: 'app/components/order/order.component.html', 8 | styleUrls: ['app/components/order/order.component.css'] 9 | }) 10 | export class OrderComponent implements OnInit { 11 | public orders: any[] = []; 12 | 13 | constructor(private _orderService: OrderService) { 14 | } 15 | 16 | ngOnInit() { 17 | this.getOrders(); 18 | } 19 | 20 | getOrders() { 21 | this._orderService.getOrders() 22 | .subscribe(orders => 23 | orders.map((order: Order) => { 24 | return { 25 | orderId: order.orderId, 26 | orderDate: new Date(order.orderDate.toString()), 27 | total: order.total 28 | }; 29 | }).forEach((order) => { 30 | this.orders.push(order); 31 | }) 32 | ); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/search/search.component.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | .ms-search-results .dropdown-item { 4 | padding-left: .75rem; 5 | padding-right: .75rem; 6 | } 7 | 8 | .ms-search-results .ms-search-item:first-child { 9 | margin-top: .25rem; 10 | } 11 | 12 | .ms-search { 13 | width: 100%; 14 | } 15 | 16 | .ms-search .form-control { 17 | height: 100px; 18 | font-size: 60px; 19 | background-color: #fff; 20 | background-color: rgba(207, 70, 67, 0.7 ); 21 | color: white; 22 | border: 0; 23 | } 24 | 25 | .form-control::-webkit-input-placeholder { 26 | color: white; 27 | } 28 | 29 | .form-control:-moz-placeholder { 30 | color: white; 31 | } 32 | 33 | .form-control::-moz-placeholder { 34 | color: white; 35 | } 36 | 37 | .form-control:-ms-input-placeholder { 38 | color: white 39 | } 40 | 41 | .ms-search-result { 42 | background-color: #fff; 43 | } 44 | 45 | .ms-search-result .img-responsive { 46 | display: inline; 47 | } 48 | 49 | .ms-search-result { 50 | font-size: 25px; 51 | } 52 | 53 | .ms-search-result .btn { 54 | display: none; 55 | } 56 | 57 | .ms-search-result:hover .btn { 58 | display: inline; 59 | } 60 | 61 | .ms-search-result:hover { 62 | background-color: #ededed 63 | } 64 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/search/search.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | 13 | 14 | 19 | 20 | 21 |
15 | 16 | {{album.title}} 17 | 18 |
-------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/components/search/search.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, EventEmitter, ChangeDetectionStrategy, Output } from '@angular/core'; 2 | import { FormControl } from '@angular/forms'; 3 | import { Http } from '@angular/http'; 4 | import { AlbumService } from '../../services/album/album.service'; 5 | import { LoadingService } from '../../services/loading/loading.service'; 6 | import { LoadingIndicator } from '../loading/loading.indicator.component'; 7 | import { Album } from '../../models'; 8 | import { Observable } from 'rxjs/Observable'; 9 | import 'rxjs/add/operator/map'; 10 | import 'rxjs/add/operator/do'; 11 | import 'rxjs/add/operator/debounceTime'; 12 | import 'rxjs/add/operator/distinctUntilChanged'; 13 | import 'rxjs/add/operator/switchMap'; 14 | import 'rxjs/add/operator/merge'; 15 | import 'rxjs/add/operator/mapTo'; 16 | 17 | 18 | @Component({ 19 | selector: 'search', 20 | templateUrl: 'app/components/search/search.component.html', 21 | styleUrls: ['app/components/search/search.component.css'], 22 | changeDetection: ChangeDetectionStrategy.OnPush, 23 | providers: [AlbumService, LoadingService] 24 | }) 25 | 26 | export class Search { 27 | @Output('selected') selected = new EventEmitter(); 28 | 29 | clear = new EventEmitter(); 30 | 31 | searchText = new FormControl(); 32 | 33 | albums: Observable; 34 | 35 | constructor(http: Http, albumService: AlbumService, loadingService: LoadingService) { 36 | this.albums = this.searchText.valueChanges 37 | .debounceTime(500) 38 | .distinctUntilChanged() 39 | .do(() => { 40 | console.log("Loading started"); 41 | loadingService.toggleLoadingIndicator(true); 42 | }) 43 | .switchMap((val: string) => albumService.search(val).defaultIfEmpty([])) 44 | .do(() => { 45 | console.log("Loading finished"); 46 | loadingService.toggleLoadingIndicator(false); 47 | }) 48 | .merge(this.clear.mapTo([])); 49 | } 50 | 51 | onSelect(album) { 52 | this.selected.next(album); 53 | this.clear.next(''); 54 | } 55 | } 56 | 57 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/config.ts: -------------------------------------------------------------------------------- 1 | export const API_BASE = 'http://musicstore-api-aspnet.azurewebsites.net/api'; 2 | export const APP_BASE = 'http://localhost:5000'; 3 | export const AUTH0_CLIENT_ID = 'ikMjOLanjOske624faAjYe0Ve7cAOg33'; 4 | export const AUTH0_DOMAIN = 'ssw.au.auth0.com'; 5 | 6 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | Angular2 Music Store 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 35 | 36 | 37 | 44 | 45 | 46 | 47 | 48 |
49 |
50 | 51 |
52 |
53 |
54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/main.ts: -------------------------------------------------------------------------------- 1 | //import './polyfills'; 2 | 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | import { enableProdMode } from '@angular/core'; 5 | import { AppModule } from './app.module'; 6 | 7 | platformBrowserDynamic().bootstrapModule(AppModule); -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/models.ts: -------------------------------------------------------------------------------- 1 | export class Album { 2 | albumId: number; 3 | title: string; 4 | price: number; 5 | albumArtUrl: string; 6 | genres: Genre[]; 7 | artist: Artist[]; 8 | orderDetails: OrderDetails[]; 9 | created: Date; 10 | } 11 | 12 | export class User { 13 | email: string; 14 | picture: string; 15 | nickname: string; 16 | } 17 | 18 | 19 | export class Genre { 20 | id: number; 21 | name: string; 22 | descritpion: string; 23 | albums: string; 24 | } 25 | 26 | export class Artist { 27 | artistId: number; 28 | name: string; 29 | } 30 | 31 | export class CartItem { 32 | ablum: Album; 33 | count: number; 34 | cartId: number; 35 | dateCreated: Date; 36 | albumId: number; 37 | } 38 | 39 | export class CartItems { 40 | cartItem: CartItem[]; 41 | cartTotal: number; 42 | } 43 | 44 | export class Order { 45 | orderId: string; 46 | orderDate: Date; 47 | userName: string; 48 | firstName: string; 49 | lastName: string; 50 | address: string; 51 | city: string; 52 | state: string; 53 | postCode: string; 54 | country: string; 55 | phone: string; 56 | email: string; 57 | total: number; 58 | OrderDetals: OrderDetails[]; 59 | } 60 | 61 | export class OrderDetails { 62 | id: number; 63 | orderId: number; 64 | albumId: number; 65 | quantity: number; 66 | unitPrice: number; 67 | album: Album; 68 | order: Order; 69 | } 70 | 71 | 72 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/polyfills.ts: -------------------------------------------------------------------------------- 1 | // This file includes polyfills needed by Angular 2 and is loaded before 2 | // the app. You can add your own extra polyfills to this file. 3 | import 'core-js/es6/symbol'; 4 | import 'core-js/es6/object'; 5 | import 'core-js/es6/function'; 6 | import 'core-js/es6/parse-int'; 7 | import 'core-js/es6/parse-float'; 8 | import 'core-js/es6/number'; 9 | import 'core-js/es6/math'; 10 | import 'core-js/es6/string'; 11 | import 'core-js/es6/date'; 12 | import 'core-js/es6/array'; 13 | import 'core-js/es6/regexp'; 14 | import 'core-js/es6/map'; 15 | import 'core-js/es6/set'; 16 | import 'core-js/es6/reflect'; 17 | 18 | import 'core-js/es7/reflect'; 19 | import 'zone.js/dist/zone'; 20 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/route.config.ts: -------------------------------------------------------------------------------- 1 | import { GenresComponent } from './components/genre/genres.component'; 2 | import { Routes } from '@angular/router'; 3 | import { AlbumDetailComponent } from './components/album/album.component'; 4 | import { DashboardComponent } from './components/dashboard/dashboard.component'; 5 | import { LoginComponent } from './components/login/login.component'; 6 | import { CartComponent } from './components/cart/cart.component'; 7 | import { CheckoutComponent } from './components/checkout/checkout.component'; 8 | import { OrderComponent } from './components/order/order.component'; 9 | import { GenreDetailComponent } from './components/genre/genre-detail.component'; 10 | 11 | export const ROUTES: Routes = [ 12 | { 13 | path: '', 14 | data: { title: 'dashboard' }, 15 | component: DashboardComponent 16 | }, 17 | { 18 | path: 'genres/...', 19 | data: { title: 'genres' }, 20 | component: GenresComponent, 21 | }, 22 | { 23 | path: 'genres/genre/:name', 24 | data: { title: 'genres' }, 25 | component: GenreDetailComponent, 26 | }, 27 | { 28 | path: 'album/:id', 29 | data: { title: 'album' }, 30 | component: AlbumDetailComponent 31 | }, 32 | { 33 | path: 'login', 34 | data: { title: 'login' }, 35 | component: LoginComponent 36 | }, 37 | { 38 | path: 'cart', 39 | data: { title: 'cart' }, 40 | component: CartComponent 41 | }, 42 | { 43 | path: 'checkout', 44 | data: { title: 'checkout' }, 45 | component: CheckoutComponent 46 | }, 47 | { 48 | path: 'orders', 49 | data: { title: 'orders' }, 50 | component: OrderComponent 51 | } 52 | ]; 53 | 54 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/services/album/album.service.ts: -------------------------------------------------------------------------------- 1 | import {Album} from '../../models'; 2 | import {Http, Response} from '@angular/http'; 3 | import {Injectable} from '@angular/core'; 4 | import {API_BASE} from '../../config'; 5 | import {Observable} from 'rxjs/Observable'; 6 | import 'rxjs/Rx'; 7 | import 'rxjs/add/operator/map'; 8 | import 'rxjs/add/operator/retry'; 9 | import 'rxjs/add/operator/catch'; 10 | 11 | @Injectable() 12 | export class AlbumService { 13 | albums: Album[] = []; 14 | album: Album; 15 | 16 | constructor(public _http: Http) { 17 | } 18 | 19 | getPopularAlbums(): any { 20 | return this._http.get(API_BASE + `/popular`) 21 | .map((response: Response) => response.json()); 22 | } 23 | 24 | getAlbum(id: number): any { 25 | return this._http.get(API_BASE + `/albums/details/${id}`) 26 | .map((response: Response) => response.json()); 27 | } 28 | 29 | search(val: string): any { 30 | var empty: Album[] = []; 31 | return this._http 32 | .get(API_BASE + `/albums/${val}`) 33 | .retryWhen((attempts) => { 34 | return Observable.range(1, 2).zip(attempts, (i) => i).flatMap((i) => { 35 | console.log(`delay retry by ${i} second(s)`); 36 | return Observable.timer(i * 1000); 37 | }); 38 | }) 39 | .map((response: Response) => response.json()) 40 | .catch((err : Error) => { 41 | console.log(err); 42 | (window).Raygun.send(err); 43 | return Observable.of(empty); 44 | }); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/services/cart/cart.service.ts: -------------------------------------------------------------------------------- 1 | import {CartItem, CartItems, Album} from '../../models'; 2 | import {Http, Response} from '@angular/http'; 3 | import {Injectable} from '@angular/core'; 4 | import {API_BASE} from '../../config'; 5 | import 'rxjs/add/operator/map'; 6 | import {Observable} from 'rxjs/Observable'; 7 | import {AuthHttp} from 'angular2-jwt'; 8 | 9 | 10 | @Injectable() 11 | export class CartService { 12 | cartItem: CartItem[]; 13 | cartItems: CartItems; 14 | 15 | constructor(public _http: Http, public authHttp: AuthHttp) { 16 | } 17 | 18 | getCartItems(): Observable { 19 | return this.authHttp.get(API_BASE + `/cart/items`) 20 | .map((response: any) => response.json()); 21 | } 22 | 23 | removeItem(item) { 24 | return this.authHttp.delete(API_BASE + `/cart/remove/${item.cartItemId}`, item.cartItemId) 25 | .map((response: any) => response.json()); 26 | } 27 | 28 | addCartItem(album: Album): Observable { 29 | return this.authHttp.post(API_BASE + `/cart/add/${album.albumId}`, JSON.stringify(album.albumId)) 30 | .map((response: any) => response.json()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/services/checkout/checkout.service.ts: -------------------------------------------------------------------------------- 1 | import {CartItem, CartItems, Order} from '../../models'; 2 | import {Http, Response} from '@angular/http'; 3 | import {Injectable} from '@angular/core'; 4 | import {API_BASE} from '../../config'; 5 | import 'rxjs/add/operator/map'; 6 | import {Observable} from 'rxjs/Observable'; 7 | import {AuthHttp} from 'angular2-jwt'; 8 | 9 | 10 | @Injectable() 11 | export class CheckoutService { 12 | cartItem: CartItem[]; 13 | cartItems: CartItems; 14 | 15 | constructor(public _http: Http, public authHttp: AuthHttp) { 16 | } 17 | 18 | postOrder(order:Order): any { 19 | return this.authHttp.post(API_BASE + `/order`, JSON.stringify(order)) 20 | .map((response: Response) => response.json()); 21 | } 22 | 23 | getOrders() :Observable { 24 | return this.authHttp.get(API_BASE + `/orders`) 25 | .map((response: any) => response.json()); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/services/genre/genre.service.ts: -------------------------------------------------------------------------------- 1 | import {Genre, Album} from '../../models'; 2 | import {Http, Response} from '@angular/http'; 3 | import {Injectable} from '@angular/core'; 4 | import {API_BASE} from '../../config'; 5 | import 'rxjs/add/operator/map'; 6 | 7 | @Injectable() 8 | export class GenreService { 9 | genres: Genre[] =[]; 10 | albums: Album[] = []; 11 | constructor(private _http: Http) { 12 | } 13 | 14 | getGenres(): any { 15 | return this._http.get(API_BASE + `/genres`) 16 | .map((response: Response) => response.json()); 17 | } 18 | 19 | getGenreAlbums(name: string): any { 20 | return this._http.get(API_BASE + `/albums/${name}`) 21 | .map((response: any) => response.json()); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/services/loading/loading.service.ts: -------------------------------------------------------------------------------- 1 | import {Observable} from 'rxjs/Observable'; 2 | import {Observer} from 'rxjs/Observer'; 3 | import 'rxjs/add/operator/share'; 4 | 5 | export class LoadingService { 6 | loading$: Observable<{}>; 7 | private _observer: Observer<{}>; 8 | 9 | constructor() { 10 | this.loading$ = new Observable(observer => this._observer = observer).share(); 11 | } 12 | 13 | toggleLoadingIndicator(name) { 14 | if (this._observer) { 15 | this._observer.next(name); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/app/services/order/order.service.ts: -------------------------------------------------------------------------------- 1 | import {Order} from '../../models'; 2 | import {Http, Response} from '@angular/http'; 3 | import {Injectable} from '@angular/core'; 4 | import {API_BASE} from '../../config'; 5 | import 'rxjs/add/operator/map'; 6 | import {Observable} from 'rxjs/Observable'; 7 | import {AuthHttp} from 'angular2-jwt'; 8 | 9 | @Injectable() 10 | export class OrderService { 11 | order: Order; 12 | 13 | constructor(public _http: Http, public authHttp: AuthHttp) { 14 | } 15 | 16 | getOrders() : Observable { 17 | return this.authHttp.get(API_BASE + `/order`) 18 | .map((response: Response) => response.json()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/assets/img/BG-Blur.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSWConsulting/enterprise-musicstore-ui-angular2/ca2947e77a967f91e4b0b0cf080f0d1238ba404c/src/SSW.MusicStore.Web/assets/img/BG-Blur.jpg -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/assets/img/angular_logo.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSWConsulting/enterprise-musicstore-ui-angular2/ca2947e77a967f91e4b0b0cf080f0d1238ba404c/src/SSW.MusicStore.Web/assets/img/angular_logo.jpeg -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/assets/img/banner-image-sale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSWConsulting/enterprise-musicstore-ui-angular2/ca2947e77a967f91e4b0b0cf080f0d1238ba404c/src/SSW.MusicStore.Web/assets/img/banner-image-sale.png -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/assets/img/header-logo-with-text-gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSWConsulting/enterprise-musicstore-ui-angular2/ca2947e77a967f91e4b0b0cf080f0d1238ba404c/src/SSW.MusicStore.Web/assets/img/header-logo-with-text-gray.png -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/assets/img/header-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSWConsulting/enterprise-musicstore-ui-angular2/ca2947e77a967f91e4b0b0cf080f0d1238ba404c/src/SSW.MusicStore.Web/assets/img/header-logo.png -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/assets/img/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 21 | 23 | 45 | 52 | 53 | 55 | 56 | 58 | image/svg+xml 59 | 61 | 62 | 63 | 64 | 65 | 70 | 73 | 76 | 79 | 89 | 99 | 100 | 110 | 120 | 130 | 138 | 146 | 147 | 150 | 153 | 163 | 173 | 174 | 184 | 194 | 204 | 212 | 220 | 221 | 224 | 234 | 244 | 254 | 264 | 274 | 284 | 292 | 300 | 301 | 302 | 303 | 304 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/assets/img/placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSWConsulting/enterprise-musicstore-ui-angular2/ca2947e77a967f91e4b0b0cf080f0d1238ba404c/src/SSW.MusicStore.Web/assets/img/placeholder.png -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/assets/img/placeholder.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 42 | 44 | 45 | 47 | image/svg+xml 48 | 50 | 51 | 52 | 53 | 54 | 59 | 64 | 71 | 74 | 81 | 84 | 88 | 92 | 96 | 100 | 104 | 108 | 109 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/assets/img/ssw_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSWConsulting/enterprise-musicstore-ui-angular2/ca2947e77a967f91e4b0b0cf080f0d1238ba404c/src/SSW.MusicStore.Web/assets/img/ssw_logo.png -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/assets/img/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSWConsulting/enterprise-musicstore-ui-angular2/ca2947e77a967f91e4b0b0cf080f0d1238ba404c/src/SSW.MusicStore.Web/assets/img/user.png -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/assets/styles/styles.css: -------------------------------------------------------------------------------- 1 | .ssw-loading-spinner { 2 | margin-top: 48px; 3 | } 4 | 5 | a { 6 | color: rgba(207, 70, 67, 0.701961); 7 | text-decoration: none; 8 | } 9 | 10 | a:hover { 11 | color: #818a91; 12 | text-decoration: none; 13 | } 14 | 15 | .btn-link { 16 | color: rgba(91, 82, 82, 0.5); 17 | } 18 | 19 | .btn-link:hover { 20 | color: #818a91; 21 | text-decoration: none; 22 | } 23 | 24 | body { 25 | min-height: 75rem; 26 | background-image: url('/assets/img/BG-Blur.jpg'); 27 | background-repeat: no-repeat; 28 | background-position: center center; 29 | background-attachment: fixed; 30 | -webkit-background-size: cover; 31 | -moz-background-size: cover; 32 | -o-background-size: cover; 33 | background-size: cover; 34 | } 35 | 36 | .title { 37 | padding-top: 5px; 38 | } 39 | 40 | textarea:focus, 41 | input[type="text"]:focus, 42 | input[type="password"]:focus, 43 | input[type="datetime"]:focus, 44 | input[type="datetime-local"]:focus, 45 | input[type="date"]:focus, 46 | input[type="month"]:focus, 47 | input[type="time"]:focus, 48 | input[type="week"]:focus, 49 | input[type="number"]:focus, 50 | input[type="email"]:focus, 51 | input[type="url"]:focus, 52 | input[type="search"]:focus, 53 | input[type="tel"]:focus, 54 | input[type="color"]:focus, 55 | .uneditable-input:focus, 56 | .navbar-toggler:focus, 57 | .navbar-toggler:hover { 58 | border-color: rgba(207, 70, 67, 0.7 ); 59 | box-shadow: 0 1px 1px rgba(207, 70, 67, 0.7 ) inset, 0 0 8px rgba(207, 70, 67, 0.7 ); 60 | outline: 0 none; 61 | } 62 | 63 | .album-section { 64 | min-height: 50rem; 65 | padding-top: 1rem; 66 | padding-bottom: 1rem; 67 | background-color: transparent; 68 | } 69 | 70 | .navbar-toggler { 71 | margin: 0 5px; 72 | } 73 | 74 | .navbar-collapse .container-fluid { 75 | padding: 2rem 2.5rem; 76 | border-bottom: 1px solid #55595c; 77 | } 78 | 79 | .navbar-collapse h4 { 80 | color: #818a91; 81 | } 82 | 83 | .navbar-collapse .text-muted { 84 | color: #818a91; 85 | } 86 | 87 | .navbar .text-muted { 88 | color: #818a91; 89 | } 90 | 91 | .about { 92 | float: left; 93 | max-width: 30rem; 94 | margin-right: 3rem; 95 | } 96 | 97 | .social a { 98 | font-weight: 500; 99 | color: #eceeef; 100 | } 101 | 102 | .social a:hover { 103 | color: #fff; 104 | } 105 | 106 | * { 107 | margin: 0; 108 | } 109 | 110 | body > .container { 111 | padding: 60px 15px 0; 112 | } 113 | 114 | html { 115 | position: relative; 116 | min-height: 100%; 117 | } 118 | 119 | body { 120 | /* Margin bottom by footer height */ 121 | margin-bottom: 60px; 122 | } 123 | 124 | .ms-footer { 125 | position: absolute; 126 | bottom: 0; 127 | width: 100%; 128 | /* Set the fixed height of the footer here */ 129 | height: 60px; 130 | background-color: #3c3c3c; 131 | padding-top: 1rem; 132 | padding-bottom: 1rem; 133 | } 134 | 135 | .ms-foooter p { 136 | margin-bottom: .15rem; 137 | } 138 | 139 | .ms-bg-white { 140 | background-color: #fff; 141 | } -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSWConsulting/enterprise-musicstore-ui-angular2/ca2947e77a967f91e4b0b0cf080f0d1238ba404c/src/SSW.MusicStore.Web/favicon.ico -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/gulpfile.js: -------------------------------------------------------------------------------- 1 | /// 2 | var gulp = require('gulp'); 3 | var ts = require('gulp-typescript'); 4 | var path = require('path'); 5 | var Builder = require('systemjs-builder'); 6 | var inlineNg2Template = require('gulp-inline-ng2-template'); 7 | var merge = require('merge-stream'); 8 | var rename = require('gulp-rename'); 9 | var concat = require('gulp-concat'); 10 | 11 | var project = ts.createProject('tsconfig.json'); 12 | 13 | gulp.task('tsc', function () { 14 | var tsProject = ts.createProject('tsconfig.json'); 15 | var tsResult = gulp.src("./app/**/*.ts") 16 | .pipe(tsProject()); 17 | return tsResult.js.pipe(gulp.dest('./app')); 18 | }); 19 | 20 | gulp.task('stage-inline', ['tsc'], function() { 21 | return gulp.src('./app/**/*.js') 22 | .pipe(inlineNg2Template({ 23 | base: '.', 24 | target: 'es5' 25 | })) 26 | .pipe(gulp.dest('./staging')); 27 | }); 28 | 29 | gulp.task('bundle-staging', ['stage-inline'], function (cb) { 30 | var builder = new Builder('.', 'system.js'); 31 | 32 | builder.config({ 33 | defaultJSExtensions: 'js', 34 | map: { 35 | 'angular2': 'node_modules/angular2', 36 | 'rxjs': 'node_modules/rxjs' 37 | }, 38 | }); 39 | 40 | builder.buildStatic('staging/main', './staging/bundled.js') 41 | .then(function(output) { 42 | cb(); 43 | }) 44 | .catch(function(err) { 45 | console.log('Build error: ' + err); 46 | }); 47 | }); 48 | 49 | gulp.task('build', ['bundle-staging'], function () { 50 | var js = gulp.src([ 51 | 'node_modules/@angular/bundles/angular2-polyfills.js', 52 | 'staging/bundled.js', 53 | 'staging/raygun.js' 54 | ]).pipe(concat('script.js')); 55 | 56 | var html = gulp.src(['./index-dist.html']) 57 | .pipe(rename('index.html')); 58 | 59 | var css = gulp.src('assets/**/*.css') 60 | .pipe(concat('styles.css')); 61 | 62 | gulp.src(['assets/img/**/*']) 63 | .pipe(gulp.dest('./wwwroot/assets/img/')); 64 | 65 | return merge(js, css, html) 66 | .pipe(gulp.dest('./wwwroot')); 67 | }); -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/hosting.json: -------------------------------------------------------------------------------- 1 | { 2 | "webroot": "." 3 | } -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/index-dist.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Angular2 Music Store 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 |
29 |
30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ssw-musicstore", 3 | "version": "0.0.1", 4 | "description": "SSW Angular Music Store", 5 | "repository": { 6 | "type": "git", 7 | "url": "https://github.com/SSWConsulting/musicstore-ui-angular2" 8 | }, 9 | "scripts": { 10 | "build": "gulp build", 11 | "postinstall": "typings install" 12 | }, 13 | "author": "Duncan Hunter Adam Stephensen ", 14 | "license": "MIT", 15 | "devDependencies": { 16 | "@types/jasmine": "^2.2.30", 17 | "@types/node": "^6.0.42", 18 | "gulp": "3.9.1", 19 | "gulp-concat": "2.6.0", 20 | "gulp-express": "0.3.5", 21 | "gulp-inline-ng2-template": "1.1.3", 22 | "gulp-rename": "1.2.2", 23 | "gulp-typescript": "3.1.3", 24 | "merge-stream": "1.0.0", 25 | "open": "0.0.5", 26 | "typescript": "2.1.4", 27 | "typings": "1.3.0", 28 | "systemjs-builder": "0.15.23" 29 | }, 30 | "dependencies": { 31 | "@angular/common": "~2.1.0", 32 | "@angular/compiler": "~2.1.0", 33 | "@angular/core": "~2.1.0", 34 | "@angular/forms": "~2.1.0", 35 | "@angular/http": "~2.1.0", 36 | "@angular/platform-browser": "~2.1.0", 37 | "@angular/platform-browser-dynamic": "~2.1.0", 38 | "@angular/router": "~3.1.0", 39 | "core-js": "^2.4.1", 40 | "rxjs": "5.0.0-beta.12", 41 | "ts-helpers": "^1.1.1", 42 | "zone.js": "^0.6.23", 43 | "angular2-jwt": "0.1.26", 44 | "systemjs": "0.19.41", 45 | "reflect-metadata": "^0.1.8" 46 | } 47 | } -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilationOptions": { 3 | "emitEntryPoint": true 4 | }, 5 | "version": "1.0.0-*", 6 | "dependencies": { 7 | "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", 8 | "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", 9 | "Microsoft.AspNetCore.StaticFiles": "1.0.0", 10 | "Microsoft.Extensions.FileProviders.Physical": "1.0.0", 11 | "Microsoft.Extensions.FileProviders.Abstractions": "1.0.0", 12 | "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", 13 | "Microsoft.Extensions.Configuration.Json": "1.0.0", 14 | "Microsoft.Extensions.Logging": "1.0.0", 15 | "Microsoft.Extensions.Logging.Console": "1.0.0", 16 | "Microsoft.Extensions.Logging.Debug": "1.0.0" 17 | }, 18 | "tools": { 19 | "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final" 20 | }, 21 | "runtimeOptions": { 22 | "configProperties": { 23 | "System.GC.Server": true 24 | } 25 | }, 26 | "frameworks": { 27 | "net451": {}, 28 | "net452": {}, 29 | "net461": {}, 30 | "netcoreapp1.0": { 31 | "dependencies": { 32 | "Microsoft.NETCore.App": { 33 | "version": "1.0.0", 34 | "type": "platform" 35 | } 36 | } 37 | } 38 | }, 39 | 40 | "buildOptions": { 41 | "emitEntryPoint": true, 42 | "preserveCompilationContext": true 43 | }, 44 | 45 | "exclude": [ 46 | "wwwroot", 47 | "node_modules" 48 | ], 49 | 50 | "publishOptions": { 51 | "exclude": [ 52 | "**.user", 53 | "**.vspscc" 54 | ] 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/system.js: -------------------------------------------------------------------------------- 1 | /** 2 | * System configuration for Angular 2 samples 3 | * Adjust as necessary for your application needs. 4 | */ 5 | (function (global) { 6 | // map tells the System loader where to look for things 7 | var map = { 8 | '@angular': 'node_modules/@angular', 9 | 'rxjs': 'node_modules/rxjs', 10 | "angular2-jwt": "node_modules/angular2-jwt/angular2-jwt.js" 11 | }; 12 | // packages tells the System loader how to load when no filename and/or no extension 13 | var packages = { 14 | 'app': { main: 'main.js', defaultExtension: 'js', format: 'register' }, 15 | 'rxjs': { defaultExtension: 'js' } 16 | }; 17 | //var packages = { 18 | // 'app': { main: 'main.js', defaultExtension: 'js', format: 'register' }, 19 | // '@angular/router': { main: 'index.js', defaultExtension: 'js' }, 20 | // 'rxjs': { defaultExtension: 'js' } 21 | //}; 22 | var ngPackageNames = [ 23 | 'common', 24 | 'compiler', 25 | 'forms', 26 | 'core', 27 | 'http', 28 | 'router', 29 | 'platform-browser', 30 | 'platform-browser-dynamic' 31 | ]; 32 | // Add package entries for angular packages 33 | ngPackageNames.forEach(function (pkgName) { 34 | packages['@angular/' + pkgName] = { main: '/bundles/' + pkgName + '.umd.js', defaultExtension: 'js' }; 35 | }); 36 | 37 | // No umd for router yet 38 | //packages['@angular/router'] = { main: 'index.js', defaultExtension: 'js' }; 39 | 40 | var config = { 41 | map: map, 42 | packages: packages 43 | } 44 | System.config(config); 45 | })(this); 46 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "system", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false, 11 | "typeRoots": [ 12 | "../node_modules/@types" 13 | ] 14 | }, 15 | "exclude": [ 16 | "node_modules", 17 | "typings/main", 18 | "typings/globals", 19 | "typings/modules", 20 | "typings/index.d.ts", 21 | "typings/main.d.ts" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "class-name": true, 4 | "curly": false, 5 | "eofline": true, 6 | "indent": "spaces", 7 | "max-line-length": [true, 140], 8 | "member-ordering": [true, 9 | "public-before-private", 10 | "static-before-instance", 11 | "variables-before-functions" 12 | ], 13 | "no-arg": true, 14 | "no-construct": true, 15 | "no-duplicate-key": true, 16 | "no-duplicate-variable": true, 17 | "no-empty": true, 18 | "no-eval": true, 19 | "no-trailing-comma": true, 20 | "no-trailing-whitespace": true, 21 | "no-unused-expression": true, 22 | "no-unused-variable": true, 23 | "no-unreachable": true, 24 | "no-use-before-declare": true, 25 | "one-line": [true, 26 | "check-open-brace", 27 | "check-catch", 28 | "check-else", 29 | "check-whitespace" 30 | ], 31 | "quotemark": [true, "single"], 32 | "semicolon": true, 33 | "triple-equals": true, 34 | "variable-name": false 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/wwwroot/assets/img/BG-Blur.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSWConsulting/enterprise-musicstore-ui-angular2/ca2947e77a967f91e4b0b0cf080f0d1238ba404c/src/SSW.MusicStore.Web/wwwroot/assets/img/BG-Blur.jpg -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/wwwroot/assets/img/angular_logo.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSWConsulting/enterprise-musicstore-ui-angular2/ca2947e77a967f91e4b0b0cf080f0d1238ba404c/src/SSW.MusicStore.Web/wwwroot/assets/img/angular_logo.jpeg -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/wwwroot/assets/img/banner-image-sale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSWConsulting/enterprise-musicstore-ui-angular2/ca2947e77a967f91e4b0b0cf080f0d1238ba404c/src/SSW.MusicStore.Web/wwwroot/assets/img/banner-image-sale.png -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/wwwroot/assets/img/header-logo-with-text-gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSWConsulting/enterprise-musicstore-ui-angular2/ca2947e77a967f91e4b0b0cf080f0d1238ba404c/src/SSW.MusicStore.Web/wwwroot/assets/img/header-logo-with-text-gray.png -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/wwwroot/assets/img/header-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSWConsulting/enterprise-musicstore-ui-angular2/ca2947e77a967f91e4b0b0cf080f0d1238ba404c/src/SSW.MusicStore.Web/wwwroot/assets/img/header-logo.png -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/wwwroot/assets/img/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 21 | 23 | 45 | 52 | 53 | 55 | 56 | 58 | image/svg+xml 59 | 61 | 62 | 63 | 64 | 65 | 70 | 73 | 76 | 79 | 89 | 99 | 100 | 110 | 120 | 130 | 138 | 146 | 147 | 150 | 153 | 163 | 173 | 174 | 184 | 194 | 204 | 212 | 220 | 221 | 224 | 234 | 244 | 254 | 264 | 274 | 284 | 292 | 300 | 301 | 302 | 303 | 304 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/wwwroot/assets/img/placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSWConsulting/enterprise-musicstore-ui-angular2/ca2947e77a967f91e4b0b0cf080f0d1238ba404c/src/SSW.MusicStore.Web/wwwroot/assets/img/placeholder.png -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/wwwroot/assets/img/placeholder.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 42 | 44 | 45 | 47 | image/svg+xml 48 | 50 | 51 | 52 | 53 | 54 | 59 | 64 | 71 | 74 | 81 | 84 | 88 | 92 | 96 | 100 | 104 | 108 | 109 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/wwwroot/assets/img/ssw_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSWConsulting/enterprise-musicstore-ui-angular2/ca2947e77a967f91e4b0b0cf080f0d1238ba404c/src/SSW.MusicStore.Web/wwwroot/assets/img/ssw_logo.png -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/wwwroot/assets/img/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSWConsulting/enterprise-musicstore-ui-angular2/ca2947e77a967f91e4b0b0cf080f0d1238ba404c/src/SSW.MusicStore.Web/wwwroot/assets/img/user.png -------------------------------------------------------------------------------- /src/SSW.MusicStore.Web/wwwroot/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | --------------------------------------------------------------------------------