Skip to content

Commit

Permalink
Merge pull request #711 from openstad/develop
Browse files Browse the repository at this point in the history
Update main with develop changes
  • Loading branch information
iandebruin98 authored Jan 15, 2025
2 parents 08d7f56 + 939845e commit 5797616
Show file tree
Hide file tree
Showing 11 changed files with 128 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ export default function BegrootmoduleDisplay(
values = values.filter(value => value !== item);
}

values = values.filter(value => tagGroupNames.includes(value));

form.setValue('tagTypeTagGroup', values);
props.onFieldChanged('tagTypeTagGroup', values);
}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
admin:
deploymentContainer:
image: ghcr.io/openstad/admin-server:develop-b2dfa9a
image: ghcr.io/openstad/admin-server:develop-1764f8d
api:
deploymentContainer:
image: ghcr.io/openstad/api-server:develop-b2dfa9a
image: ghcr.io/openstad/api-server:develop-1764f8d
auth:
deploymentContainer:
image: ghcr.io/openstad/auth-server:develop-b2dfa9a
image: ghcr.io/openstad/auth-server:develop-1764f8d
image:
deploymentContainer:
image: ghcr.io/openstad/image-server:develop-b2dfa9a
image: ghcr.io/openstad/image-server:develop-1764f8d
cms:
deploymentContainer:
image: ghcr.io/openstad/cms-server:develop-b2dfa9a
image: ghcr.io/openstad/cms-server:develop-1764f8d
16 changes: 16 additions & 0 deletions packages/document-map/src/document-map.css
Original file line number Diff line number Diff line change
Expand Up @@ -402,4 +402,20 @@ a + .url-list:before {
padding: 0;
left: 50%;
transform: translateX(-50%);
}

