shimmer 0.0.6 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shimmer/tasks/db.rake +6 -3
- data/lib/shimmer/utils/localizable.rb +25 -24
- data/lib/shimmer/version.rb +1 -1
- data/src/index.ts +11 -3
- data/src/modal.ts +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bd35afc832326e3510edad8c3bd0e4953ad4e34e6bd1b2c75f280df15efb4e6
|
4
|
+
data.tar.gz: bb11df2bdc2de3e2b94f9f3ebccf0732d903d1d045b1c159a138f5aa0dc9214d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53c455d63d7683234d565bac406c3deb95c2d6926b6bde7c71299fd0357842576cec99a10ae38b3a69656dd4594b15a93eca9d96351eea2110c26b0623ef7f09
|
7
|
+
data.tar.gz: 311c7cd5b3bf082fdeefec75b87cd50245459446490f35abd488429d2b3e13e508504a94dbc2976b4c8809366d041d4d003a7e781528bef80350b9ad61093c8a
|
data/lib/shimmer/tasks/db.rake
CHANGED
@@ -3,14 +3,17 @@
|
|
3
3
|
namespace :db do
|
4
4
|
desc "Downloads the app database from heroku to local db"
|
5
5
|
task pull_data: :environment do
|
6
|
-
config =
|
7
|
-
|
6
|
+
config = if Rails.version.to_f >= 7
|
7
|
+
ActiveRecord::Base.connection_db_config.configuration_hash.with_indifferent_access
|
8
|
+
else
|
9
|
+
ActiveRecord::Base.connection_db_config.config
|
10
|
+
end
|
8
11
|
ENV["DISABLE_DATABASE_ENVIRONMENT_CHECK"] = "1"
|
9
12
|
Rake::Task["db:drop"].invoke
|
10
13
|
ENV["PGUSER"] = config["username"]
|
11
14
|
ENV["PGHOST"] = config["host"]
|
12
15
|
ENV["PGPORT"] = config["port"].to_s
|
13
|
-
sh "heroku pg:pull DATABASE_URL #{config["database"]}
|
16
|
+
sh "heroku pg:pull DATABASE_URL #{config["database"]}"
|
14
17
|
sh "rails db:environment:set"
|
15
18
|
sh "RAILS_ENV=test rails db:create"
|
16
19
|
end
|
@@ -29,31 +29,32 @@ module Shimmer
|
|
29
29
|
def url_locale
|
30
30
|
params[:locale]
|
31
31
|
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
module I18n
|
37
|
-
UNTRANSLATED_SCOPES = ["number", "transliterate", "date", "datetime", "errors", "helpers", "support", "time", "faker"].map { |k| "#{k}." }
|
38
|
-
|
39
|
-
thread_mattr_accessor :debug
|
40
32
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
33
|
+
I18n.class_eval do
|
34
|
+
next if defined? debug
|
35
|
+
|
36
|
+
thread_mattr_accessor :debug
|
37
|
+
|
38
|
+
class << self
|
39
|
+
alias_method :old_translate, :translate
|
40
|
+
def translate(key, options = {})
|
41
|
+
untranslated_scopes = ["number", "transliterate", "date", "datetime", "errors", "helpers", "support", "time", "faker"].map { |k| "#{k}." }
|
42
|
+
key = key.to_s.downcase
|
43
|
+
untranslated = untranslated_scopes.any? { |e| key.include? e }
|
44
|
+
key_name = [options[:scope], key].flatten.compact.join(".")
|
45
|
+
option_names = options.except(:count, :default, :raise, :scope).map { |k, v| "#{k}=#{v}" }.join(", ")
|
46
|
+
return "#{key_name} #{option_names}" if I18n.debug && !untranslated
|
47
|
+
|
48
|
+
options.reverse_merge!(default: old_translate(key, **options.merge(locale: :de))) if untranslated
|
49
|
+
old_translate(key, **options)
|
50
|
+
end
|
51
|
+
alias_method :t, :translate
|
52
|
+
|
53
|
+
def debug?
|
54
|
+
debug
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
57
58
|
end
|
58
59
|
end
|
59
60
|
end
|
data/lib/shimmer/version.rb
CHANGED
data/src/index.ts
CHANGED
@@ -16,14 +16,22 @@ declare global {
|
|
16
16
|
}
|
17
17
|
}
|
18
18
|
|
19
|
+
function createRemoteDestination(): void {
|
20
|
+
if (document.getElementById("shimmer")) {
|
21
|
+
return;
|
22
|
+
}
|
23
|
+
const root = document.createElement("div");
|
24
|
+
root.id = "shimmer";
|
25
|
+
document.body.append(root);
|
26
|
+
}
|
27
|
+
|
19
28
|
export async function start({
|
20
29
|
application,
|
21
30
|
}: {
|
22
31
|
application: Application;
|
23
32
|
}): Promise<void> {
|
24
|
-
|
25
|
-
|
26
|
-
document.body.append(root);
|
33
|
+
window.addEventListener("turbo:load", createRemoteDestination);
|
34
|
+
createRemoteDestination();
|
27
35
|
application.register("remote-navigation", RemoteNavigationController);
|
28
36
|
window.ui = {
|
29
37
|
modal: new ModalPresenter(),
|
data/src/modal.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { createElement, nextFrame, getHTML } from "./util";
|
2
2
|
|
3
3
|
export interface ModalOptions {
|
4
4
|
id?: string;
|
@@ -11,7 +11,7 @@ export class ModalPresenter {
|
|
11
11
|
private modals: Record<string, Modal> = {};
|
12
12
|
|
13
13
|
constructor() {
|
14
|
-
|
14
|
+
document.addEventListener("turbo:load", this.prepareBlind);
|
15
15
|
}
|
16
16
|
|
17
17
|
async open(options: ModalOptions): Promise<void> {
|
@@ -38,9 +38,9 @@ export class ModalPresenter {
|
|
38
38
|
document.body.classList.toggle("modal-open", open);
|
39
39
|
}
|
40
40
|
|
41
|
-
private
|
41
|
+
private prepareBlind: () => void = () => {
|
42
42
|
createElement(document.body, "modal-blind");
|
43
|
-
}
|
43
|
+
};
|
44
44
|
}
|
45
45
|
|
46
46
|
export class Modal {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shimmer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Ravens
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|