fix(ux/portal): conditions ux tweaks (#6417)

fixes #6367 

<img width="720" alt="Screenshot 2024-08-22 at 1 58 20 PM"
src="https://github.com/user-attachments/assets/806e4393-17a4-4bdf-9c6c-c1cfad641d78">

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
This commit is contained in:
Jamil
2024-08-22 22:15:02 -07:00
committed by GitHub
parent 095358dd4a
commit c3d5a2a2d7
2 changed files with 18 additions and 13 deletions

View File

@@ -1293,13 +1293,13 @@ defmodule Web.CoreComponents do
def feature_name(%{feature: :policy_conditions} = assigns) do
~H"""
Define Policy Conditions
Specify access-time conditions when creating policies
"""
end
def feature_name(%{feature: :multi_site_resources} = assigns) do
~H"""
Define globally-distributed resources
Define globally-distributed Resources
"""
end
@@ -1311,7 +1311,7 @@ defmodule Web.CoreComponents do
def feature_name(%{feature: :self_hosted_relays} = assigns) do
~H"""
Host your own relays
Host your own Relays
"""
end

View File

@@ -235,7 +235,12 @@ defmodule Web.Policies.Components do
~H"""
<fieldset class="flex flex-col gap-2 mt-4">
<div class="flex items-center justify-between">
<legend class="text-xl mb-2 text-neutral-900">Conditions</legend>
<div>
<legend class="text-xl mb-2 text-neutral-900">Conditions</legend>
<p class="my-2 text-sm text-neutral-500">
All conditions specified below must be met for this policy to be applied.
</p>
</div>
<%= if @policy_conditions_enabled? == false do %>
<.link navigate={~p"/#{@account}/settings/billing"} class="text-sm text-primary-500">
<.badge type="primary" title="Feature available on a higher pricing plan">
@@ -296,7 +301,7 @@ defmodule Web.Policies.Components do
>
<legend class="flex justify-between items-center text-neutral-700">
<span class="flex items-center">
<.icon name="hero-globe-americas" class="w-5 h-5 mr-2" /> Client location
<.icon name="hero-map-pin" class="w-5 h-5 mr-2" /> Client location
</span>
<span class="shadow bg-white w-6 h-6 flex items-center justify-center rounded-full">
<.icon
@@ -315,8 +320,8 @@ defmodule Web.Policies.Components do
condition_values_empty?(condition_form) && "hidden"
]}
>
<p class="text-sm text-neutral-500 mb-2">
Restrict access based on the location of the Client.
<p class="text-sm text-neutral-500 mb-4">
Allow access when the location of the Client meets the criteria specified below.
</p>
<div class="grid gap-2 sm:grid-cols-5 sm:gap-4">
<.input
@@ -398,8 +403,8 @@ defmodule Web.Policies.Components do
condition_values_empty?(condition_form) && "hidden"
]}
>
<p class="text-sm text-neutral-500 mb-2">
Restrict access based on the Client's IP address or CIDR range.
<p class="text-sm text-neutral-500 mb-4">
Allow access when the IP of the Client meets the criteria specified below.
</p>
<div class="grid gap-2 sm:grid-cols-5 sm:gap-4">
<.input
@@ -485,8 +490,8 @@ defmodule Web.Policies.Components do
condition_values_empty?(condition_form) && "hidden"
]}
>
<p class="text-sm text-neutral-500 mb-2">
Restrict access based on the identity provider that was used to sign in.
<p class="text-sm text-neutral-500 mb-4">
Allow access when the IdP used to sign in meets the criteria specified below.
</p>
<div class="grid gap-2 sm:grid-cols-5 sm:gap-4">
<.input
@@ -582,8 +587,8 @@ defmodule Web.Policies.Components do
condition_values_empty?(condition_form) && "hidden"
]}
>
<p class="text-sm text-neutral-500 mb-2">
Restrict access based on the current time of the day in 24hr format. Multiple time ranges per day are supported.
<p class="text-sm text-neutral-500 mb-4">
Allow access during the time windows specified below. 24hr format and multiple time ranges per day are supported.
</p>
<div class="space-y-2">
<.input