Dashboard icon
Change-Id: Ibebd10436e18d4b424ba311f9e0c1f4ec385361f
diff --git a/views/ngXosLib/generator-xos/app/index.js b/views/ngXosLib/generator-xos/app/index.js
index 0368fd2..72c6f56 100755
--- a/views/ngXosLib/generator-xos/app/index.js
+++ b/views/ngXosLib/generator-xos/app/index.js
@@ -64,7 +64,7 @@
{fileName: this._fistCharToUpper(config.name)}
);
},
- css: function(){
+ scss: function(){
this.fs.copyTpl(
this.templatePath('src/sass/main.scss'),
this.destinationPath(`${this.config.get('folder')}/${config.name}/src/sass/main.scss`),
@@ -78,6 +78,11 @@
{ name: config.name, fileName: this._fistCharToUpper(config.name) }
);
},
+ image: function(){
+ this.fs.copyTpl(
+ this.templatePath('src/icons/README.md'),
+ this.destinationPath(`${this.config.get('folder')}/${config.name}/src/icons/README.md`));
+ },
template: function(){
this.fs.copy(this.templatePath('src/templates/users-list.tpl.html'), this.destinationPath(`${this.config.get('folder')}/${config.name}/src/templates/users-list.tpl.html`));
},
diff --git a/views/ngXosLib/generator-xos/app/templates/gulp/build.js b/views/ngXosLib/generator-xos/app/templates/gulp/build.js
index b66cdbc..00dc995 100644
--- a/views/ngXosLib/generator-xos/app/templates/gulp/build.js
+++ b/views/ngXosLib/generator-xos/app/templates/gulp/build.js
@@ -41,7 +41,9 @@
return del(
[
options.dashboards + 'xos<%= fileName %>.html',
- options.static + 'css/xos<%= fileName %>.css'
+ options.static + 'css/xos<%= fileName %>.css',
+ options.static + 'images/<%= name %>-icon.png',
+ options.static + 'images/<%= name %>-icon-active.png'
],
{force: true}
);
@@ -70,6 +72,12 @@
.pipe(gulp.dest(options.static + 'css/'))
});
+ // copy images in correct folder
+ gulp.task('copyImages', ['wait'], function(){
+ return gulp.src([`${options.icon}/<%= name %>-icon.png`,`${options.icon}/<%= name %>-icon-active.png`])
+ .pipe(gulp.dest(options.static + 'images/'))
+ });
+
// compile and minify scripts
gulp.task('scripts', function() {
return gulp.src([
@@ -157,6 +165,7 @@
'wiredep',
'css',
'copyCss',
+ 'copyImages',
'copyHtml',
'cleanTmp'
);
diff --git a/views/ngXosLib/generator-xos/app/templates/gulpfile.js b/views/ngXosLib/generator-xos/app/templates/gulpfile.js
index 08df554..eca4e45 100644
--- a/views/ngXosLib/generator-xos/app/templates/gulpfile.js
+++ b/views/ngXosLib/generator-xos/app/templates/gulpfile.js
@@ -6,6 +6,7 @@
var options = {
src: 'src/',
css: 'src/css/',
+ icon: 'src/icons',
sass: 'src/sass/',
scripts: 'src/js/',
tmp: 'src/.tmp',
diff --git a/views/ngXosLib/generator-xos/app/templates/src/icons/README.md b/views/ngXosLib/generator-xos/app/templates/src/icons/README.md
new file mode 100644
index 0000000..0d5a787
--- /dev/null
+++ b/views/ngXosLib/generator-xos/app/templates/src/icons/README.md
@@ -0,0 +1,18 @@
+# Set icon for custom dashboard
+
+## Path to add images : <dashboard-name>/src/icons
+
+### Add two images with name in following format
+ <dashboard-name>-icon.png
+ <dashboard-name>-icon-active.png
+
+Examples:
+ If your dashboard name is `slice`
+ then you will add the images with the name as
+ `slice-icon.png`
+ `slice-icon-active.png`
+
+
+
+
+Note: If you don't add the custom images, then dashboard will use the default images stored at `/xos/core/xoslib/static/images`
\ No newline at end of file