section.comment-item-footer .utrecht-button--disabled:before,
.like-option-container .utrecht-button--disabled:hover:before {
content: 'Je moet ingelogd zijn om te kunnen reageren.';
position: absolute;
inset: 3px;
background: #adadad;
display: flex;
align-items: center;
justify-content: center;
color: #000;
font-size: 12px;
padding: 10px 10px;
line-height: 13px;
font-weight: 500;
}
6 changes: 3 additions & 3 deletions packages/document-map/src/document-map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ function DocumentMap({
{displayResourceInfo === 'left' && (
<section className="content-intro">
{resource.title ? <Heading level={1}>{resource.title}</Heading> : null}
{resource.summary ? <Paragraph>{resource.summary}</Paragraph> : null}
{resource.summary ? <Heading level={2} appearance='utrecht-heading-4' dangerouslySetInnerHTML={{ __html: resource.summary }}></Heading> : null}

{(displayResourceDescription === 'yes' && resource.description) ? <Paragraph dangerouslySetInnerHTML={{ __html: resource.description }} /> : null}
</section>
Expand All @@ -716,7 +716,7 @@ function DocumentMap({
<div className="content-container mobileonly">
<section className="content-intro">
{resource.title ? <Heading level={1}>{resource.title}</Heading> : null}
{resource.summary ? <Paragraph>{resource.summary}</Paragraph> : null}
{resource.summary ? <Heading level={2} appearance='utrecht-heading-4' dangerouslySetInnerHTML={{ __html: resource.summary }}></Heading> : null}

{(displayResourceDescription === 'yes' && resource.description) ? <Paragraph dangerouslySetInnerHTML={{ __html: resource.description }} /> : null}
</section>
Expand Down Expand Up @@ -931,7 +931,7 @@ function DocumentMap({
{displayResourceInfo === 'right' && (
<section className="content-intro desktoponly">
{resource.title ? <Heading level={1}>{resource.title}</Heading> : null}
{resource.summary ? <Paragraph>{resource.summary}</Paragraph> : null}
{resource.summary ? <Heading level={2} appearance='utrecht-heading-4' dangerouslySetInnerHTML={{ __html: resource.summary }}></Heading> : null}

{(displayResourceDescription === 'yes' && resource.description) ? <Paragraph dangerouslySetInnerHTML={{ __html: resource.description }} /> : null}

Expand Down
2 changes: 1 addition & 1 deletion packages/leaflet-map/src/area.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export function Area({
<>
<Popup className={'leaflet-popup'}>
{item.title && <h3 className="utrecht-heading-3">{item.title}</h3>}
{item.url && <a className="utrecht-button-link utrecht-button-link--html-a utrecht-button-link--primary-action" href={item.url}>Lees verder</a>}
{item.url && <a className="pop-up-link" href={item.url}>Lees verder</a>}
</Popup>
</>
}
Expand Down
13 changes: 11 additions & 2 deletions packages/leaflet-map/src/css/base-map.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,17 @@
}

.leaflet-container a {
color: var(--_utrecht-button-appearance-color);
display: inline-block;
font-size: 18px;
color: var(--utrecht-button-primary-action-background-color);
}
.leaflet-bottom.leaflet-right{
display: none;
}
}


.leaflet-popup .leaflet-popup-content{
display: flex;
flex-direction: column;
gap: .5rem;
}
47 changes: 46 additions & 1 deletion packages/resource-detail-with-map/src/resourceDetailWithMap.css
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,49 @@

.osc-resource-detail-content.osc-resource-detail-grid .osc-resource-detail-content-items.resource-has-no-images .osc-carousel .carousel-items .image-container img {
display: none;
}
}


/* Text Colors */
.color-FFFFFF { color: #FFFFFF; }
.color-000000 { color: #000000; }
.color-EC673E { color: #EC673E; }
.color-7DB47B { color: #7DB47B; }
.color-98BFE6 { color: #98BFE6; }
.color-FAE065 { color: #FAE065; }
.color-F59A02 { color: #F59A02; }
.color-B078AF { color: #B078AF; }
.color-E881B0 { color: #E881B0; }
.color-A52A2A { color: #A52A2A; }
.color-D1D1D1 { color: #D1D1D1; }
.color-00FFFF { color: #00FFFF; }
.color-FFD700 { color: #FFD700; }
.color-ADFF2F { color: #ADFF2F; }
.color-4B0082 { color: #4B0082; }
.color-8B4513 { color: #8B4513; }
.color-FA8072 { color: #FA8072; }
.color-20B2AA { color: #20B2AA; }
.color-4682B4 { color: #4682B4; }
.color-D3D3D3 { color: #D3D3D3; }

/* Background Colors */
.bgColor-FFFFFF { background-color: #FFFFFF; }
.bgColor-000000 { background-color: #000000; }
.bgColor-EC673E { background-color: #EC673E; }
.bgColor-7DB47B { background-color: #7DB47B; }
.bgColor-98BFE6 { background-color: #98BFE6; }
.bgColor-FAE065 { background-color: #FAE065; }
.bgColor-F59A02 { background-color: #F59A02; }
.bgColor-B078AF { background-color: #B078AF; }
.bgColor-E881B0 { background-color: #E881B0; }
.bgColor-A52A2A { background-color: #A52A2A; }
.bgColor-D1D1D1 { background-color: #D1D1D1; }
.bgColor-00FFFF { background-color: #00FFFF; }
.bgColor-FFD700 { background-color: #FFD700; }
.bgColor-ADFF2F { background-color: #ADFF2F; }
.bgColor-4B0082 { background-color: #4B0082; }
.bgColor-8B4513 { background-color: #8B4513; }
.bgColor-FA8072 { background-color: #FA8072; }
.bgColor-20B2AA { background-color: #20B2AA; }
.bgColor-4682B4 { background-color: #4682B4; }
.bgColor-D3D3D3 { background-color: #D3D3D3; }
13 changes: 12 additions & 1 deletion packages/resource-detail-with-map/src/resourceDetailWithMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,17 @@ function ResourceDetailWithMap({
const resourceImages = (Array.isArray(resource.images) && resource.images.length > 0) ? resource.images : [{ url: defaultImage }];
const hasImages = (Array.isArray(resourceImages) && resourceImages.length > 0 && resourceImages[0].url !== '') ? '' : 'resource-has-no-images';

const firstStatus = resource.statuses
? resource.statuses
.filter((status: { seqnr: number }) => status.seqnr !== undefined && status.seqnr !== null)
.sort((a: { seqnr: number }, b: { seqnr: number }) => a.seqnr - b.seqnr)[0] || resource.statuses[0]
: false;

const colorClass = firstStatus && firstStatus.color ? `color-${firstStatus.color}` : '';
const backgroundColorClass = firstStatus && firstStatus.backgroundColor ? `bgColor-${firstStatus.backgroundColor}` : '';

const statusClasses = `${colorClass} ${backgroundColorClass}`.trim();

return (
<section className="osc-resource-detail-content osc-resource-detail-grid">
{resource ? (
Expand All @@ -181,7 +192,7 @@ function ResourceDetailWithMap({
src={i.url}
imageFooter={
<div>
<Paragraph className="osc-resource-detail-content-item-status">
<Paragraph className={`osc-resource-detail-content-item-status ${statusClasses}`}>
{resource.statuses
?.map((s: { label: string }) => s.label)
?.join(', ')}
Expand Down
43 changes: 26 additions & 17 deletions packages/stem-begroot/src/stem-begroot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ function StemBegroot({
// Check the pending state and if there are any resources, hint to update the selected items
useEffect(() => {
if (props.votes.voteType === "countPerTag" || props.votes.voteType === "budgetingPerTag") {
const pendingPerTag = session.get('osc-resource-vote-pending-per-tag');
const pendingPerTag = JSON.parse(localStorage.getItem('oscResourceVotePendingPerTag') || 'null');

if (pendingPerTag) {
setTagCounter((prevTagCounter) =>
Expand Down Expand Up @@ -241,7 +241,7 @@ function StemBegroot({
);
}
} else {
let pending = session.get('osc-resource-vote-pending');
let pending = JSON.parse(localStorage.getItem('oscResourceVotePending') || 'null');
if (
pending &&
resources?.records?.length > 0 &&
Expand All @@ -257,9 +257,9 @@ function StemBegroot({
let pending;

if (props.votes.voteType === "countPerTag" || props.votes.voteType === "budgetingPerTag") {
pending = session.get('osc-resource-vote-pending-per-tag');
pending = JSON.parse(localStorage.getItem('oscResourceVotePendingPerTag') || 'null');
} else {
pending = session.get('osc-resource-vote-pending');
pending = JSON.parse(localStorage.getItem('oscResourceVotePending') || 'null');
}

if (
Expand All @@ -282,7 +282,8 @@ function StemBegroot({
resourcesToVoteFor[resource.id] = 'yes';
}
);
session.set('osc-resource-vote-pending', resourcesToVoteFor);

localStorage.setItem('oscResourceVotePending', JSON.stringify(resourcesToVoteFor));
} else {
const resourcesToVoteForPerTag: { [tag: string]: { [key: string]: any } } = {};

Expand All @@ -296,7 +297,7 @@ function StemBegroot({
});
});

session.set('osc-resource-vote-pending-per-tag', resourcesToVoteForPerTag);
localStorage.setItem('oscResourceVotePendingPerTag', JSON.stringify(resourcesToVoteForPerTag));
}
}

Expand Down Expand Up @@ -455,7 +456,7 @@ function StemBegroot({
isSimpleView={Boolean(props.isSimpleView)}
onPrimaryButtonClick={(resource) => {
if (props.votes.voteType === "countPerTag" || props.votes.voteType === "budgetingPerTag") {
session.remove('osc-resource-vote-pending-per-tag');
localStorage.removeItem('oscResourceVotePendingPerTag');

if (activeTagTab) {
const activeTag = tagCounter.find(tagObj => tagObj[activeTagTab]);
Expand All @@ -475,7 +476,7 @@ function StemBegroot({
}
}
} else {
session.remove('osc-resource-vote-pending');
localStorage.removeItem('oscResourceVotePending');

const resourceInBudgetList = selectedResources.find(
(r) => r.id === resource.id
Expand Down Expand Up @@ -550,8 +551,8 @@ function StemBegroot({
setActiveTagTab={setActiveTagTab}
typeIsPerTag={props?.votes?.voteType === "countPerTag" || props?.votes?.voteType === "budgetingPerTag"}
onSelectedResourceRemove={(resource: {id: number, budget: number}) => {
session.remove('osc-resource-vote-pending');
session.remove('osc-resource-vote-pending-per-tag');
localStorage.removeItem('oscResourceVotePending');
localStorage.removeItem('oscResourceVotePendingPerTag');

if (props?.votes?.voteType === "countPerTag" || props?.votes?.voteType === "budgetingPerTag") {
setTagCounter(prevTagCounter => {
Expand Down Expand Up @@ -653,9 +654,7 @@ function StemBegroot({

{currentStep === 3 ? (
<Step3Success
loginUrl={`${props?.login?.url}`}
step3success={props.step3success || ''}
stemCodeTitleSuccess={props.stemCodeTitleSuccess}
/>
) : null}

Expand Down Expand Up @@ -687,6 +686,17 @@ function StemBegroot({
</Button>
) : null}

{currentStep === 3 ? (
<Button
appearance='secondary-action-button'
onClick={() => {
const loginUrl = new URL(`${props?.login?.url}`);
document.location.href = loginUrl.toString();
}}>
{props.stemCodeTitleSuccess}
</Button>
) : null}

{/* Dont show on voting step if you are on step 2 your not logged in*/}
{(currentStep !== 2 && currentStep !== -1) ? (
<Button
Expand Down Expand Up @@ -732,12 +742,11 @@ function StemBegroot({

if (uniqueResourcesToVote.length > 0) {
await doVote(uniqueResourcesToVote);
localStorage.removeItem('oscResourceVotePendingPerTag');
}

session.remove('osc-resource-vote-pending-per-tag');
} else {
await doVote(selectedResources);
session.remove('osc-resource-vote-pending');
localStorage.removeItem('oscResourceVotePending');
}
setCurrentStep(currentStep + 1);
} catch (err: any) {
Expand Down Expand Up @@ -849,8 +858,8 @@ function StemBegroot({
originalResourceUrl={props.originalResourceUrl}
resourceListColumns={resourceListColumns || 3}
onResourcePrimaryClicked={(resource) => {
session.remove('osc-resource-vote-pending');
session.remove('osc-resource-vote-pending-per-tag');
localStorage.removeItem('oscResourceVotePending');
localStorage.removeItem('oscResourceVotePendingPerTag');

let newTagCounter = [...tagCounter];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const StemBegrootBudgetList = ({
onClick={() => {
onSelectedResourceRemove(resource);
}}
className="subtle-button"
className="primary-action-button"
icon="ri-close-line"
iconOnly={true}
text='Item verwijderen'
Expand Down
21 changes: 5 additions & 16 deletions packages/stem-begroot/src/step-3-success/index.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
import { SecondaryButton, Spacer } from '@openstad-headless/ui/src';
import React, { ReactNode } from 'react';
import { Heading5, Button } from "@utrecht/component-library-react";
import { Spacer } from '@openstad-headless/ui/src';
import React from 'react';
import { Heading5 } from "@utrecht/component-library-react";

type Props = {
loginUrl: string;
step3success: string;
stemCodeTitleSuccess: string;
};
export const Step3Success = ({ step3success, stemCodeTitleSuccess, ...props }: Props) => {
export const Step3Success = ({ step3success, ...props }: Props) => {
return (
<>
<Spacer size={1.5} />
<Heading5>{step3success}</Heading5>
<Spacer size={2} />

<Button
appearance='primary-action-button'
onClick={() => {
const loginUrl = new URL(`${props.loginUrl}`);
document.location.href = loginUrl.toString();
}}>
{stemCodeTitleSuccess}
</Button>
<Spacer size={4} />
</>
);
};

0 comments on commit 5797616

Please sign in to comment.