Skip to content

Commit

Permalink
Set enabled to true
Browse files Browse the repository at this point in the history
  • Loading branch information
IvaKop committed Jan 15, 2024
2 parents 8408350 + 9a5c56f commit cb71ac5
Show file tree
Hide file tree
Showing 110 changed files with 570 additions and 513 deletions.
2 changes: 1 addition & 1 deletion back/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SHELL ["/bin/ash", "-o", "pipefail", "-c"]

WORKDIR /app

COPY back/Gemfile back/Gemfile.* ./
COPY back/Gemfile back/Gemfile.* back/.ruby-version ./
COPY back/engines ./engines

# `version.rb` files are also kept as they are required by gemspec files.
Expand Down
2 changes: 1 addition & 1 deletion back/Dockerfile.development
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ WORKDIR $INSTALL_PATH

ENV PATH="$PATH:/cl2_back/bin"

COPY back/Gemfile back/Gemfile.* ./
COPY back/Gemfile back/Gemfile.* back/.ruby-version ./
COPY back/engines ./engines
COPY back/lib/citizen_lab.rb ./lib/

Expand Down
9 changes: 5 additions & 4 deletions back/Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

source 'https://rubygems.org'
ruby file: '.ruby-version'

git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?('/')
Expand All @@ -12,7 +13,7 @@ gem 'rails', '~> 7.0'
# Use postgresql as the database for Active Record
gem 'pg' # , '~> 0.18'
# Use Puma as the app server
gem 'puma', '~> 6.3.1'
gem 'puma', '~> 6.4.2'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
Expand All @@ -31,7 +32,7 @@ group :development, :test do
gem 'pry-byebug'
gem 'pry-rails'
gem 'pry-rescue'
gem 'database_cleaner', '~> 2.0.1'
gem 'database_cleaner', '~> 2.0.2'
gem 'factory_bot_rails'
gem 'license_finder'
# Use module prepend to patch NET::HTTP to avoid stack level too deep errors.
Expand All @@ -56,8 +57,8 @@ group :development, :test do
gem 'saharspec'
gem 'simplecov'
gem 'simplecov-rcov'
gem 'test-prof', '~> 1.2'
gem 'vcr', '~> 6.1'
gem 'test-prof', '~> 1.3'
gem 'vcr', '~> 6.2'
end

group :development do
Expand Down
25 changes: 14 additions & 11 deletions back/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -562,9 +562,9 @@ GEM
css_parser (1.14.0)
addressable
dalli (3.2.4)
database_cleaner (2.0.1)
database_cleaner-active_record (~> 2.0.0)
database_cleaner-active_record (2.0.1)
database_cleaner (2.0.2)
database_cleaner-active_record (>= 2, < 3)
database_cleaner-active_record (2.1.0)
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
Expand Down Expand Up @@ -804,7 +804,7 @@ GEM
rake
mini_magick (4.12.0)
mini_mime (1.1.5)
minitest (5.19.0)
minitest (5.20.0)
mjml-rails (4.9.0)
msgpack (1.6.0)
multi_json (1.15.0)
Expand Down Expand Up @@ -922,7 +922,7 @@ GEM
interception (>= 0.5)
pry (>= 0.12.0)
public_suffix (4.0.7)
puma (6.3.1)
puma (6.4.2)
nio4r (~> 2.0)
pundit (2.3.0)
activesupport (>= 3.0.0)
Expand Down Expand Up @@ -1157,7 +1157,7 @@ GEM
attr_required (>= 0.0.5)
faraday (~> 2.0)
faraday-follow_redirects
test-prof (1.2.1)
test-prof (1.3.1)
thor (1.2.2)
thread (0.2.2)
thread_safe (0.3.6)
Expand Down Expand Up @@ -1189,7 +1189,7 @@ GEM
validate_url (1.0.15)
activemodel (>= 3.0.0)
public_suffix
vcr (6.1.0)
vcr (6.2.0)
wasabi (3.8.0)
addressable
httpi (~> 3.0)
Expand Down Expand Up @@ -1249,7 +1249,7 @@ DEPENDENCIES
custom_idea_statuses!
custom_maps!
dalli (~> 3.2.4)
database_cleaner (~> 2.0.1)
database_cleaner (~> 2.0.2)
document_annotation!
email_campaigns!
factory_bot_rails
Expand Down Expand Up @@ -1321,7 +1321,7 @@ DEPENDENCIES
pry-rails
pry-rescue
public_api!
puma (~> 6.3.1)
puma (~> 6.4.2)
pundit (~> 2.3.0)
que (~> 1.4.1)
que-web (~> 0.10.0)
Expand Down Expand Up @@ -1366,13 +1366,16 @@ DEPENDENCIES
spring-watcher-listen (~> 2.1)
stackprof (~> 0.2.25)
surveys!
test-prof (~> 1.2)
test-prof (~> 1.3)
texting!
user_custom_fields!
vcr (~> 6.1)
vcr (~> 6.2)
verification!
volunteering!
webmock (~> 3.18)

