Skip to content

Commit

Permalink
editoast: fix after rebase
Browse files Browse the repository at this point in the history
Signed-off-by: Benoit Simard <[email protected]>
  • Loading branch information
sim51 committed Oct 23, 2024
1 parent 222242e commit eff057d
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 28 deletions.
1 change: 1 addition & 0 deletions editoast/editoast_models/src/tables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,7 @@ diesel::joinable!(infra_object_signal -> infra (infra_id));
diesel::joinable!(infra_object_speed_section -> infra (infra_id));
diesel::joinable!(infra_object_switch -> infra (infra_id));
diesel::joinable!(infra_object_track_section -> infra (infra_id));
diesel::joinable!(macro_node -> scenario (scenario_id));
diesel::joinable!(project -> document (image_id));
diesel::joinable!(rolling_stock_livery -> document (compound_image_id));
diesel::joinable!(rolling_stock_livery -> rolling_stock (rolling_stock_id));
Expand Down
22 changes: 11 additions & 11 deletions editoast/src/views/scenario/macro_nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ use crate::views::scenario::ScenarioError;
use crate::views::scenario::ScenarioIdParam;
use crate::views::study::StudyError;
use crate::views::study::StudyIdParam;
use crate::views::AuthenticationExt;
use crate::views::AuthorizationError;
use crate::views::AuthorizerExt;

