Skip to content

Commit

Permalink
fixed tests, updated rails, streamlined profile, added flags
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWalkingLeek committed Nov 2, 2018
1 parent 53475b4 commit dba8b3a
Show file tree
Hide file tree
Showing 426 changed files with 21,774 additions and 3,273 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ gem 'pg', '0.19.0.pre20160409114042'
gem 'pg_search'
gem 'puma', '~> 3.0'
gem 'rack'
gem 'rails-erd', group: :development
gem 'rails-html-sanitizer', '~> 1.0.3'
gem 'rails-i18n'
gem 'rubyzip', '~> 1.2.1'
Expand Down
10 changes: 9 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ GEM
mime-types (>= 1.16)
case_transform (0.2)
activesupport
choice (0.2.0)
coderay (1.1.2)
concurrent-ruby (1.0.5)
crass (1.0.4)
Expand Down Expand Up @@ -150,6 +151,11 @@ GEM
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-erd (1.5.2)
activerecord (>= 3.2)
activesupport (>= 3.2)
choice (~> 0.2.0)
ruby-graphviz (~> 1.2)
rails-html-sanitizer (1.0.4)
loofah (~> 2.2, >= 2.2.2)
rails-i18n (5.1.1)
Expand Down Expand Up @@ -190,6 +196,7 @@ GEM
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-graphviz (1.2.3)
ruby-progressbar (1.10.0)
rubyzip (1.2.2)
seed-fu (2.3.9)
Expand Down Expand Up @@ -255,6 +262,7 @@ DEPENDENCIES
puma (~> 3.0)
rack
rails (= 5.2.1)
rails-erd
rails-html-sanitizer (~> 1.0.3)
rails-i18n
rspec-rails (~> 3.6)
Expand All @@ -269,4 +277,4 @@ DEPENDENCIES
tzinfo-data

BUNDLED WITH
1.16.5
1.16.6
1 change: 1 addition & 0 deletions bin/frontend-tests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash

export MOCK_LDAP_AUTH=1
export RAILS_PORT=3001
PID_FILE=tmp/pids/frontend-test-server.pid
SERVER=false
Expand Down
19 changes: 19 additions & 0 deletions config/initializers/mock_ldap_out.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require 'ldap_tools'
module LdapToolsTestMock
extend ActiveSupport::Concern
included do
def self.authenticate(username, password)
username == 'ken' && password == 'password'
end

def self.exists?(username)
username == 'ken'
end
end
end

# This initializer is used for the frontend acceptance login test.

if Rails.env.test? & ENV['MOCK_LDAP_AUTH']
LdapTools.send :include, LdapToolsTestMock
end
14 changes: 7 additions & 7 deletions config/initializers/new_framework_defaults_5_2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# Make Active Record use stable #cache_key alongside new #cache_version method.
# This is needed for recyclable cache keys.
Rails.application.config.active_record.cache_versioning = true
# Rails.application.config.active_record.cache_versioning = true

# Use AES-256-GCM authenticated encryption for encrypted cookies.
# Also, embed cookie expiry in signed or encrypted cookies for increased security.
Expand All @@ -17,22 +17,22 @@
# It's best enabled when your entire app is migrated and stable on 5.2.
#
# Existing cookies will be converted on read then written with the new scheme.
Rails.application.config.action_dispatch.use_authenticated_cookie_encryption = true
# Rails.application.config.action_dispatch.use_authenticated_cookie_encryption = true

# Use AES-256-GCM authenticated encryption as default cipher for encrypting messages
# instead of AES-256-CBC, when use_authenticated_message_encryption is set to true.
Rails.application.config.active_support.use_authenticated_message_encryption = true
# Rails.application.config.active_support.use_authenticated_message_encryption = true

# Add default protection from forgery to ActionController::Base instead of in
# ApplicationController.
Rails.application.config.action_controller.default_protect_from_forgery = true
# Rails.application.config.action_controller.default_protect_from_forgery = true

# Store boolean values are in sqlite3 databases as 1 and 0 instead of 't' and
# 'f' after migrating old data.
Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true
# Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true

