Angular 1.6.9, remove bower

This commit is contained in:
Mo Bitar
2019-01-30 16:16:43 -06:00
parent c6a90ec513
commit 4f42330167
17 changed files with 3722 additions and 3777 deletions

2
.gitignore vendored
View File

@@ -19,8 +19,6 @@
/app/assets/templates/generated/
# Ignore bower components
/vendor/assets/bower_components/
/node_modules
/dist/javascripts/app.js
/dist/javascripts/compiled.js

View File

@@ -19,8 +19,6 @@
/app/assets/templates/generated/
# Ignore bower components
/vendor/assets/bower_components/
/node_modules
/.sass-cache

View File

@@ -38,10 +38,6 @@ RUN bundle install
RUN npm install
RUN npm install -g bower grunt
RUN bundle exec rake bower:install
RUN npm run build
# Uncomment the line below for production:

View File

@@ -15,8 +15,6 @@ gem 'rack-cors', :require => 'rack/cors'
gem 'dotenv-rails'
gem 'bower-rails', '~> 0.10.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc

View File

@@ -42,7 +42,6 @@ GEM
sshkit (>= 1.6.1, != 1.7.0)
arel (8.0.0)
bindex (0.5.0)
bower-rails (0.10.0)
builder (3.2.3)
byebug (10.0.2)
capistrano (3.10.2)
@@ -193,7 +192,6 @@ PLATFORMS
x64-mingw32
DEPENDENCIES
bower-rails (~> 0.10.0)
byebug
capistrano
capistrano-bundler

View File

@@ -85,7 +85,7 @@ module.exports = function(grunt) {
src: [
'node_modules/standard-file-js/dist/regenerator.js',
'node_modules/standard-file-js/dist/sfjs.js',
'vendor/assets/bower_components/angular/angular.js',
'node_modules/angular/angular.js',
'vendor/assets/javascripts/angular-sanitize.js',
'vendor/assets/javascripts/lodash/lodash.custom.min.js'
],

View File

@@ -23,7 +23,7 @@ angular.module('app')
}
})
.controller('NotesCtrl', function (authManager, $timeout, $rootScope, modelManager,
storageManager, desktopManager, privilegesManager) {
syncManager, storageManager, desktopManager, privilegesManager) {
this.panelController = {};
this.searchSubmitted = false;
@@ -32,6 +32,15 @@ angular.module('app')
this.loadPreferences();
});
syncManager.addEventHandler((syncEvent, data) => {
if(syncEvent == "local-data-loaded") {
this.localDataLoaded = true;
if(this.tag && this.tag.notes.length == 0) {
this.createNewNote();
}
}
});
modelManager.addItemSyncObserver("note-list", "Note", (allItems, validItems, deletedItems, source, sourceKey) => {
// Note has changed values, reset its flags
for(var note of allItems) {
@@ -104,10 +113,18 @@ angular.module('app')
// When a note is removed from the list
this.onNoteRemoval = function() {
let visibleNotes = this.visibleNotes();
let index;
if(this.selectedIndex < visibleNotes.length) {
this.selectNote(visibleNotes[Math.max(this.selectedIndex, 0)]);
index = Math.max(this.selectedIndex, 0);
} else {
this.selectNote(visibleNotes[visibleNotes.length - 1]);
index = visibleNotes.length - 1;
}
let note = visibleNotes[index];
if(note) {
this.selectNote(note);
} else {
this.createNewNote();
}
}
@@ -228,7 +245,12 @@ angular.module('app')
this.noteFilter.text = "";
tag.notes.forEach((note) => { note.visible = true; })
if(tag.notes.length > 0) {
tag.notes.forEach((note) => { note.visible = true; })
this.selectFirstNote();
} else if(this.localDataLoaded) {
this.createNewNote();
}
}
this.visibleNotes = function() {
@@ -237,19 +259,15 @@ angular.module('app')
});
}
this.selectFirstNote = function(createNew) {
this.selectFirstNote = function() {
var visibleNotes = this.visibleNotes();
if(visibleNotes.length > 0) {
this.selectNote(visibleNotes[0]);
} else if(createNew) {
this.createNewNote();
}
}
this.selectNote = async function(note, viaClick = false) {
if(!note) {
this.createNewNote();
return;
}
@@ -347,7 +365,7 @@ angular.module('app')
$timeout(function(){
if(!this.selectedNote.visible) {
this.selectFirstNote(false);
this.selectFirstNote();
}
}.bind(this), 100)
}

View File

@@ -34,7 +34,7 @@ class ModelManager extends SFModelManager {
}
noteCount() {
return this.notes.length;
return this.notes.filter((n) => !n.dummy).length;
}
removeAllItemsFromMemory() {

View File

@@ -184,7 +184,7 @@
#import-password-request{"ng-if" => "importData.requestPassword"}
%form.sk-panel-form.stretch{"ng-submit" => "submitImportPassword()"}
%p Enter the account password associated with the import file.
%input.sk-input.mt-5{:type => 'password', "placeholder" => "Enter File Account Password", "ng-model" => "importData.password", "autofocus" => "true"}
%input.sk-input.contrast.mt-5{:type => 'password', "placeholder" => "Enter File Account Password", "ng-model" => "importData.password", "autofocus" => "true"}
.sk-button-group.stretch.sk-panel-row.form-submit
%button.sk-button.info{"type" => "submit"}
.sk-label Decrypt & Import

View File

@@ -1,16 +0,0 @@
{
"name": "standard-notes",
"lib": {
"name": "bower-rails generated lib assets",
"dependencies": {}
},
"vendor": {
"name": "bower-rails generated vendor assets",
"dependencies": {
"angular": "1.6.1"
},
"resolutions": {
"angular": "1.6.1"
}
}
}

View File

@@ -12,7 +12,6 @@ dependencies:
override:
- bundle install
- npm install
- bundle exec rake bower:install
- grunt
test:

View File

@@ -54,8 +54,7 @@ namespace :deploy do
end
end
before 'deploy:compile_assets', 'bower:install'
after 'bower:install', 'deploy:npm_install'
before 'deploy:compile_assets', 'deploy:npm_install'
set :ssh_options, {
keys: %W( #{CAP_CONFIG['default']['key_path']} ),

View File

@@ -1,19 +0,0 @@
BowerRails.configure do |bower_rails|
# Tell bower-rails what path should be considered as root. Defaults to Dir.pwd
# bower_rails.root_path = Dir.pwd
# Invokes rake bower:install before precompilation. Defaults to false
# bower_rails.install_before_precompile = true
# Invokes rake bower:resolve before precompilation. Defaults to false
# bower_rails.resolve_before_precompile = true
# Invokes rake bower:clean before precompilation. Defaults to false
# bower_rails.clean_before_precompile = true
# Invokes rake bower:install:deployment instead rake bower:install. Defaults to false
# bower_rails.use_bower_install_deployment = true
#
# Invokes rake bower:install and rake bower:install:deployment with -F (force) flag. Defaults to false
# bower_rails.force_install = true
end

View File

@@ -1,72 +0,0 @@
// Karma configuration
// Generated on Thu Jan 19 2017 22:15:55 GMT-0800 (PST)
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
'vendor/assets/bower_components/angular/angular.js',
'node_modules/angular-mocks/angular-mocks.js',
'vendor/assets/javascripts/compiled.js',
'test/javascripts/**/*_spec.js'
],
// list of files to exclude
exclude: [
],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
},
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_ERROR,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['PhantomJS'],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,
// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity
})
}

