From 02a2ecdd01d7576ce2a165fc9315aa5daefb5fd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Wo=C5=BAniak?= Date: Mon, 10 Aug 2020 22:34:19 +0200 Subject: [PATCH] Change Epic to own type --- Cargo.lock | 722 +++++++++--------- jirs-client/src/modal/add_issue.rs | 1 + jirs-client/src/model.rs | 10 +- jirs-client/src/shared/styled_icon.rs | 8 +- jirs-client/src/shared/styled_rte.rs | 4 +- jirs-data/src/lib.rs | 34 +- jirs-data/src/sql.rs | 2 - .../2020-08-10-194809_change_epic/down.sql | 21 + .../2020-08-10-194809_change_epic/up.sql | 33 + jirs-server/src/db/issues.rs | 8 +- jirs-server/src/main.rs | 1 + jirs-server/src/models.rs | 5 +- jirs-server/src/schema.rs | 57 ++ jirs-server/src/ws/issues.rs | 1 + 14 files changed, 517 insertions(+), 390 deletions(-) create mode 100644 jirs-server/migrations/2020-08-10-194809_change_epic/down.sql create mode 100644 jirs-server/migrations/2020-08-10-194809_change_epic/up.sql diff --git a/Cargo.lock b/Cargo.lock index 53cf04f7..c7e39a7f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6,23 +6,23 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4af87564ff659dee8f9981540cac9418c45e910c8072fdedd643a262a38fcaf" dependencies = [ - "actix-http", - "actix-rt", - "actix_derive", - "bitflags", - "bytes", - "crossbeam-channel", - "derive_more", - "futures 0.3.5", - "lazy_static", - "log", - "parking_lot 0.10.2", - "pin-project", - "smallvec", - "tokio", - "tokio-util 0.2.0", - "trust-dns-proto", - "trust-dns-resolver", + "actix-http", + "actix-rt", + "actix_derive", + "bitflags", + "bytes", + "crossbeam-channel", + "derive_more", + "futures 0.3.5", + "lazy_static", + "log", + "parking_lot 0.10.2", + "pin-project", + "smallvec", + "tokio", + "tokio-util 0.2.0", + "trust-dns-proto", + "trust-dns-resolver", ] [[package]] @@ -222,8 +222,8 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0052435d581b5be835d11f4eb3bce417c8af18d87ddf8ace99f8e67e595882bb" dependencies = [ - "futures-util", - "pin-project", + "futures-util", + "pin-project", ] [[package]] @@ -246,13 +246,13 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d209f04d002854b9afd3743032a27b066158817965bf5d036824d19ac2cc0e30" dependencies = [ - "derive_more", - "futures-channel", - "lazy_static", - "log", - "num_cpus", - "parking_lot 0.11.0", - "threadpool", + "derive_more", + "futures-channel", + "lazy_static", + "log", + "num_cpus", + "parking_lot 0.11.0", + "threadpool", ] [[package]] @@ -368,7 +368,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072" dependencies = [ - "gimli", + "gimli", ] [[package]] @@ -392,7 +392,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" dependencies = [ - "winapi 0.3.9", + "winapi 0.3.9", ] [[package]] @@ -436,9 +436,9 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", - "libc", - "winapi 0.3.9", + "hermit-abi", + "libc", + "winapi 0.3.9", ] [[package]] @@ -482,12 +482,12 @@ version = "0.3.50" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46254cf2fdcdf1badb5934448c1bcbe046a56537b3987d96c51a7afc5d03f293" dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", ] [[package]] @@ -669,12 +669,12 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c74d84029116787153e02106bf53e66828452a4b325cc8652b788b5967c0a0b6" dependencies = [ - "js-sys", - "num-integer", - "num-traits", - "serde", - "time 0.1.43", - "wasm-bindgen", + "js-sys", + "num-integer", + "num-traits", + "serde", + "time 0.1.43", + "wasm-bindgen", ] [[package]] @@ -683,13 +683,13 @@ version = "2.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10040cdf04294b565d9e0319955430099ec3813a64c952b86a41200ad714ae48" dependencies = [ - "ansi_term", - "atty", - "bitflags", - "strsim", - "textwrap", - "unicode-width", - "vec_map", + "ansi_term", + "atty", + "bitflags", + "strsim", + "textwrap", + "unicode-width", + "vec_map", ] [[package]] @@ -698,7 +698,7 @@ version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" dependencies = [ - "bitflags", + "bitflags", ] [[package]] @@ -707,7 +707,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4344512281c643ae7638bbabc3af17a11307803ec8f0fcad9fae512a8bf36467" dependencies = [ - "bitflags", + "bitflags", ] [[package]] @@ -716,15 +716,15 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b818732a109eeabbe99fee28030ff8ecbd606889fcd25509ed933e6c69b7aa69" dependencies = [ - "clap", - "entities", - "lazy_static", - "pest", - "pest_derive", - "regex", - "twoway", - "typed-arena", - "unicode_categories", + "clap", + "entities", + "lazy_static", + "pest", + "pest_derive", + "regex", + "twoway", + "typed-arena", + "unicode_categories", ] [[package]] @@ -790,8 +790,8 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ee0cc8804d5393478d743b035099520087a5186f3b93fa58cec08fa62407b6" dependencies = [ - "cfg-if", - "crossbeam-utils", + "cfg-if", + "crossbeam-utils", ] [[package]] @@ -830,9 +830,9 @@ version = "0.99.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "298998b1cf6b5b2c8a7b023dfd45821825ce3ba8a8af55c921a0e734e4653f76" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -895,9 +895,9 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a" dependencies = [ - "libc", - "redox_users", - "winapi 0.3.9", + "libc", + "redox_users", + "winapi 0.3.9", ] [[package]] @@ -1030,10 +1030,10 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c5f0096a91d210159eceb2ff5e1c4da18388a170e1e3ce948aac9c8fdbbf595" dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", + "heck", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -1092,10 +1092,10 @@ version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed85775dcc68644b5c950ac06a2b23768d3bc9390464151aaf27136998dcf9e" dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "winapi 0.3.9", + "cfg-if", + "libc", + "redox_syscall", + "winapi 0.3.9", ] [[package]] @@ -1104,10 +1104,10 @@ version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68c90b0fc46cf89d227cc78b40e494ff81287a92dd07631e5af0d06fe3cf885e" dependencies = [ - "cfg-if", - "crc32fast", - "libc", - "miniz_oxide", + "cfg-if", + "crc32fast", + "libc", + "miniz_oxide", ] [[package]] @@ -1366,17 +1366,17 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "993f9e0baeed60001cf565546b0d3dbe6a6ad23f2bd31644a133c641eccf6d53" dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util 0.3.1", - "tracing", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util 0.3.1", + "tracing", ] [[package]] @@ -1385,7 +1385,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e91b62f79061a0bc2e046024cb7ba44b08419ed238ecbd9adbd787434b9e8c25" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.0.0", ] [[package]] @@ -1394,7 +1394,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" dependencies = [ - "unicode-segmentation", + "unicode-segmentation", ] [[package]] @@ -1403,7 +1403,7 @@ version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9" dependencies = [ - "libc", + "libc", ] [[package]] @@ -1438,9 +1438,9 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" dependencies = [ - "libc", - "match_cfg", - "winapi 0.3.9", + "libc", + "match_cfg", + "winapi 0.3.9", ] [[package]] @@ -1485,22 +1485,22 @@ version = "0.13.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e68a8dd9716185d9e64ea473ea6ef63529252e3e27623295a0378a19665d5eb" dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "itoa", - "pin-project", - "socket2", - "time 0.1.43", - "tokio", - "tower-service", - "tracing", - "want", + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "itoa", + "pin-project", + "socket2", + "time 0.1.43", + "tokio", + "tower-service", + "tracing", + "want", ] [[package]] @@ -1509,11 +1509,11 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d979acc56dcb5b8dddba3917601745e877576475aa046df3226eabdecef78eed" dependencies = [ - "bytes", - "hyper", - "native-tls", - "tokio", - "tokio-tls", + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-tls", ] [[package]] @@ -1533,8 +1533,8 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86b45e59b16c76b11bf9738fd5d38879d3bd28ad292d7b313608becb17ae2df9" dependencies = [ - "autocfg 1.0.0", - "hashbrown", + "autocfg 1.0.0", + "hashbrown", ] [[package]] @@ -1554,7 +1554,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e74a1aa87c59aeff6ef2cc2fa62d41bc43f54952f55652656b18a02fd5e356c0" dependencies = [ - "libc", + "libc", ] [[package]] @@ -1569,7 +1569,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" dependencies = [ - "libc", + "libc", ] [[package]] @@ -1578,10 +1578,10 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7e2f18aece9709094573a9f24f483c4f65caa4298e2f7ae1b71cc65d853fad7" dependencies = [ - "socket2", - "widestring", - "winapi 0.3.9", - "winreg", + "socket2", + "widestring", + "winapi 0.3.9", + "winreg", ] [[package]] @@ -1708,7 +1708,7 @@ version = "0.3.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85a7e2c92a4804dd459b86c339278d0fe87cf93757fae222c3fa3ae75458bc73" dependencies = [ - "wasm-bindgen", + "wasm-bindgen", ] [[package]] @@ -1798,7 +1798,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28247cc5a5be2f05fbcd76dd0cf2c7d3b5400cb978a28042abcd4fa0b3f8261c" dependencies = [ - "scopeguard", + "scopeguard", ] [[package]] @@ -1807,7 +1807,7 @@ version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" dependencies = [ - "cfg-if", + "cfg-if", ] [[package]] @@ -1877,7 +1877,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be0f75932c1f6cfae3c04000e40114adf955636e19040f9c0a2c380702aa1c7f" dependencies = [ - "adler", + "adler", ] [[package]] @@ -1917,10 +1917,10 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0840c1c50fd55e521b247f949c241c9997709f23bd7f023b9762cd561e935656" dependencies = [ - "log", - "mio", - "miow 0.3.5", - "winapi 0.3.9", + "log", + "mio", + "miow 0.3.5", + "winapi 0.3.9", ] [[package]] @@ -1952,8 +1952,8 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07b88fb9795d4d36d62a012dfbf49a8f5cf12751f36d31a9dbe66d528e58979e" dependencies = [ - "socket2", - "winapi 0.3.9", + "socket2", + "winapi 0.3.9", ] [[package]] @@ -1980,9 +1980,9 @@ version = "0.2.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" dependencies = [ - "cfg-if", - "libc", - "winapi 0.3.9", + "cfg-if", + "libc", + "winapi 0.3.9", ] [[package]] @@ -2001,16 +2001,16 @@ version = "4.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80ae4a7688d1fab81c5bf19c64fc8db920be8d519ce6336ed4e7efe024724dbd" dependencies = [ - "bitflags", - "filetime", - "fsevent", - "fsevent-sys", - "inotify", - "libc", - "mio", - "mio-extras", - "walkdir", - "winapi 0.3.9", + "bitflags", + "filetime", + "fsevent", + "fsevent-sys", + "inotify", + "libc", + "mio", + "mio-extras", + "walkdir", + "winapi 0.3.9", ] [[package]] @@ -2083,12 +2083,12 @@ version = "0.10.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d575eff3665419f9b83678ff2815858ad9d11567e082f5ac1814baba4e2bcb4" dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "lazy_static", - "libc", - "openssl-sys", + "bitflags", + "cfg-if", + "foreign-types", + "lazy_static", + "libc", + "openssl-sys", ] [[package]] @@ -2103,11 +2103,11 @@ version = "0.9.58" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" dependencies = [ - "autocfg 1.0.0", - "cc", - "libc", - "pkg-config", - "vcpkg", + "autocfg 1.0.0", + "cc", + "libc", + "pkg-config", + "vcpkg", ] [[package]] @@ -2116,8 +2116,8 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" dependencies = [ - "lock_api 0.3.4", - "parking_lot_core 0.7.2", + "lock_api 0.3.4", + "parking_lot_core 0.7.2", ] [[package]] @@ -2126,9 +2126,9 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4893845fa2ca272e647da5d0e46660a314ead9c2fdd9a883aabc32e481a8733" dependencies = [ - "instant", - "lock_api 0.4.1", - "parking_lot_core 0.8.0", + "instant", + "lock_api 0.4.1", + "parking_lot_core 0.8.0", ] [[package]] @@ -2137,12 +2137,12 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" dependencies = [ - "cfg-if", - "cloudabi 0.0.3", - "libc", - "redox_syscall", - "smallvec", - "winapi 0.3.9", + "cfg-if", + "cloudabi 0.0.3", + "libc", + "redox_syscall", + "smallvec", + "winapi 0.3.9", ] [[package]] @@ -2151,13 +2151,13 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b" dependencies = [ - "cfg-if", - "cloudabi 0.1.0", - "instant", - "libc", - "redox_syscall", - "smallvec", - "winapi 0.3.9", + "cfg-if", + "cloudabi 0.1.0", + "instant", + "libc", + "redox_syscall", + "smallvec", + "winapi 0.3.9", ] [[package]] @@ -2215,7 +2215,7 @@ version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca4433fff2ae79342e497d9f8ee990d174071408f28f726d6d83af93e58e48aa" dependencies = [ - "pin-project-internal", + "pin-project-internal", ] [[package]] @@ -2224,9 +2224,9 @@ version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c0e815c3ee9a031fdf5af21c10aa17c573c9c6a566328d99e3936c34e36461f" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -2290,7 +2290,7 @@ version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12" dependencies = [ - "unicode-xid", + "unicode-xid", ] [[package]] @@ -2299,10 +2299,10 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca36dea94d187597e104a5c8e4b07576a8a45aa5db48a65e12940d3eb7461f55" dependencies = [ - "bitflags", - "getopts", - "memchr", - "unicase", + "bitflags", + "getopts", + "memchr", + "unicase", ] [[package]] @@ -2326,9 +2326,9 @@ version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "545c5bc2b880973c9c10e4067418407a0ccaa3091781d1671d46eb35107cb26f" dependencies = [ - "log", - "parking_lot 0.11.0", - "scheduled-thread-pool", + "log", + "parking_lot 0.11.0", + "scheduled-thread-pool", ] [[package]] @@ -2337,11 +2337,11 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" dependencies = [ - "fuchsia-cprng", - "libc", - "rand_core 0.3.1", - "rdrand", - "winapi 0.3.9", + "fuchsia-cprng", + "libc", + "rand_core 0.3.1", + "rdrand", + "winapi 0.3.9", ] [[package]] @@ -2350,17 +2350,17 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" dependencies = [ - "autocfg 0.1.7", - "libc", - "rand_chacha 0.1.1", - "rand_core 0.4.2", - "rand_hc 0.1.0", - "rand_isaac", - "rand_jitter", - "rand_os", - "rand_pcg 0.1.2", - "rand_xorshift", - "winapi 0.3.9", + "autocfg 0.1.7", + "libc", + "rand_chacha 0.1.1", + "rand_core 0.4.2", + "rand_hc 0.1.0", + "rand_isaac", + "rand_jitter", + "rand_os", + "rand_pcg 0.1.2", + "rand_xorshift", + "winapi 0.3.9", ] [[package]] @@ -2454,9 +2454,9 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" dependencies = [ - "libc", - "rand_core 0.4.2", - "winapi 0.3.9", + "libc", + "rand_core 0.4.2", + "winapi 0.3.9", ] [[package]] @@ -2465,12 +2465,12 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" dependencies = [ - "cloudabi 0.0.3", - "fuchsia-cprng", - "libc", - "rand_core 0.4.2", - "rdrand", - "winapi 0.3.9", + "cloudabi 0.0.3", + "fuchsia-cprng", + "libc", + "rand_core 0.4.2", + "rdrand", + "winapi 0.3.9", ] [[package]] @@ -2560,7 +2560,7 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" dependencies = [ - "winapi 0.3.9", + "winapi 0.3.9", ] [[package]] @@ -2579,27 +2579,27 @@ version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a8d624cb48fcaca612329e4dd544380aa329ef338e83d3a90f5b7897e631971" dependencies = [ - "async-trait", - "base64 0.12.3", - "bytes", - "futures 0.3.5", - "hmac", - "http", - "hyper", - "hyper-tls", - "lazy_static", - "log", - "md5", - "percent-encoding", - "pin-project", - "rusoto_credential", - "rusoto_signature", - "rustc_version", - "serde", - "serde_json", - "sha2", - "tokio", - "xml-rs", + "async-trait", + "base64 0.12.3", + "bytes", + "futures 0.3.5", + "hmac", + "http", + "hyper", + "hyper-tls", + "lazy_static", + "log", + "md5", + "percent-encoding", + "pin-project", + "rusoto_credential", + "rusoto_signature", + "rustc_version", + "serde", + "serde_json", + "sha2", + "tokio", + "xml-rs", ] [[package]] @@ -2641,23 +2641,23 @@ version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62940a2bd479900a1bf8935b8f254d3e19368ac3ac4570eb4bd48eb46551a1b7" dependencies = [ - "base64 0.12.3", - "bytes", - "futures 0.3.5", - "hex", - "hmac", - "http", - "hyper", - "log", - "md5", - "percent-encoding", - "pin-project", - "rusoto_credential", - "rustc_version", - "serde", - "sha2", - "time 0.2.16", - "tokio", + "base64 0.12.3", + "bytes", + "futures 0.3.5", + "hex", + "hmac", + "http", + "hyper", + "log", + "md5", + "percent-encoding", + "pin-project", + "rusoto_credential", + "rustc_version", + "serde", + "sha2", + "time 0.2.16", + "tokio", ] [[package]] @@ -2714,8 +2714,8 @@ version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" dependencies = [ - "lazy_static", - "winapi 0.3.9", + "lazy_static", + "winapi 0.3.9", ] [[package]] @@ -2724,7 +2724,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc6f74fd1204073fa02d5d5d68bec8021be4c38690b61264b2fdb48083d0e7d7" dependencies = [ - "parking_lot 0.11.0", + "parking_lot 0.11.0", ] [[package]] @@ -2829,9 +2829,9 @@ version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "164eacbdb13512ec2745fb09d51fd5b22b0d65ed294a1dcf7285a360c80a675c" dependencies = [ - "itoa", - "ryu", - "serde", + "itoa", + "ryu", + "serde", ] [[package]] @@ -2888,8 +2888,8 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e12110bc539e657a646068aaf5eb5b63af9d0c1f7b29c97113fad80e15f035" dependencies = [ - "arc-swap", - "libc", + "arc-swap", + "libc", ] [[package]] @@ -2910,10 +2910,10 @@ version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "winapi 0.3.9", + "cfg-if", + "libc", + "redox_syscall", + "winapi 0.3.9", ] [[package]] @@ -2992,9 +2992,9 @@ version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e69abc24912995b3038597a7a593be5053eb0fb44f3cc5beec0deb421790c1f4" dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", + "proc-macro2", + "quote", + "unicode-xid", ] [[package]] @@ -3015,12 +3015,12 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" dependencies = [ - "cfg-if", - "libc", - "rand 0.7.3", - "redox_syscall", - "remove_dir_all", - "winapi 0.3.9", + "cfg-if", + "libc", + "rand 0.7.3", + "redox_syscall", + "remove_dir_all", + "winapi 0.3.9", ] [[package]] @@ -3077,8 +3077,8 @@ version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" dependencies = [ - "libc", - "winapi 0.3.9", + "libc", + "winapi 0.3.9", ] [[package]] @@ -3087,13 +3087,13 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a51cadc5b1eec673a685ff7c33192ff7b7603d0b75446fb354939ee615acb15" dependencies = [ - "cfg-if", - "libc", - "standback", - "stdweb", - "time-macros", - "version_check 0.9.2", - "winapi 0.3.9", + "cfg-if", + "libc", + "standback", + "stdweb", + "time-macros", + "version_check 0.9.2", + "winapi 0.3.9", ] [[package]] @@ -3131,21 +3131,21 @@ version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd" dependencies = [ - "bytes", - "fnv", - "futures-core", - "iovec", - "lazy_static", - "libc", - "memchr", - "mio", - "mio-named-pipes", - "mio-uds", - "pin-project-lite", - "signal-hook-registry", - "slab", - "tokio-macros", - "winapi 0.3.9", + "bytes", + "fnv", + "futures-core", + "iovec", + "lazy_static", + "libc", + "memchr", + "mio", + "mio-named-pipes", + "mio-uds", + "pin-project-lite", + "signal-hook-registry", + "slab", + "tokio-macros", + "winapi 0.3.9", ] [[package]] @@ -3203,7 +3203,7 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a" dependencies = [ - "serde", + "serde", ] [[package]] @@ -3218,9 +3218,9 @@ version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0aae59226cf195d8e74d4b34beae1859257efb4e5fed3f147d2dc2c7d372178" dependencies = [ - "cfg-if", - "log", - "tracing-core", + "cfg-if", + "log", + "tracing-core", ] [[package]] @@ -3229,7 +3229,7 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d593f98af59ebc017c0648f0117525db358745a8894a8d684e185ba3f45954f9" dependencies = [ - "lazy_static", + "lazy_static", ] [[package]] @@ -3238,18 +3238,18 @@ version = "0.18.0-alpha.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a7f3a2ab8a919f5eca52a468866a67ed7d3efa265d48a652a9a3452272b413f" dependencies = [ - "async-trait", - "enum-as-inner", - "failure", - "futures 0.3.5", - "idna", - "lazy_static", - "log", - "rand 0.7.3", - "smallvec", - "socket2", - "tokio", - "url", + "async-trait", + "enum-as-inner", + "failure", + "futures 0.3.5", + "idna", + "lazy_static", + "log", + "rand 0.7.3", + "smallvec", + "socket2", + "tokio", + "url", ] [[package]] @@ -3478,9 +3478,9 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" dependencies = [ - "same-file", - "winapi 0.3.9", - "winapi-util", + "same-file", + "winapi 0.3.9", + "winapi-util", ] [[package]] @@ -3505,10 +3505,10 @@ version = "0.2.67" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0563a9a4b071746dd5aedbc3a28c6fe9be4586fb3fbadb67c400d4f53c6b16c" dependencies = [ - "cfg-if", - "serde", - "serde_json", - "wasm-bindgen-macro", + "cfg-if", + "serde", + "serde_json", + "wasm-bindgen-macro", ] [[package]] @@ -3517,13 +3517,13 @@ version = "0.2.67" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc71e4c5efa60fb9e74160e89b93353bc24059999c0ae0fb03affc39770310b0" dependencies = [ - "bumpalo", - "lazy_static", - "log", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", + "bumpalo", + "lazy_static", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", ] [[package]] @@ -3532,10 +3532,10 @@ version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95f8d235a77f880bcef268d379810ea6c0af2eacfa90b1ad5af731776e0c4699" dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", ] [[package]] @@ -3544,8 +3544,8 @@ version = "0.2.67" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97c57cefa5fa80e2ba15641578b44d36e7a64279bc5ed43c6dbaf329457a2ed2" dependencies = [ - "quote", - "wasm-bindgen-macro-support", + "quote", + "wasm-bindgen-macro-support", ] [[package]] @@ -3554,11 +3554,11 @@ version = "0.2.67" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "841a6d1c35c6f596ccea1f82504a192a60378f64b3bb0261904ad8f2f5657556" dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", ] [[package]] @@ -3573,12 +3573,12 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d92df9d5715606f9e48f85df3b78cb77ae44a2ea9a5f2a785a97bd0066b9300" dependencies = [ - "console_error_panic_hook", - "js-sys", - "scoped-tls", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-bindgen-test-macro", + "console_error_panic_hook", + "js-sys", + "scoped-tls", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-bindgen-test-macro", ] [[package]] @@ -3587,8 +3587,8 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51611ce8e84cba89379d91fc5074bacc5530f69da1c09a2853d906129d12b3b8" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2", + "quote", ] [[package]] @@ -3597,8 +3597,8 @@ version = "0.3.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dda38f4e5ca63eda02c059d243aa25b5f35ab98451e518c51612cd0f1bd19a47" dependencies = [ - "js-sys", - "wasm-bindgen", + "js-sys", + "wasm-bindgen", ] [[package]] @@ -3607,10 +3607,10 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" dependencies = [ - "cfg-if", - "libc", - "memory_units", - "winapi 0.3.9", + "cfg-if", + "libc", + "memory_units", + "winapi 0.3.9", ] [[package]] @@ -3631,8 +3631,8 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", ] [[package]] @@ -3653,7 +3653,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ - "winapi 0.3.9", + "winapi 0.3.9", ] [[package]] @@ -3668,7 +3668,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" dependencies = [ - "winapi 0.3.9", + "winapi 0.3.9", ] [[package]] @@ -3677,7 +3677,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7daf138b6b14196e3830a588acf1e86966c694d3e8fb026fb105b8b5dca07e6e" dependencies = [ - "winapi 0.3.9", + "winapi 0.3.9", ] [[package]] diff --git a/jirs-client/src/modal/add_issue.rs b/jirs-client/src/modal/add_issue.rs index 35a13d44..19cc2f76 100644 --- a/jirs-client/src/modal/add_issue.rs +++ b/jirs-client/src/modal/add_issue.rs @@ -50,6 +50,7 @@ pub fn update(msg: &Msg, model: &mut crate::model::Model, orders: &mut impl Orde project_id: modal.project_id.unwrap_or(project_id), user_ids: modal.user_ids.clone(), reporter_id: modal.reporter_id.unwrap_or_else(|| user_id), + epic_id: modal.epic_id, }; send_ws_msg( jirs_data::WsMsg::IssueCreateRequest(payload), diff --git a/jirs-client/src/model.rs b/jirs-client/src/model.rs index a8d863f1..e7e90cbd 100644 --- a/jirs-client/src/model.rs +++ b/jirs-client/src/model.rs @@ -161,10 +161,11 @@ pub struct AddIssueModal { pub estimate: Option, pub time_spent: Option, pub time_remaining: Option, - pub project_id: Option, - pub user_ids: Vec, - pub reporter_id: Option, - pub issue_status_id: i32, + pub project_id: Option, + pub user_ids: Vec, + pub reporter_id: Option, + pub issue_status_id: jirs_data::IssueStatusId, + pub epic_id: Option, // modal fields pub title_state: StyledInputState, @@ -188,6 +189,7 @@ impl Default for AddIssueModal { user_ids: Default::default(), reporter_id: Default::default(), issue_status_id: Default::default(), + epic_id: Default::default(), title_state: StyledInputState::new(FieldId::AddIssueModal(IssueFieldId::Title), ""), type_state: StyledSelectState::new(FieldId::AddIssueModal(IssueFieldId::Type), vec![]), reporter_state: StyledSelectState::new( diff --git a/jirs-client/src/shared/styled_icon.rs b/jirs-client/src/shared/styled_icon.rs index 797ea57e..28463fee 100644 --- a/jirs-client/src/shared/styled_icon.rs +++ b/jirs-client/src/shared/styled_icon.rs @@ -203,11 +203,11 @@ impl std::fmt::Display for Icon { impl From for Icon { fn from(t: IssueType) -> Self { + use IssueType::*; match t { - IssueType::Task => Icon::Task, - IssueType::Bug => Icon::Bug, - IssueType::Story => Icon::Story, - IssueType::Epic => Icon::Epic, + Task => Icon::Task, + Bug => Icon::Bug, + Story => Icon::Story, } } } diff --git a/jirs-client/src/shared/styled_rte.rs b/jirs-client/src/shared/styled_rte.rs index 219964e4..ef8ab133 100644 --- a/jirs-client/src/shared/styled_rte.rs +++ b/jirs-client/src/shared/styled_rte.rs @@ -153,7 +153,9 @@ impl RteMsg { let res = seed::document().query_selector(format!("#{}", identifier).as_str()); if let Ok(Some(el)) = res { if let Ok(el) = el.dyn_into::() { - el.focus().is_ok(); + if let Err(e) = el.focus() { + log!(e) + } } } None diff --git a/jirs-data/src/lib.rs b/jirs-data/src/lib.rs index e8cf7664..5c3fc615 100644 --- a/jirs-data/src/lib.rs +++ b/jirs-data/src/lib.rs @@ -28,6 +28,7 @@ pub type IssueStatusId = i32; pub type InvitationId = i32; pub type Position = i32; pub type MessageId = i32; +pub type EpicId = i32; pub type EmailString = String; pub type UsernameString = String; pub type TitleString = String; @@ -41,19 +42,14 @@ pub enum IssueType { Task, Bug, Story, - Epic, } impl ToVec for IssueType { type Item = IssueType; fn ordered() -> Vec { - vec![ - IssueType::Task, - IssueType::Bug, - IssueType::Story, - IssueType::Epic, - ] + use IssueType::*; + vec![Task, Bug, Story] } } @@ -65,11 +61,11 @@ impl Default for IssueType { impl IssueType { pub fn to_label(&self) -> &str { + use IssueType::*; match self { - IssueType::Task => "Task", - IssueType::Bug => "Bug", - IssueType::Story => "Story", - IssueType::Epic => "Epic", + Task => "Task", + Bug => "Bug", + Story => "Story", } } } @@ -80,7 +76,6 @@ impl Into for IssueType { IssueType::Task => 1, IssueType::Bug => 2, IssueType::Story => 3, - IssueType::Epic => 4, } } } @@ -91,7 +86,6 @@ impl Into for u32 { 1 => IssueType::Task, 2 => IssueType::Bug, 3 => IssueType::Story, - 4 => IssueType::Epic, _ => IssueType::Task, } } @@ -103,7 +97,6 @@ impl std::fmt::Display for IssueType { IssueType::Task => f.write_str("task"), IssueType::Bug => f.write_str("bug"), IssueType::Story => f.write_str("story"), - IssueType::Epic => f.write_str("epic"), } } } @@ -434,6 +427,7 @@ pub struct Issue { pub created_at: NaiveDateTime, pub updated_at: NaiveDateTime, pub issue_status_id: IssueStatusId, + pub epic_id: Option, pub user_ids: Vec, } @@ -612,6 +606,17 @@ pub struct Message { pub updated_at: NaiveDateTime, } +#[cfg_attr(feature = "backend", derive(Queryable))] +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +pub struct Epic { + pub id: EpicId, + pub name: String, + pub user_id: UserId, + pub project_id: ProjectId, + pub created_at: NaiveDateTime, + pub updated_at: NaiveDateTime, +} + #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] pub struct CreateCommentPayload { pub user_id: Option, @@ -639,6 +644,7 @@ pub struct CreateIssuePayload { pub user_ids: Vec, pub reporter_id: UserId, pub issue_status_id: IssueStatusId, + pub epic_id: Option, } #[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] diff --git a/jirs-data/src/sql.rs b/jirs-data/src/sql.rs index 574910be..5b3da0e3 100644 --- a/jirs-data/src/sql.rs +++ b/jirs-data/src/sql.rs @@ -55,7 +55,6 @@ fn issue_type_from_sql(bytes: Option<&[u8]>) -> deserialize::Result { b"task" => Ok(IssueType::Task), b"bug" => Ok(IssueType::Bug), b"story" => Ok(IssueType::Story), - b"epic" => Ok(IssueType::Epic), _ => Ok(IssueType::Task), } } @@ -78,7 +77,6 @@ impl ToSql for IssueType { IssueType::Task => out.write_all(b"task")?, IssueType::Story => out.write_all(b"story")?, IssueType::Bug => out.write_all(b"bug")?, - IssueType::Epic => out.write_all(b"epic")?, } Ok(IsNull::No) } diff --git a/jirs-server/migrations/2020-08-10-194809_change_epic/down.sql b/jirs-server/migrations/2020-08-10-194809_change_epic/down.sql new file mode 100644 index 00000000..5a2ded21 --- /dev/null +++ b/jirs-server/migrations/2020-08-10-194809_change_epic/down.sql @@ -0,0 +1,21 @@ +ALTER TABLE "issues" + ALTER COLUMN "issue_type" + SET DATA TYPE TEXT + USING "issue_type"::TEXT; + +DROP TYPE IF EXISTS "IssueTypeType" CASCADE; +CREATE TYPE "IssueTypeType" AS ENUM ( + 'task', + 'bug', + 'story', + 'epic' + ); + +ALTER TABLE "issues" + ALTER COLUMN "issue_type" + SET DATA TYPE "IssueTypeType" + USING "issue_type"::"IssueTypeType"; + +ALTER TABLE "issues" DROP COLUMN "epic_id"; + +DROP TABLE IF EXISTS epics; diff --git a/jirs-server/migrations/2020-08-10-194809_change_epic/up.sql b/jirs-server/migrations/2020-08-10-194809_change_epic/up.sql new file mode 100644 index 00000000..a61fe2be --- /dev/null +++ b/jirs-server/migrations/2020-08-10-194809_change_epic/up.sql @@ -0,0 +1,33 @@ +ALTER TABLE "issues" + ALTER COLUMN "issue_type" + SET DATA TYPE TEXT + USING "issue_type"::TEXT; + +UPDATE "issues" +SET "issue_type" = 'task' +WHERE "issue_type" = 'epic'; + +DROP TYPE IF EXISTS "IssueTypeType" CASCADE; +CREATE TYPE "IssueTypeType" AS ENUM ( + 'task', + 'bug', + 'story' + ); + +ALTER TABLE "issues" + ALTER COLUMN "issue_type" + SET DATA TYPE "IssueTypeType" + USING "issue_type"::"IssueTypeType"; + +CREATE TABLE epics ( + id serial primary key not null, + name text not null, + user_id integer not null references users (id), + project_id integer not null references projects (id), + created_at timestamp not null default now(), + updated_at timestamp not null default now() +); + +ALTER TABLE "issues" +ADD COLUMN "epic_id" integer +REFERENCES "epics" ( "id" ) NULL; diff --git a/jirs-server/src/db/issues.rs b/jirs-server/src/db/issues.rs index 3e3f741e..69b19d0f 100644 --- a/jirs-server/src/db/issues.rs +++ b/jirs-server/src/db/issues.rs @@ -214,9 +214,10 @@ pub struct CreateIssue { pub estimate: Option, pub time_spent: Option, pub time_remaining: Option, - pub project_id: i32, - pub reporter_id: i32, - pub user_ids: Vec, + pub project_id: jirs_data::ProjectId, + pub reporter_id: jirs_data::UserId, + pub user_ids: Vec, + pub epic_id: Option, } impl Message for CreateIssue { @@ -272,6 +273,7 @@ impl Handler for DbExecutor { time_remaining: msg.time_remaining, reporter_id: msg.reporter_id, project_id: msg.project_id, + epic_id: msg.epic_id, }; let issue = diesel::insert_into(issues) diff --git a/jirs-server/src/main.rs b/jirs-server/src/main.rs index 306df337..382d40c5 100644 --- a/jirs-server/src/main.rs +++ b/jirs-server/src/main.rs @@ -1,5 +1,6 @@ #![feature(async_closure)] #![feature(vec_remove_item)] +#![recursion_limit = "256"] #[macro_use] extern crate diesel; diff --git a/jirs-server/src/models.rs b/jirs-server/src/models.rs index b1651be3..abb9ec67 100644 --- a/jirs-server/src/models.rs +++ b/jirs-server/src/models.rs @@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize}; use uuid::Uuid; use jirs_data::{ - InvitationState, IssuePriority, IssueStatusId, IssueType, ProjectCategory, ProjectId, + EpicId, InvitationState, IssuePriority, IssueStatusId, IssueType, ProjectCategory, ProjectId, TimeTracking, UserId, }; @@ -34,6 +34,7 @@ pub struct Issue { pub created_at: NaiveDateTime, pub updated_at: NaiveDateTime, pub issue_status_id: IssueStatusId, + pub epic_id: Option, } impl Into for Issue { @@ -54,6 +55,7 @@ impl Into for Issue { created_at: self.created_at, updated_at: self.updated_at, issue_status_id: self.issue_status_id, + epic_id: self.epic_id, user_ids: vec![], } @@ -75,6 +77,7 @@ pub struct CreateIssueForm { pub reporter_id: UserId, pub project_id: ProjectId, pub issue_status_id: IssueStatusId, + pub epic_id: Option, } #[derive(Debug, Serialize, Deserialize, Insertable)] diff --git a/jirs-server/src/schema.rs b/jirs-server/src/schema.rs index 15f67a4a..acebb111 100644 --- a/jirs-server/src/schema.rs +++ b/jirs-server/src/schema.rs @@ -47,6 +47,53 @@ table! { } } +table! { + use diesel::sql_types::*; + use jirs_data::sql::*; + + /// Representation of the `epics` table. + /// + /// (Automatically generated by Diesel.) + epics (id) { + /// The `id` column of the `epics` table. + /// + /// Its SQL type is `Int4`. + /// + /// (Automatically generated by Diesel.) + id -> Int4, + /// The `name` column of the `epics` table. + /// + /// Its SQL type is `Text`. + /// + /// (Automatically generated by Diesel.) + name -> Text, + /// The `user_id` column of the `epics` table. + /// + /// Its SQL type is `Int4`. + /// + /// (Automatically generated by Diesel.) + user_id -> Int4, + /// The `project_id` column of the `epics` table. + /// + /// Its SQL type is `Int4`. + /// + /// (Automatically generated by Diesel.) + project_id -> Int4, + /// The `created_at` column of the `epics` table. + /// + /// Its SQL type is `Timestamp`. + /// + /// (Automatically generated by Diesel.) + created_at -> Timestamp, + /// The `updated_at` column of the `epics` table. + /// + /// Its SQL type is `Timestamp`. + /// + /// (Automatically generated by Diesel.) + updated_at -> Timestamp, + } +} + table! { use diesel::sql_types::*; use jirs_data::sql::*; @@ -304,6 +351,12 @@ table! { /// /// (Automatically generated by Diesel.) issue_status_id -> Int4, + /// The `epic_id` column of the `issues` table. + /// + /// Its SQL type is `Nullable`. + /// + /// (Automatically generated by Diesel.) + epic_id -> Nullable, } } @@ -592,11 +645,14 @@ table! { joinable!(comments -> issues (issue_id)); joinable!(comments -> users (user_id)); +joinable!(epics -> projects (project_id)); +joinable!(epics -> users (user_id)); joinable!(invitations -> projects (project_id)); joinable!(invitations -> users (invited_by_id)); joinable!(issue_assignees -> issues (issue_id)); joinable!(issue_assignees -> users (user_id)); joinable!(issue_statuses -> projects (project_id)); +joinable!(issues -> epics (epic_id)); joinable!(issues -> issue_statuses (issue_status_id)); joinable!(issues -> projects (project_id)); joinable!(issues -> users (reporter_id)); @@ -606,6 +662,7 @@ joinable!(user_projects -> users (user_id)); allow_tables_to_appear_in_same_query!( comments, + epics, invitations, issue_assignees, issue_statuses, diff --git a/jirs-server/src/ws/issues.rs b/jirs-server/src/ws/issues.rs index ef9c0ff1..50ef6578 100644 --- a/jirs-server/src/ws/issues.rs +++ b/jirs-server/src/ws/issues.rs @@ -106,6 +106,7 @@ impl WsHandler for WebSocketActor { project_id: msg.project_id, reporter_id: msg.reporter_id, user_ids: msg.user_ids, + epic_id: msg.epic_id, }; let m = match block_on(self.db.send(msg)) { Ok(Ok(issue)) => Some(WsMsg::IssueCreated(issue.into())),