# Use SHA-1 instead of MD5 to generate non-sensitive digests, such as the ETag header.
Rails.application.config.active_support.use_sha1_digests = true
# Rails.application.config.active_support.use_sha1_digests = true

# Make `form_with` generate id attributes for any generated HTML tags.
Rails.application.config.action_view.form_with_generates_ids = true
# Rails.application.config.action_view.form_with_generates_ids = true
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class UpdateAllOriginsToSwitzerland < ActiveRecord::Migration[5.2]
def change
Person.find_each do |person|
person.origin = 'Switzerland'
person.save!
end
end
end
8 changes: 8 additions & 0 deletions db/migrate/20181026153302_change_switzerland_to_schweiz.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class ChangeSwitzerlandToSchweiz < ActiveRecord::Migration[5.2]
def change
Person.find_each do |person|
person.origin = 'Schweiz'
person.save!
end
end
end
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2018_05_29_072129) do
ActiveRecord::Schema.define(version: 2018_10_26_153302) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down
6 changes: 3 additions & 3 deletions db/seeds/support/person_seeder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ def seed_person(name)
p.martial_status = 'ledig'
p.updated_by = 'seed_user'
p.name = name.to_s
p.origin = Faker::StarWars.planet
p.role = Faker::Company.profession
p.origin = 'Schweiz'
p.role = 'Architekt'
p.title = Faker::Name.title
p.company_id = rand(1..4)
competences = ""
Expand Down Expand Up @@ -174,6 +174,6 @@ def seed_project_technology(project_id)
ProjectTechnology.seed do |a|
a.offer = ["Java", "Ruby", "Javascript", "C++", "C", "C#"]
a.project_id = project_id
end
end
end
end
Binary file added erd.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion frontend/.template-lintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ module.exports = {
extends: 'recommended',

rules: {
'bare-strings': false
'no-bare-strings': false
}
};
1 change: 1 addition & 0 deletions frontend/app/components/competences-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export default Component.extend({
else {
selected.pushObject(searchText);
}
options.sort();
},

deleteOffer(offerToDelete) {
Expand Down
41 changes: 40 additions & 1 deletion frontend/app/components/person-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,32 @@ import { inject as service } from '@ember/service';
import Component from '@ember/component';
import { computed } from '@ember/object';
import { isBlank } from '@ember/utils';
import { getNames } from 'ember-i18n-iso-countries';


export default Component.extend({
store: service(),
i18n: service(),

init() {
this._super(...arguments);
this.martialStatuses = (['ledig', 'verheiratet', 'verwittwet', 'eingetragene Partnerschaft', 'geschieden']);
this.roles = (['Software-Entwickler', 'Software-Ingenieur', 'User Experience Consultant', 'Grafik Designer',
'Requirements Engineer', 'System-Techniker', 'System-Ingenieur', 'Architekt', 'Solutions Architect',
'Projektleiter (M1)', 'Bereichsleiter (M2)', 'Bereichsleiter GL (M3)', 'Kaufmann / Kauffrau', 'Controller',
'Marketing- und Kommunikationsfachmann / -fachfrau', 'Verkäufer', 'Key Account Manager']);
let countriesArray = Object.entries(getNames("de"))
this.set('countries', countriesArray);
let origin = this.get('person.origin');
this.selectedCountry = countriesArray.find(function(country) {
return country[1] == origin
});
},

sortedRoles: computed(function() {
return this.get('roles').sort()
}),

companiesToSelect: computed(function() {
return this.get('store').findAll('company');
}),
Expand All @@ -24,6 +45,14 @@ export default Component.extend({
return !blurredEl.classList.contains('ember-power-select-search-input');
},

getCountryByName(name) {
return this.countries.find(function(country) {
if (country.name == name) {
return country;
}
});
},

actions: {
submit(changeset) {
return changeset.save()
Expand All @@ -49,7 +78,17 @@ export default Component.extend({
},

handleBlur() {
}
},

setBirthdate(selectedDate) {
this.set('person.birthdate', selectedDate[0]);
},

setOrigin(selectedCountry) {
this.set('person.origin', selectedCountry[1]);
this.set('selectedCountry', selectedCountry);
},

}

});
31 changes: 30 additions & 1 deletion frontend/app/components/person-new.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,31 @@ import { inject as service } from '@ember/service';
import Component from '@ember/component';
import { computed } from '@ember/object';
import { isBlank } from '@ember/utils';
import { getNames } from 'ember-i18n-iso-countries';

export default Component.extend({
i18n: service(),
store: service(),

init() {
this._super(...arguments);
this.martialStatuses = ['ledig', 'verheiratet', 'verwittwet', 'eingetragene Partnerschaft', 'geschieden'];
this.roles = (['Software-Entwickler', 'Software-Ingenieur', 'User Experience Consultant', 'Grafik Designer',
'Requirements Engineer', 'System-Techniker', 'System-Ingenieur', 'Architekt', 'Solutions Architect',
'Projektleiter (M1)', 'Bereichsleiter (M2)', 'Bereichsleiter GL (M3)', 'Kaufmann / Kauffrau', 'Controller',
'Marketing- und Kommunikationsfachmann / -fachfrau', 'Verkäufer', 'Key Account Manager']);
let countriesArray = Object.entries(getNames("de"))
this.set('countries', countriesArray);
let origin = this.get('person.origin');
this.selectedCountry = countriesArray.find(function(country) {
return country[1] == origin
});
},

sortedRoles: computed(function() {
return this.get('roles').sort()
}),

companiesToSelect: computed(function() {
return this.get('store').findAll('company');
}),
Expand Down Expand Up @@ -40,6 +60,15 @@ export default Component.extend({
},

handleBlur() {
}
},

setBirthdate(selectedDate) {
this.set('newPerson.birthdate', selectedDate[0]);
},

setOrigin(selectedCountry) {
this.set('newPerson.origin', selectedCountry[1]);
this.set('selectedCountry', selectedCountry)
},
}
});
7 changes: 7 additions & 0 deletions frontend/app/helpers/to-lowercase.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { helper } from '@ember/component/helper';

export function toLowercase(params) {
return params[0].toLowerCase();
}

export default helper(toLowercase);
1 change: 1 addition & 0 deletions frontend/app/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ $success: #61B44B !default;
@import "fws";
@import "ember-basic-dropdown";
@import "ember-power-select";
@import "flag-icon.min";

html,
button,
Expand Down
20 changes: 19 additions & 1 deletion frontend/app/styles/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,10 @@ hr {
margin-right: 5px;
}

.flag-icon {
margin-right: 5px;
}

/* Competence Section
-------------------------------------------------- */
.vertical-center {
Expand Down Expand Up @@ -599,6 +603,10 @@ form textarea{
font-size: 90%;
}

.datepicker_fix {

}

.table-uebersicht tr td:first-child {
text-align: right;
font-weight: bold;
Expand Down Expand Up @@ -736,7 +744,7 @@ table.fws tr td:last-child {
width: 30px;
}

/* Power Select */
/* Power Select Multiple */
li.ember-power-select-multiple-option {
color: #fff;
background-color: #28a745;
Expand All @@ -762,6 +770,16 @@ span.ember-power-select-selected-item {
text-align: left;
}

/* Power Select */
/* options is for the options it displays*/
li.ember-power-select-option {
}

/* selected is for the selected option, in this case used to not make the font bold*/
span.ember-power-select-selected-item {
font-weight: normal;
}

/* Style Fixes */
a:focus {
outline: none;
Expand Down
1 change: 1 addition & 0 deletions frontend/app/styles/flag-icon.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion frontend/app/templates/components/competences-show.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</div>
<div class="col-sm-9">
{{#each competenceList as |competence|}}
<span class="badge badge-success p-2 mr-2 mb-2 skill" href="#">{{competence}}</span>
<span class="old-competence-list-entity badge badge-success p-2 mr-2 mb-2 skill" href="#">{{competence}}</span>
{{/each}}
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions frontend/app/templates/components/people-search.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{#power-select
triggerId="people-search"
selected=selected
options=peopleToSelect
searchEnabled=true
Expand Down
Loading

0 comments on commit dba8b3a

Please sign in to comment.