Skip to content

Commit

Permalink
Fix styles and missing aws s3 hook
Browse files Browse the repository at this point in the history
  • Loading branch information
simonprev committed Nov 18, 2024
1 parent 6d9f9fd commit 3fab434
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 16 deletions.
2 changes: 1 addition & 1 deletion lib/accent/integrations/execute/aws_s3.ex
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ defmodule Accent.IntegrationManager.Execute.AWSS3 do
end

Hook.outbound(%Hook.Context{
event: "integration_execute_azure_storage_container",
event: "integration_execute_aws_s3",
project_id: integration.project_id,
user_id: user.id,
payload: %{
Expand Down
9 changes: 8 additions & 1 deletion lib/hook/outbounds/discord.ex
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,18 @@ defmodule Accent.Hook.Outbounds.Discord do
[<%= document_name %>](<%= url %>)
<% end %>
""")

deftemplate(:integration_execute_aws_s3, """
**<%= @user %>** just uploaded all *<%= @version_tag %>* files to AWS S3.
<%= for %{"name" => document_name, "url" => url} <- @document_urls do %>
[<%= document_name %>](<%= url %>)
<% end %>
""")
end

@impl Accent.Hook.Events
def registered_events do
~w(sync complete_review new_conflicts integration_execute_azure_storage_container)
~w(sync complete_review new_conflicts integration_execute_azure_storage_container integration_execute_aws_s3)
end

@impl Oban.Worker
Expand Down
8 changes: 8 additions & 0 deletions lib/hook/outbounds/helpers/post_url.ex
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,12 @@ defmodule Accent.Hook.Outbounds.Helpers.PostURL do
document_urls: context.payload["document_urls"]
})
end

defp build_content(templates, %{event: "integration_execute_aws_s3"} = context) do
templates.integration_execute_aws_s3(%{
user: User.name_with_fallback(context.user),
version_tag: context.payload["version_tag"],
document_urls: context.payload["document_urls"]
})
end
end
9 changes: 8 additions & 1 deletion lib/hook/outbounds/slack.ex
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,18 @@ defmodule Accent.Hook.Outbounds.Slack do
[<%= document_name %>](<%= url %>)
<% end %>
""")

deftemplate(:integration_execute_aws_s3, """
*<%= @user %>* just uploaded all _<%= @version_tag %>_ files to AWS S3.
<%= for %{"name" => document_name, "url" => url} <- @document_urls do %>
[<%= document_name %>](<%= url %>)
<% end %>
""")
end

@impl Accent.Hook.Events
def registered_events do
~w(sync complete_review new_conflicts integration_execute_azure_storage_container)
~w(sync complete_review new_conflicts integration_execute_azure_storage_container integration_execute_aws_s3)
end

@impl Oban.Worker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ export default class DataControlCheckboxes extends Component<Args> {
value: 'INTEGRATION_EXECUTE_AZURE_STORAGE_CONTAINER',
label:
'components.project_settings.integrations.events.options.integration_execute_azure_storage_container'
},
{
value: 'INTEGRATION_EXECUTE_AWS_S3',
label:
'components.project_settings.integrations.events.options.integration_execute_aws_s3'
}
];

Expand Down
3 changes: 2 additions & 1 deletion webapp/app/locales/en-us.json
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,8 @@
"sync": "Sync with any changes",
"new_conflicts": "New strings to review",
"complete_review": "Project is 100% reviewed",
"integration_execute_azure_storage_container": "Files uploaded to Azure Storage Container"
"integration_execute_azure_storage_container": "Files uploaded to Azure Storage Container",
"integration_execute_aws_s3": "Files uploaded to AWS S3"
}
},
"execute": {
Expand Down
3 changes: 2 additions & 1 deletion webapp/app/locales/fr-ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,8 @@
"sync": "Synchroniser avec n’importe quelles modifications",
"new_conflicts": "Nouvelles chaîne à réviser",
"complete_review": "Le projet est révisé à 100%",
"integration_execute_azure_storage_container": "Fichiers téléversés sur Azure Storage Container"
"integration_execute_azure_storage_container": "Fichiers téléversés sur Azure Storage Container",
"integration_execute_aws_s3": "Fichiers téléversés sur AWS S3"
}
},
"execute": {
Expand Down
3 changes: 2 additions & 1 deletion webapp/app/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ html {
--font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
'Segoe UI Symbol';
--font-monospace: 'Fira Code', 'Monaco', Courrier, monospace;
--font-monospace: 'Fira Code', 'SF Mono', SFMono-Regular, ui-monospace,
'DejaVu Sans Mono', Menlo, Consolas, monospace;

--screen-lg: 100%;
--screen-md: 640px;
Expand Down
4 changes: 3 additions & 1 deletion webapp/app/styles/components/project-navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@
&:focus {
outline: none;
border-radius: var(--border-radius);
box-shadow: 0 2px 9px var(--shadow-color);
box-shadow:
0 1px 2px var(--shadow-color),
0 2px 8px var(--shadow-color);
}
}

Expand Down
3 changes: 0 additions & 3 deletions webapp/app/styles/components/project-navigation/list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,10 @@
.list-item-link {
display: flex;
align-items: center;
position: relative;
gap: 10px;
left: 1px;
padding: 7px 12px 6px;
text-decoration: none;
font-size: 13px;
border-radius: var(--border-radius);
color: var(--text-color-normal);

&:hover,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
background: var(--background-light);
font-family: var(--font-monospace);
font-size: 11px;
border-radius: 8px;
border-radius: var(--border-radius);
transition-property: border-color, box-shadow;
transition: 0.3s ease-in-out;
color: var(--text-color-normal);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
background: var(--background-light);
font-family: var(--font-monospace);
font-size: 11px;
border-radius: 8px;
border-radius: var(--border-radius);
transition-property: border-color, box-shadow;
transition: 0.3s ease-in-out;
color: var(--text-color-normal);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.checkbox {
display: inline-flex;
align-items: center;
margin-right: 10px;
margin-right: 6px;
border: 1px solid var(--background-light-highlight);
padding: 4px 6px;
border-radius: var(--border-radius);
Expand Down
4 changes: 3 additions & 1 deletion webapp/app/styles/components/projects-list/item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

&:focus,
&:hover {
box-shadow: 0 4px 15px var(--shadow-color);
box-shadow:
0 1px 4px var(--shadow-color),
0 3px 14px var(--shadow-color);
border-color: color-mix(in srgb, var(--color-primary) 20%, transparent);
border-bottom-color: color-mix(
in srgb,
Expand Down
5 changes: 3 additions & 2 deletions webapp/app/styles/components/translation-navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
.navigation-list-item-link {
padding: 2px 11px 2px 10px;
border-radius: var(--border-radius);
opacity: 0.9;

&:global(.active) {
background: var(--background-light-highlight);
opacity: 0.7;
background: var(--body-background);
opacity: 1;
}
}
}
Expand Down

0 comments on commit 3fab434

Please sign in to comment.