crate::routes! {
"/macro_nodes" => {list, create,},
Expand Down Expand Up @@ -129,14 +129,14 @@ pub struct MacroNodeListResponse {
)]
async fn list(
State(db_pool): State<DbConnectionPoolV2>,
Extension(authorizer): AuthorizerExt,
Extension(auth): AuthenticationExt,
Path((project_id, study_id, scenario_id)): Path<(i64, i64, i64)>,
Query(pagination_params): Query<PaginationQueryParam>,
) -> Result<Json<MacroNodeListResponse>> {
let conn = &mut db_pool.get().await?;

// Checking role
let authorized = authorizer
let authorized = auth
.check_roles([BuiltinRole::OpsRead].into())
.await
.map_err(AuthorizationError::AuthError)?;
Expand Down Expand Up @@ -173,12 +173,12 @@ async fn list(
)]
async fn create(
State(db_pool): State<DbConnectionPoolV2>,
Extension(authorizer): AuthorizerExt,
Extension(auth): AuthenticationExt,
Path((project_id, study_id, scenario_id)): Path<(i64, i64, i64)>,
Json(data): Json<MacroNodeForm>,
) -> Result<Json<MacroNodeResponse>> {
// Checking role
let authorized = authorizer
let authorized = auth
.check_roles([BuiltinRole::OpsWrite].into())
.await
.map_err(AuthorizationError::AuthError)?;
Expand Down Expand Up @@ -231,11 +231,11 @@ async fn create(
)]
async fn get(
State(db_pool): State<DbConnectionPoolV2>,
Extension(authorizer): AuthorizerExt,
Extension(auth): AuthenticationExt,
Path((project_id, study_id, scenario_id, node_id)): Path<(i64, i64, i64, i64)>,
) -> Result<Json<MacroNodeResponse>> {
// Checking role
let authorized = authorizer
let authorized = auth
.check_roles([BuiltinRole::OpsRead].into())
.await
.map_err(AuthorizationError::AuthError)?;
Expand Down Expand Up @@ -269,11 +269,11 @@ async fn get(
)]
async fn update(
State(db_pool): State<DbConnectionPoolV2>,
Extension(authorizer): AuthorizerExt,
Extension(auth): AuthenticationExt,
Path((project_id, study_id, scenario_id, node_id)): Path<(i64, i64, i64, i64)>,
Json(data): Json<MacroNodeForm>,
) -> Result<Json<MacroNodeResponse>> {
let authorized = authorizer
let authorized = auth
.check_roles([BuiltinRole::OpsWrite].into())
.await
.map_err(AuthorizationError::AuthError)?;
Expand Down Expand Up @@ -335,10 +335,10 @@ async fn update(
)]
async fn delete(
State(db_pool): State<DbConnectionPoolV2>,
Extension(authorizer): AuthorizerExt,
Extension(auth): AuthenticationExt,
Path((project_id, study_id, scenario_id, node_id)): Path<(i64, i64, i64, i64)>,
) -> Result<impl IntoResponse> {
let authorized = authorizer
let authorized = auth
.check_roles([BuiltinRole::OpsWrite].into())
.await
.map_err(AuthorizationError::AuthError)?;
Expand Down
59 changes: 42 additions & 17 deletions front/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
resolved "https://registry.npmjs.org/@apidevtools/swagger-methods/-/swagger-methods-3.0.2.tgz"
integrity sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg==

"@apidevtools/swagger-parser@^10.0.1", "@apidevtools/swagger-parser@^10.0.2":
"@apidevtools/swagger-parser@^10.0.2", "@apidevtools/swagger-parser@^10.1.0":
version "10.1.0"
resolved "https://registry.yarnpkg.com/@apidevtools/swagger-parser/-/swagger-parser-10.1.0.tgz#a987d71e5be61feb623203be0c96e5985b192ab6"
integrity sha512-9Kt7EuS/7WbMAUv2gSziqjvxwDbFSg3Xeyfuj5laUODX8o/k/CpsAKiQ8W7/R88eXFTMbJYg6+7uAmOWNKmwnw==
Expand Down Expand Up @@ -7847,14 +7847,14 @@ oas-validator@^5.0.8:
yaml "^1.10.0"

oazapfts@^4.8.0, oazapfts@anisometropie/oazapfts#master:
version "3.6.0-1"
resolved "https://codeload.github.com/anisometropie/oazapfts/tar.gz/324c195d19b80fd1c63931f4d96e5d6469dc78b2"
version "0.0.0-development"
resolved "https://codeload.github.com/anisometropie/oazapfts/tar.gz/fe2888af737e5d5a7aa7ae3e49997d94113a0c6e"
dependencies:
"@apidevtools/swagger-parser" "^10.0.1"
lodash "^4.17.20"
minimist "^1.2.5"
swagger2openapi "^7.0.7"
typescript "^4.1.2"
"@apidevtools/swagger-parser" "^10.1.0"
lodash "^4.17.21"
minimist "^1.2.8"
swagger2openapi "^7.0.8"
typescript "^5.2.2"

object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1:
version "4.1.1"
Expand Down Expand Up @@ -9592,7 +9592,16 @@ strict-uri-encode@^1.0.0:
resolved "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz"
integrity sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ==

"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand Down Expand Up @@ -9694,7 +9703,14 @@ stringify-entities@^4.0.0:
character-entities-html4 "^2.0.0"
character-entities-legacy "^3.0.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand Down Expand Up @@ -9800,7 +9816,7 @@ svg-arc-to-cubic-bezier@^3.0.0, svg-arc-to-cubic-bezier@^3.2.0:
resolved "https://registry.npmjs.org/svg-arc-to-cubic-bezier/-/svg-arc-to-cubic-bezier-3.2.0.tgz"
integrity sha512-djbJ/vZKZO+gPoSDThGNpKDO+o+bAeA4XQKovvkNCqnIS2t+S4qnLAGQhyyrulhCFRl1WWzAp0wUDV8PpTVU3g==

swagger2openapi@^7.0.4, swagger2openapi@^7.0.7:
swagger2openapi@^7.0.4, swagger2openapi@^7.0.8:
version "7.0.8"
resolved "https://registry.yarnpkg.com/swagger2openapi/-/swagger2openapi-7.0.8.tgz#12c88d5de776cb1cbba758994930f40ad0afac59"
integrity sha512-upi/0ZGkYgEcLeGieoz8gT74oWHA0E7JivX7aN9mAf+Tc7BQoRBvnIGHoPDw+f9TXTW4s6kGYCZJtauP6OYp7g==
Expand Down Expand Up @@ -10190,11 +10206,6 @@ typed-array-length@^1.0.6:
is-typed-array "^1.1.13"
possible-typed-array-names "^1.0.0"

typescript@^4.1.2:
version "4.9.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==

typescript@^5.0.0, typescript@~5.3.3:
version "5.3.3"
resolved "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz"
Expand All @@ -10205,6 +10216,11 @@ typescript@^5.0.4:
resolved "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz"
integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==

typescript@^5.2.2:
version "5.6.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.3.tgz#5f3449e31c9d94febb17de03cc081dd56d81db5b"
integrity sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==

typewise-core@^1.2, typewise-core@^1.2.0:
version "1.2.0"
resolved "https://registry.npmjs.org/typewise-core/-/typewise-core-1.2.0.tgz"
Expand Down Expand Up @@ -10904,7 +10920,16 @@ wordwrap@^1.0.0:
resolved "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz"
integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
version "7.0.0"
resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand Down

0 comments on commit eff057d

Please sign in to comment.