View File

@@ -1,12 +0,0 @@
namespace :bower do
desc "Install bower packages"
task :install do
on roles(:web) do
within "#{release_path}" do
with rails_env: fetch(:rails_env) do
execute :rake, "bower:install CI=true"
end
end
end
end
end

7305
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -7,20 +7,18 @@
"url": "https://github.com/standardnotes/web"
},
"scripts": {
"build": "bundle install && npm install && bundle exec rake bower:install && grunt",
"build": "bundle install && npm install && bundle exec && grunt",
"submodules": "git submodule update --init --force --remote",
"test": "karma start karma.conf.js --single-run"
},
"devDependencies": {
"angular": "^1.6.1",
"angular-mocks": "^1.6.1",
"angular": "1.6.9",
"babel-cli": "^6.18.0",
"babel-plugin-angularjs-annotate": "^0.9.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.1.1",
"babel-preset-es2015": "^6.24.1",
"babel-preset-es2016": "^6.16.0",
"bower": "^1.8.0",
"chai": "^4.1.2",
"connect": "^3.6.6",
"grunt": "^1.0.3",
@@ -36,16 +34,11 @@
"grunt-haml2html": "^0.3.1",
"grunt-newer": "^1.2.0",
"grunt-ng-annotate": "^3.0.0",
"jasmine": "^2.5.3",
"karma": "^2.0.5",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.1.0",
"karma-phantomjs-launcher": "^1.0.2",
"mocha": "^5.2.0",
"serve-static": "^1.13.2",
"sn-models": "0.1.12",
"sn-models": "0.1.13",
"sn-stylekit": "2.0.13",
"standard-file-js": "0.3.39",
"standard-file-js": "file:~/Desktop/sn/dev/sfjs",
"grunt-shell": "^2.1.0"
}
}