RUBY VERSION
ruby 2.7.6p219

BUNDLED WITH
2.4.20
4 changes: 2 additions & 2 deletions back/config/schemas/settings.schema.json.erb
Original file line number Diff line number Diff line change
Expand Up @@ -1332,11 +1332,11 @@
"user_session_recording": {
"type": "object",
"title": "User session recording",
"description": "Enables the recording of user sessions for analysis and product research purposes.",
"description": "Enables the recording of a small fraction of user sessions for analysis and product research purposes. Requires active consent from the customer.",
"additionalProperties": false,
"required": ["allowed", "enabled"],
"properties": {
"allowed": { "type": "boolean", "default": false },
"allowed": { "type": "boolean", "default": true },
"enabled": { "type": "boolean", "default": false }
}
}
Expand Down
1 change: 0 additions & 1 deletion front/app/api/app_configuration/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ export interface IAppConfigurationSettings {
initiativeflow_social_sharing?: AppConfigurationFeature;
machine_translations?: AppConfigurationFeature;
custom_maps?: AppConfigurationFeature;
similar_ideas?: AppConfigurationFeature;
polls?: AppConfigurationFeature;
moderation?: AppConfigurationFeature;
flag_inappropriate_content?: AppConfigurationFeature;
Expand Down
2 changes: 1 addition & 1 deletion front/app/api/custom_pages/__mocks__/useCustomPages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export const customPagesData: ICustomPageData[] = [
created_at: '2021-12-10T10:36:36.687Z',
updated_at: '2021-12-10T10:36:36.687Z',
top_info_section_multiloc: {
en: '<img style="margin-bottom:30px;" data-cl2-text-image-text-reference="b4e659ab-2830-48fd-b3ce-96e16856262f" height="374.3745928338762" width="819" alt="" src="http://localhost:4000/uploads/c72c5211-8e03-470b-9564-04ec0a8c322b/text_image/image/5501fdfd-a5b0-4d3e-9a96-a06b588b4546/25aff5c5-a5a6-4e66-8d24-4540e66685af.png"> <h2>What\'s a citizen\'s proposal?</h2> <p>As a resident of $|orgName| you can place your proposal on the agenda via this platform. These proposals are preferably concrete ideas that are linked to local policy and arise from a need, desire or dream. It can be your own proposal or a collaborative one. Maybe you\'d like to change or improve an existing situation or start a new project.</p> <p>The involvement of $|orgName| in the implementation of your proposal must be both necessary and possible. In an ideal scenario, you\'re also available for further reflection or cooperation, but that is not an obligation. "Reducing the speed limit on the highway to 80 km/h" is therefore not a strong proposal, while "Turning the main street into a pedestrian area" is. So bring on your proposals! If more information is needed, you\'ll receive an update or reaction.</p><h2>Why post a proposal on this platform?</h2> <p>This is the official participation platform of $|orgName|, which offers the following benefits:</p> <ul> <li>$|orgName| is officially involved as this platform\'s owner, and actively monitors what happens here. When you post a proposal, the person in charge automatically receives a message. You don\'t have to contact them to make sure your proposal is taken into account.</li> <li>This platform has been developed specifically for official participatory actions, like citizens\' proposals. Every element, from the user experience to the step-by-step approach, is built precisely for this purpose. When using traditional social media, your proposal could disappear into the overload of stimuli, and an ordinary e-mail quickly disappears into a full inbox.</li> <li>Your fellow citizens are also present on this platform. They can support and refine your proposal. The more creative your proposal is and the more support it manages to gather, the more chance it will be implemented!</li> </ul> <h2>How do you get started?</h2> <p>First, check whether your proposal meets the following criteria:</p> <p>$|initiativesEligibilityCriteria|</p> <h2>What can you expect when your proposal reaches $|initiativesReactingThreshold| reactions within $|initiativesDaysLimit| days?</h2> <p>$|initiativesThresholdReachedMessage|</p> <h2>What happens to the proposals that do not receive $|initiativesReactingThreshold| reactions on time? </h2> <p>That happens, but don\'t worry. Your proposal will remain on the platform. The status of your proposal will automatically change to \'Expired\'. As a result, reacting will no longer be possible. If you wish, you can choose to delete your own proposal at any time.</p>\n',
en: '<img style="margin-bottom:30px;" data-cl2-text-image-text-reference="b4e659ab-2830-48fd-b3ce-96e16856262f" height="374.3745928338762" width="819" alt="" src="http://localhost:4000/uploads/c72c5211-8e03-470b-9564-04ec0a8c322b/text_image/image/5501fdfd-a5b0-4d3e-9a96-a06b588b4546/25aff5c5-a5a6-4e66-8d24-4540e66685af.png"> <h2>What\'s a citizen\'s proposal?</h2> <p>As a resident of $|orgName| you can place your proposal on the agenda via this platform. These proposals are preferably concrete ideas that are linked to local policy and arise from a need, desire or dream. It can be your own proposal or a collaborative one. Maybe you\'d like to change or improve an existing situation or start a new project.</p> <p>The involvement of $|orgName| in the implementation of your proposal must be both necessary and possible. In an ideal scenario, you\'re also available for further reflection or cooperation, but that is not an obligation. "Reducing the speed limit on the highway to 80 km/h" is therefore not a strong proposal, while "Turning the main street into a pedestrian area" is. So bring on your proposals! If more information is needed, you\'ll receive an update or reaction.</p><h2>Why post a proposal on this platform?</h2> <p>This is the official participation platform of $|orgName|, which offers the following benefits:</p> <ul> <li>$|orgName| is officially involved as this platform\'s owner, and actively monitors what happens here. When you post a proposal, the person in charge automatically receives a message. You don\'t have to contact them to make sure your proposal is taken into account.</li> <li>This platform has been developed specifically for official participatory actions, like citizens\' proposals. Every element, from the user experience to the step-by-step approach, is built precisely for this purpose. When using traditional social media, your proposal could disappear into the overload of stimuli, and an ordinary e-mail quickly disappears into a full inbox.</li> <li>Your fellow citizens are also present on this platform. They can support and refine your proposal. The more creative your proposal is and the more support it manages to gather, the more chance it will be implemented!</li> </ul> <h2>How do you get started?</h2> <p>First, check whether your proposal meets the following criteria:</p> <p>$|initiativesEligibilityCriteria|</p> <h2>What can you expect when your proposal reaches $|initiativesVotingThreshold| reactions within $|initiativesDaysLimit| days?</h2> <p>$|initiativesThresholdReachedMessage|</p> <h2>What happens to the proposals that do not receive $|initiativesVotingThreshold| reactions on time? </h2> <p>That happens, but don\'t worry. Your proposal will remain on the platform. The status of your proposal will automatically change to \'Expired\'. As a result, reacting will no longer be possible. If you wish, you can choose to delete your own proposal at any time.</p>\n',
},
nav_bar_item_title_multiloc: {
en: 'Proposals',
Expand Down
2 changes: 1 addition & 1 deletion front/app/components/ResolveTextVariables/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ResolveTextVariables extends PureComponent<Props> {
);
}

textVariables.initiativesReactingThreshold =
textVariables.initiativesVotingThreshold =
initiativeSettings.reacting_threshold.toString();
textVariables.initiativesDaysLimit =
initiativeSettings.days_limit.toString();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react';

// components
import ViewButton from './ViewButton';
import { Icon, colors } from '@citizenlab/cl2-component-library';

interface Props {
active: boolean;
onClick: () => void;
}

const DesktopButton = ({ active, onClick }: Props) => {
return (
<ViewButton
id="e2e-desktop-preview"
borderRadius="0px 4px 4px 0px"
active={active}
onClick={onClick}
>
<Icon
name="desktop"
width="20px"
fill={active ? colors.white : colors.primary}
/>
</ViewButton>
);
};

export default DesktopButton;
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React from 'react';

// components
import ViewButton from './ViewButton';
import { Icon, colors } from '@citizenlab/cl2-component-library';

interface Props {
active: boolean;
onClick: () => void;
}

const MobileButton = ({ active, onClick }: Props) => {
return (
<ViewButton
id="e2e-mobile-preview"
borderRadius="4px 0px 0px 4px"
active={active}
onClick={onClick}
>
<Icon
name="tablet"
width="16px"
height="20px"
fill={active ? colors.white : colors.primary}
/>
</ViewButton>
);
};

export default MobileButton;
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from 'react';

// components
import { Button, colors } from '@citizenlab/cl2-component-library';

interface Props {
children: React.ReactNode;
id?: string;
borderRadius: string;
active: boolean;
onClick: () => void;
}

const ViewButton = ({ children, id, borderRadius, active, onClick }: Props) => {
return (
<Button
id={id}
bgColor={active ? colors.primary : colors.white}
onClick={() => {
!active && onClick();
}}
borderRadius={borderRadius}
bgHoverColor={active ? colors.primary : colors.white}
borderColor={colors.primary}
height="40px"
width="92px"
>
{children}
</Button>
);
};

export default ViewButton;
54 changes: 12 additions & 42 deletions front/app/components/admin/ContentBuilder/EditModePreview/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import React, { memo, useState } from 'react';

// components
import {
Box,
Icon,
Button,
stylingConsts,
colors,
} from '@citizenlab/cl2-component-library';

// styles
import { Box, stylingConsts } from '@citizenlab/cl2-component-library';
import MobileButton from './ViewButtons/MobileButton';
import DesktopButton from './ViewButtons/DesktopButton';

type Props = {
iframeSrc: string;
Expand All @@ -20,12 +14,7 @@ const ContentBuilderEditModePreview = React.forwardRef<
Props
>(({ iframeSrc }, ref) => {
const [isMobile, setIsMobile] = useState(true);
const colorIfDesktopView = isMobile ? colors.white : colors.primary;
const colorIfMobileView = isMobile ? colors.primary : colors.white;
const buttonProps = {
height: '40px',
width: '92px',
};

return (
<Box
mt={`${stylingConsts.menuHeight + 20}px`}
Expand All @@ -34,37 +23,18 @@ const ContentBuilderEditModePreview = React.forwardRef<
>
<Box display="flex" flexDirection="column" alignItems="center">
<Box display="flex" mb="16px">
<Button
bgColor={colorIfMobileView}
<MobileButton
active={isMobile}
onClick={() => {
!isMobile && setIsMobile(true);
setIsMobile(true);
}}
borderRadius="4px 0px 0px 4px"
bgHoverColor={colorIfMobileView}
borderColor={`${colors.primary}`}
id="e2e-mobile-preview"
{...buttonProps}
>
<Icon
name="tablet"
width="16px"
height="20px"
fill={colorIfDesktopView}
/>
</Button>
<Button
bgColor={colorIfDesktopView}
/>
<DesktopButton
active={!isMobile}
onClick={() => {
isMobile && setIsMobile(false);
setIsMobile(false);
}}
id="e2e-desktop-preview"
borderRadius="0px 4px 4px 0px"
bgHoverColor={colorIfDesktopView}
borderColor={`${colors.primary}`}
{...buttonProps}
>
<Icon name="desktop" width="20px" fill={colorIfMobileView} />
</Button>
/>
</Box>
{/* Platform Container */}
<Box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const Image = ({ alt = {}, image }: Props) => {
);
};

const ImageSettings = injectIntl(({ intl: { formatMessage } }) => {
export const ImageSettings = injectIntl(({ intl: { formatMessage } }) => {
const [imageFiles, setImageFiles] = useState<UploadFile[]>([]);
const { mutateAsync: addContentBuilderImage } = useAddContentBuilderImage();
const {
Expand Down
Loading

0 comments on commit cb71ac5

Please sign in to comment.