From 657bbf36a0ab7314faf653ff806c166a1a940cb5 Mon Sep 17 00:00:00 2001 From: Viktar Maslouski Date: Thu, 23 Jan 2025 15:31:01 +0100 Subject: [PATCH 01/15] uncomment ideation counter --- .../components/publicgroupbox/publicgroupbox.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/public-groups/components/publicgroupbox/publicgroupbox.component.html b/src/app/public-groups/components/publicgroupbox/publicgroupbox.component.html index e12c0b0a0..421f4fddf 100644 --- a/src/app/public-groups/components/publicgroupbox/publicgroupbox.component.html +++ b/src/app/public-groups/components/publicgroupbox/publicgroupbox.component.html @@ -50,14 +50,14 @@ {{group.members?.topics.count?.inProgress || 0}} - +
Date: Thu, 23 Jan 2025 13:50:18 +0100 Subject: [PATCH 02/15] add component --- .../terms-links/terms-links.component.html | 10 +++++ .../terms-links/terms-links.component.scss | 15 +++++++ .../terms-links/terms-links.component.spec.ts | 25 +++++++++++ .../terms-links/terms-links.component.ts | 45 +++++++++++++++++++ src/app/shared/shared.module.ts | 3 ++ 5 files changed, 98 insertions(+) create mode 100644 src/app/shared/components/terms-links/terms-links.component.html create mode 100644 src/app/shared/components/terms-links/terms-links.component.scss create mode 100644 src/app/shared/components/terms-links/terms-links.component.spec.ts create mode 100644 src/app/shared/components/terms-links/terms-links.component.ts diff --git a/src/app/shared/components/terms-links/terms-links.component.html b/src/app/shared/components/terms-links/terms-links.component.html new file mode 100644 index 000000000..3a0eb8be4 --- /dev/null +++ b/src/app/shared/components/terms-links/terms-links.component.html @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/src/app/shared/components/terms-links/terms-links.component.scss b/src/app/shared/components/terms-links/terms-links.component.scss new file mode 100644 index 000000000..8bd56f9b6 --- /dev/null +++ b/src/app/shared/components/terms-links/terms-links.component.scss @@ -0,0 +1,15 @@ +.links_wrapper { + display: flex; + flex-direction: column; + align-items: flex-start; + list-style: none; + margin: 0; + padding: 0; + gap: 8px; + + .link { + display: flex; + gap: 8px; + align-items: center; + } +} \ No newline at end of file diff --git a/src/app/shared/components/terms-links/terms-links.component.spec.ts b/src/app/shared/components/terms-links/terms-links.component.spec.ts new file mode 100644 index 000000000..7e202e0a5 --- /dev/null +++ b/src/app/shared/components/terms-links/terms-links.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TermsLinksComponent } from './terms-links.component'; + +describe('TermsLinksComponent', () => { + let component: TermsLinksComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ TermsLinksComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(TermsLinksComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/shared/components/terms-links/terms-links.component.ts b/src/app/shared/components/terms-links/terms-links.component.ts new file mode 100644 index 000000000..82d275d00 --- /dev/null +++ b/src/app/shared/components/terms-links/terms-links.component.ts @@ -0,0 +1,45 @@ +import { Component, Input } from '@angular/core'; +import { ConfigService } from '@services/config.service'; + +interface ILink { + title: string; + href: string +} + +@Component({ + selector: 'terms-links', + templateUrl: './terms-links.component.html', + styleUrls: ['./terms-links.component.scss'] +}) +export class TermsLinksComponent { + @Input() withStatutLink?: boolean = true; + + config: Record & { + termsOfUse: string; + privacyPolicy: string; + statut: string; + }; + links: ILink[] = [] + constructor(ConfigService: ConfigService) { + this.config = ConfigService.get('legal'); + } + + ngOnInit() { + this.links = [ + { + title: "MODALS.PRIVACY_POLICY_LNK_TERMS_OF_USE", + href: this.config.termsOfUse, + }, + { + title: "MODALS.PRIVACY_POLICY_LNK_PRIVACY_POLICY", + href: this.config.privacyPolicy, + }, + ...(this.withStatutLink ? [ + { + title: "MODALS.PRIVACY_POLICY_LNK_ARTICLES_OF_ASSOCIATION", + href: this.config.statut, + } + ] : []) + ] + } +} diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index 8c0ecfb33..78419dd21 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -56,6 +56,7 @@ import { InterruptDialogComponent } from './components/interrupt-dialog/interrup import { TooltipComponent} from './components/tooltip/tooltip.component'; import { ImageEditorComponent } from './components/image-editor/image-editor.component'; import { SearchFilterComponent } from './components/search-filter/search-filter.component'; +import { TermsLinksComponent } from './components/terms-links/terms-links.component'; import { TopicVoteDeadlineComponent } from '../topic/components/topic-vote-deadline/topic-vote-deadline.component'; import { NotificationComponent } from '../core/components/notification/notification.component'; @@ -113,6 +114,7 @@ import { SiteNotificationComponent } from './components/site-notification/site-n TooltipComponent, ImageEditorComponent, SearchFilterComponent, + TermsLinksComponent, TopicVoteDeadlineComponent, NotificationComponent, MarkdownLinkDialogComponent, @@ -181,6 +183,7 @@ import { SiteNotificationComponent } from './components/site-notification/site-n TooltipComponent, ImageEditorComponent, SearchFilterComponent, + TermsLinksComponent, DialogModule, NotificationComponent, MarkdownLinkDialogComponent, From ea460f2c4eed066f862237d3be21d392e7ff386e Mon Sep 17 00:00:00 2001 From: Viktar Maslouski Date: Thu, 23 Jan 2025 13:50:37 +0100 Subject: [PATCH 03/15] use links component --- .../privacy-policy/privacy-policy.component.html | 14 +------------- .../components/profile/profile.component.html | 7 +++++++ src/app/core/components/help/help.component.html | 7 +++++++ src/app/core/components/help/help.component.scss | 14 +++++++++++++- src/assets/config/default.json | 1 + src/assets/i18n/en.json | 3 +++ 6 files changed, 32 insertions(+), 14 deletions(-) diff --git a/src/app/account/components/privacy-policy/privacy-policy.component.html b/src/app/account/components/privacy-policy/privacy-policy.component.html index 3f94b7057..60234b337 100644 --- a/src/app/account/components/privacy-policy/privacy-policy.component.html +++ b/src/app/account/components/privacy-policy/privacy-policy.component.html @@ -39,19 +39,7 @@

diff --git a/src/app/account/components/profile/profile.component.html b/src/app/account/components/profile/profile.component.html index 89cf97ca5..b996762a8 100644 --- a/src/app/account/components/profile/profile.component.html +++ b/src/app/account/components/profile/profile.component.html @@ -184,6 +184,13 @@ [model]="form.preferences?.showInSearch" (click)="form.preferences.showInSearch = !form.preferences.showInSearch">
+ +
+
+
+ +
+
diff --git a/src/app/core/components/help/help.component.html b/src/app/core/components/help/help.component.html index 419d41747..f3e2a017f 100644 --- a/src/app/core/components/help/help.component.html +++ b/src/app/core/components/help/help.component.html @@ -20,6 +20,7 @@
+
@@ -38,6 +39,7 @@
+
@@ -84,6 +86,11 @@
+ +
diff --git a/src/app/core/components/help/help.component.scss b/src/app/core/components/help/help.component.scss index 3b58b9c01..a14f037ec 100644 --- a/src/app/core/components/help/help.component.scss +++ b/src/app/core/components/help/help.component.scss @@ -133,6 +133,8 @@ border-radius: 4px; background: var(--color-surfaces); box-shadow: 0 0 8px 0 #727c84; + overflow-y: auto; + overflow-x: hidden; @include mixins.mobile { width: 100%; @@ -188,9 +190,19 @@ } } + .links_content { + padding: 16px; + border-radius: 4px; + background: var(--color-background); + margin-top: 16px; + + .links_content_title { + margin-bottom: 16px; + } + } + .help_content { width: 400px; - height: 100vh; @include mixins.mobile { width: 100%; diff --git a/src/assets/config/default.json b/src/assets/config/default.json index b15add427..fcc035d22 100644 --- a/src/assets/config/default.json +++ b/src/assets/config/default.json @@ -35,6 +35,7 @@ "legal": { "termsOfUse": "https://citizenos.com/legal/api/", "privacyPolicy": "https://citizenos.com/legal/privacy/", + "statut": "https://citizenos.com/legal/statute/", "version": "1" }, "attachments": { diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index a47352079..e5d1d3e63 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -1727,6 +1727,7 @@ "PRIVACY_POLICY_DESCRIPTION_NEW_USER": "Thanks for creating an account! Before you continue, please take a moment to read and accept our Terms of Use and Privacy Policy", "PRIVACY_POLICY_LNK_TERMS_OF_USE": "Terms of use", "PRIVACY_POLICY_LNK_PRIVACY_POLICY": "Privacy Policy", + "PRIVACY_POLICY_LNK_ARTICLES_OF_ASSOCIATION": "Articles of Association", "PRIVACY_POLICY_BTN_REJECT": "Reject", "PRIVACY_POLICY_BTN_ACCEPT": "Accept", "USER_DELETE_CONFIRM_HEADING": "Delete account", @@ -1982,6 +1983,8 @@ "TAB_ACCOUNT": "Account", "LBL_SHOW_IN_SEARCH": "Show my username in search results", "LBL_SHOW_IN_SEARCH_DESCRIPTION": "Display my username in invite search results so that other people can easily invite me to groups and topics", + "LBL_LINKS_TITLE": "Links", + "LBL_LINKS_DESCRIPTION": "If necessary, you can consult our legal documentation.", "LBL_DELETE_ACCOUNT": "Delete your account", "LBL_DELETE_ACCOUNT_DESCRIPTION": "When deleting your account all your contributions will stay visible in Citizen OS, but they will not be linked to your account anymore.", "LBL_PROFILE_LANGUAEG": "Set your profile language", From a7fb14152f7ebf24080597a805bbc7ce62348185 Mon Sep 17 00:00:00 2001 From: Viktar Maslouski Date: Wed, 22 Jan 2025 22:22:24 +0100 Subject: [PATCH 04/15] update handleActivityRedirect --- src/app/services/activity.service.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/services/activity.service.ts b/src/app/services/activity.service.ts index 037cb2214..f64b29980 100644 --- a/src/app/services/activity.service.ts +++ b/src/app/services/activity.service.ts @@ -694,6 +694,10 @@ export class ActivityService extends ItemsListService { state = state.concat(['topics', origin.id]); } + if ((object && (object['@type'] === 'Idea' || object['@type'] === 'IdeaVote'))) { + state = state.concat(['topics', object.topicId]); + } + /** * @note Assume that the first item is always present and is lang param. * No action needed in this case. From f05d26d17b7529759724710010aec572b7cea8ff Mon Sep 17 00:00:00 2001 From: Viktar Maslouski Date: Tue, 28 Jan 2025 23:30:16 +0100 Subject: [PATCH 05/15] add withEmail prop --- .../topic-member-user/topic-member-user.component.html | 2 +- .../components/topic-member-user/topic-member-user.component.ts | 1 + .../topic-participants/topic-participants.component.html | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/topic/components/topic-member-user/topic-member-user.component.html b/src/app/topic/components/topic-member-user/topic-member-user.component.html index f6aeea17d..5f06d04a0 100644 --- a/src/app/topic/components/topic-member-user/topic-member-user.component.html +++ b/src/app/topic/components/topic-member-user/topic-member-user.component.html @@ -9,7 +9,7 @@
{{member.name}}
- + {{member.email}}
diff --git a/src/app/topic/components/topic-member-user/topic-member-user.component.ts b/src/app/topic/components/topic-member-user/topic-member-user.component.ts index 1cc198a0f..93dac5a03 100644 --- a/src/app/topic/components/topic-member-user/topic-member-user.component.ts +++ b/src/app/topic/components/topic-member-user/topic-member-user.component.ts @@ -21,6 +21,7 @@ export class TopicMemberUserComponent implements OnInit { @Input() member?: TopicMemberUser | any; @Input() topic: Topic | any; @Input() fields?: any; + @Input() withEmail?: boolean = true; userLevels = Object.keys(this.TopicService.LEVELS) constructor( diff --git a/src/app/topic/components/topic-participants/topic-participants.component.html b/src/app/topic/components/topic-participants/topic-participants.component.html index fec6503df..c2524d484 100644 --- a/src/app/topic/components/topic-participants/topic-participants.component.html +++ b/src/app/topic/components/topic-participants/topic-participants.component.html @@ -105,7 +105,7 @@

- +
From 372b24317f7595bad169ae10ba97271ea6040230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ilmar=20T=C3=BCrk?= Date: Wed, 15 Jan 2025 23:12:42 +0200 Subject: [PATCH 06/15] WIP add new setting to ideation --- .../ideation-create.component.html | 39 +++++++++++ .../ideation-create.component.ts | 68 ++----------------- src/app/interfaces/ideation.ts | 3 +- 3 files changed, 48 insertions(+), 62 deletions(-) diff --git a/src/app/ideation/components/ideation-create/ideation-create.component.html b/src/app/ideation/components/ideation-create/ideation-create.component.html index 73c4740ca..9679e6189 100644 --- a/src/app/ideation/components/ideation-create/ideation-create.component.html +++ b/src/app/ideation/components/ideation-create/ideation-create.component.html @@ -983,6 +983,45 @@
+
+
+
3
+
+
+
+
+
3
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+ +
+ +
+
+
+
+
diff --git a/src/app/ideation/components/ideation-create/ideation-create.component.ts b/src/app/ideation/components/ideation-create/ideation-create.component.ts index 7b4ebf669..521456e70 100644 --- a/src/app/ideation/components/ideation-create/ideation-create.component.ts +++ b/src/app/ideation/components/ideation-create/ideation-create.component.ts @@ -78,6 +78,7 @@ export class IdeationCreateComponent extends TopicFormComponent implements Block creatorId: '', question: '', deadline: null, + disableReplies: false, createdAt: '', updatedAt: '' }; @@ -246,21 +247,14 @@ export class IdeationCreateComponent extends TopicFormComponent implements Block } } const tabIndex = this.tabs.indexOf(tab); - if (tabIndex === 2) { - /* if (this.voteCreateForm) - this.voteCreateForm.saveVoteSettings();*/ - } if (tabIndex === 2) { if (!this.ideation.question) { this.Notification.removeAll(); this.Notification.addError('VIEWS.IDEATION_CREATE.ERROR_MISSING_QUESTION'); return; } - /* if (this.voteCreateForm) - this.voteCreateForm.saveVoteSettings();*/ } if (tabIndex + 1 === 3) { - // this.voteCreateForm?.filterOptions(); setTimeout(() => { this.TopicService.readDescription(this.topic.id).pipe(take(1)).subscribe({ next: (topic) => { @@ -298,7 +292,7 @@ export class IdeationCreateComponent extends TopicFormComponent implements Block override saveAsDraft() { if (this.topic.status === this.TopicService.STATUSES.draft) { - const updateTopic = Object.assign({}, this.topic); + const updateTopic = { ...this.topic }; if (!updateTopic.intro?.length) { updateTopic.intro = null; } @@ -336,7 +330,7 @@ export class IdeationCreateComponent extends TopicFormComponent implements Block override publish() { this.titleInput?.nativeElement?.parentNode.parentNode.classList.remove('error'); const isDraft = (this.topic.status === this.TopicService.STATUSES.draft); - const updateTopic = Object.assign({}, this.topic); + const updateTopic = { ...this.topic }; if (!updateTopic.intro?.length) { updateTopic.intro = null; } @@ -385,47 +379,6 @@ export class IdeationCreateComponent extends TopicFormComponent implements Block }); } - /*override publish() { - this.titleInput?.nativeElement?.parentNode.parentNode.classList.remove('error'); - const isDraft = (this.topic.status === this.TopicService.STATUSES.draft); - const updateTopic = Object.assign({}, this.topic); - if (!updateTopic.intro?.length) { - updateTopic.intro = null; - } - - this.TopicService.patch(updateTopic).pipe(take(1)).subscribe({ - next: () => { - if (!this.ideation.id) { - this.createIdeation(true); - } else if ([this.TopicService.STATUSES.draft, this.TopicService.STATUSES.ideation].indexOf(this.topic.status) > -1) { - this.updateIdeation(true); - } - - this.topicGroups.forEach((group) => { - this.saveMemberGroup(group) - }); - this.saveImage() - .subscribe({ - next: (res: any) => { - if (res && !res.link) return; - if (res.link) { - this.topic.imageUrl = res.link; - } - this.hasChanges$.next(false); - this.router.navigate(['/', this.translate.currentLang, 'topics', this.topic.id]); - this.TopicService.reloadTopic(); - }, - error: (err) => { - console.log('publish error', err) - } - }); - }, - error: (err: any) => { - console.log('ERROR', err); - } - }); - }*/ - saveIdeationSettings(ideation?: any) { if (ideation) { this.ideation = ideation; @@ -433,7 +386,7 @@ export class IdeationCreateComponent extends TopicFormComponent implements Block } createIdeation(updateTopicStatus?: boolean) { - const createIdeation: any = Object.assign({ topicId: this.topic.id }, this.ideation); + const createIdeation: any = { topicId: this.topic.id , ...this.ideation }; if (!this.deadlineSelect) { createIdeation.deadline = null; } @@ -441,11 +394,10 @@ export class IdeationCreateComponent extends TopicFormComponent implements Block .pipe(take(1)) .subscribe({ next: (ideation) => { - // this.TopicService.reloadTopic(); this.ideation = ideation; if (updateTopicStatus) { const isDraft = (this.topic.status === this.TopicService.STATUSES.draft); - const updateTopic = Object.assign({}, this.topic); + const updateTopic = { ...this.topic }; updateTopic.status = this.TopicService.STATUSES.ideation; this.TopicService.patch(updateTopic).pipe(take(1)).subscribe({ next: (res) => { @@ -479,7 +431,7 @@ export class IdeationCreateComponent extends TopicFormComponent implements Block updateIdeation(updateTopicStatus?: boolean) { - const updateIdeation = Object.assign({ topicId: this.topic.id }, this.ideation); + const updateIdeation = { topicId: this.topic.id, ...this.ideation }; if (!this.deadlineSelect) { updateIdeation.deadline = null; } @@ -535,16 +487,10 @@ export class IdeationCreateComponent extends TopicFormComponent implements Block this.deadline.setMinutes(this.endsAt.min); this.ideation.deadline = this.deadline; this.daysToVoteEnd(); - - // this.setReminderOptions(); }; override isNextDisabled(tabSelected: string | void) { - if (tabSelected === 'preview' && !this.TopicService.canDelete(this.topic)) { - return true; - } else if (!this.topic.title || !this.topic.description) { - return true; - } else if (tabSelected === 'ideation_system' && !this.ideation.question) { + if ((tabSelected === 'preview' && !this.TopicService.canDelete(this.topic)) || !this.topic.title || !this.topic.description || (tabSelected === 'ideation_system' && !this.ideation.question)) { return true; } diff --git a/src/app/interfaces/ideation.ts b/src/app/interfaces/ideation.ts index 66784e406..2e78fab97 100644 --- a/src/app/interfaces/ideation.ts +++ b/src/app/interfaces/ideation.ts @@ -18,6 +18,7 @@ export interface Ideation { updatedAt: Date, ideas: { count: number - } + }, + disableReplies: boolean } From 3b730fce9af806dd625d1351865a270f7a40a42f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ilmar=20T=C3=BCrk?= Date: Sun, 19 Jan 2025 16:48:38 +0200 Subject: [PATCH 07/15] Update ideation settings to have disableReplies --- src/app/directives/cos-disabled.directive.ts | 2 +- .../idea/idea-dialog.component.html | 10 ++++- .../idea/idea-dialog.component.scss | 1 + .../components/idea/idea.component.ts | 43 ++++++++++--------- .../components/ideabox/ideabox.component.ts | 10 ++--- .../ideation-create.component.html | 24 +++-------- .../ideation-create.component.scss | 9 ++++ .../cos-toggle/cos-toggle.component.ts | 1 + .../components/tooltip/tooltip.component.ts | 22 +++------- src/assets/i18n/en.json | 5 +++ 10 files changed, 67 insertions(+), 60 deletions(-) diff --git a/src/app/directives/cos-disabled.directive.ts b/src/app/directives/cos-disabled.directive.ts index 844d9f8a8..e46ee8bb2 100644 --- a/src/app/directives/cos-disabled.directive.ts +++ b/src/app/directives/cos-disabled.directive.ts @@ -5,7 +5,7 @@ import { Directive, Input, ElementRef, SimpleChanges } from '@angular/core'; }) export class CosDisabledDirective { @Input() cosDisabled!: any; - constructor(private ElementRef: ElementRef) { + constructor(private readonly ElementRef: ElementRef) { } ngAfterViewInit(): void { diff --git a/src/app/ideation/components/idea/idea-dialog.component.html b/src/app/ideation/components/idea/idea-dialog.component.html index 22ab13223..84dd1611b 100644 --- a/src/app/ideation/components/idea/idea-dialog.component.html +++ b/src/app/ideation/components/idea/idea-dialog.component.html @@ -382,6 +382,9 @@
+
+
+
- + +
diff --git a/src/app/ideation/components/idea/idea-dialog.component.scss b/src/app/ideation/components/idea/idea-dialog.component.scss index 40d354bbc..f8a157bd9 100644 --- a/src/app/ideation/components/idea/idea-dialog.component.scss +++ b/src/app/ideation/components/idea/idea-dialog.component.scss @@ -337,6 +337,7 @@ .buttons_wrap { display: flex; gap: 16px; + position: relative; .btn_ghost_reply_idea { display: flex; diff --git a/src/app/ideation/components/idea/idea.component.ts b/src/app/ideation/components/idea/idea.component.ts index 6ddcc939c..ce3e2a8fe 100644 --- a/src/app/ideation/components/idea/idea.component.ts +++ b/src/app/ideation/components/idea/idea.component.ts @@ -15,6 +15,7 @@ import { TopicService } from '@services/topic.service'; import { Folder } from 'src/app/interfaces/folder'; import { DomSanitizer } from '@angular/platform-browser'; import { IdeaReplyComponent } from '../idea-reply/idea-reply.component'; +import { TopicIdeationService } from '@services/topic-ideation.service'; @Component({ selector: 'app-idea', @@ -24,32 +25,34 @@ export class IdeaComponent { ideaId: string = ''; topicId: string = ''; ideationId: string = ''; - constructor(dialog: DialogService, route: ActivatedRoute, TopicIdeaService: TopicIdeaService, router: Router, TopicService: TopicService) { + constructor(dialog: DialogService, route: ActivatedRoute, TopicIdeaService: TopicIdeaService, router: Router, TopicService: TopicService, TopicIdeationService: TopicIdeationService) { route.params.pipe(take(1), switchMap((params) => { this.ideaId = params['ideaId']; this.topicId = params['topicId']; this.ideationId = params['ideationId']; - return TopicIdeaService.get({ ideaId: this.ideaId, ideationId: this.ideationId, topicId: this.topicId }) - })).subscribe((idea) => { - TopicService.get(this.topicId).pipe(take(1)).subscribe((topic) => { - dialog.closeAll(); - const ideaDialog = dialog.open(IdeaDialogComponent, { - data: { - idea, - topic, - ideation: { id: this.ideationId }, - route: route - } - }); + return combineLatest([ + TopicIdeaService.get({ ideaId: this.ideaId, ideationId: this.ideationId, topicId: this.topicId }), + TopicService.get(this.topicId), + TopicIdeationService.get({ topicId: this.topicId, ideationId: this.ideationId }) + ]) + })).subscribe(([idea, topic, ideation]) => { + dialog.closeAll(); + const ideaDialog = dialog.open(IdeaDialogComponent, { + data: { + idea, + topic, + ideation, + route: route + } + }); - ideaDialog.afterClosed().subscribe((value) => { - if (value) { - TopicIdeaService.reload(); - router.navigate(['/', 'topics', this.topicId], { fragment: 'ideation' }) - } - }); - }) + ideaDialog.afterClosed().subscribe((value) => { + if (value) { + TopicIdeaService.reload(); + router.navigate(['/', 'topics', this.topicId], { fragment: 'ideation' }) + } + }); }); } } diff --git a/src/app/ideation/components/ideabox/ideabox.component.ts b/src/app/ideation/components/ideabox/ideabox.component.ts index c74138e72..d97dec9a4 100644 --- a/src/app/ideation/components/ideabox/ideabox.component.ts +++ b/src/app/ideation/components/ideabox/ideabox.component.ts @@ -3,17 +3,17 @@ import { AfterViewInit, Component, Input } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { Router } from '@angular/router'; import { take } from 'rxjs'; -import { Idea } from 'src/app/interfaces/idea'; +import { Idea } from '@interfaces/idea'; import { AuthService } from '@services/auth.service'; import { ConfigService } from '@services/config.service'; import { TopicIdeaService } from '@services/topic-idea.service'; -import { ConfirmDialogComponent } from 'src/app/shared/components/confirm-dialog/confirm-dialog.component'; -import { DialogService } from 'src/app/shared/dialog'; +import { ConfirmDialogComponent } from '@shared/components/confirm-dialog/confirm-dialog.component'; +import { DialogService } from '@shared/dialog'; import { IdeaReportComponent } from '../idea-report/idea-report.component'; import { AddIdeaFolderComponent } from '../add-idea-folder/add-idea-folder.component'; import { IdeaReportReasonComponent } from '../idea-report-reason/idea-report-reason.component'; -import { Topic } from 'src/app/interfaces/topic'; -import { Ideation } from 'src/app/interfaces/ideation'; +import { Topic } from '@interfaces/topic'; +import { Ideation } from '@interfaces/ideation'; import { IdeaReactionsComponent } from '../idea-reactions/idea-reactions.component'; import { TopicMemberUserService } from '@services/topic-member-user.service'; diff --git a/src/app/ideation/components/ideation-create/ideation-create.component.html b/src/app/ideation/components/ideation-create/ideation-create.component.html index 9679e6189..bb855fe5b 100644 --- a/src/app/ideation/components/ideation-create/ideation-create.component.html +++ b/src/app/ideation/components/ideation-create/ideation-create.component.html @@ -999,24 +999,14 @@
-
-
-
- +
+
+
+ +
-
-
- -
- +
+
diff --git a/src/app/ideation/components/ideation-create/ideation-create.component.scss b/src/app/ideation/components/ideation-create/ideation-create.component.scss index e8d66faf5..ec8dd650f 100644 --- a/src/app/ideation/components/ideation-create/ideation-create.component.scss +++ b/src/app/ideation/components/ideation-create/ideation-create.component.scss @@ -392,10 +392,19 @@ .radio_wrap { padding: 16px; border-radius: 8px; + width: 100%; + .radio_text_wrap { + width: 100%; + } &.selected { background-color: var(--color-dialog-ideation); } + .setting_toggle { + width: 100%; + align-items: center; + justify-content: space-between; + } } .date_selector { diff --git a/src/app/shared/components/cos-toggle/cos-toggle.component.ts b/src/app/shared/components/cos-toggle/cos-toggle.component.ts index ba69aafad..889ca3406 100644 --- a/src/app/shared/components/cos-toggle/cos-toggle.component.ts +++ b/src/app/shared/components/cos-toggle/cos-toggle.component.ts @@ -31,6 +31,7 @@ export class CosToggleComponent implements OnInit { } else { this.model = !this.model; } + console.log('CHANGE', this.model); this.modelChange.emit(this.model); }; diff --git a/src/app/shared/components/tooltip/tooltip.component.ts b/src/app/shared/components/tooltip/tooltip.component.ts index 8f2c3c059..4725fc301 100644 --- a/src/app/shared/components/tooltip/tooltip.component.ts +++ b/src/app/shared/components/tooltip/tooltip.component.ts @@ -5,23 +5,16 @@ import { Component, ElementRef, HostListener, ViewChild, Input, OnDestroy, Rende templateUrl: './tooltip.component.html', styleUrls: ['./tooltip.component.scss'] }) -export class TooltipComponent implements OnDestroy { +export class TooltipComponent { @Input() delay? = 190; // Optional delay input, in ms @Input() noIcon? = false; @ViewChild('tooltTipIcon') toolTipIcon!: ElementRef; @ViewChild('tipContainer') tipContainer!: ElementRef; @ViewChild('arrow') arrow!: ElementRef; - private timer: any; + private readonly timer: any; public visible = false; @Input() pos? = 'bottom'; - constructor(private el: ElementRef, private renderer: Renderer2) { - } - - ngAfterViewInit(): void { - } - - ngOnDestroy(): void { - + constructor(private readonly el: ElementRef, private readonly renderer: Renderer2) { } @HostListener('mouseenter') onMouseEnter() { @@ -48,11 +41,11 @@ export class TooltipComponent implements OnDestroy { } let left = containerPosition.right - window.innerWidth + 32; - const tipIconContainer = this.toolTipIcon.nativeElement.getBoundingClientRect(); - const arrowContainer = this.arrow.nativeElement.getBoundingClientRect(); + let tipIconContainer; + let arrowContainer; setTimeout(() => { - const tipIconContainer = this.toolTipIcon.nativeElement.getBoundingClientRect(); - const arrowContainer = this.arrow?.nativeElement.getBoundingClientRect(); + tipIconContainer = this.toolTipIcon.nativeElement.getBoundingClientRect(); + arrowContainer = this.arrow?.nativeElement.getBoundingClientRect(); if (tipIconContainer.left - arrowContainer.left > tipIconContainer.width / 2) this.renderer.setStyle(this.arrow.nativeElement, 'left', `${(tipIconContainer.left - arrowContainer.left + tipIconContainer.width / 2)}px`) }) @@ -83,6 +76,5 @@ export class TooltipComponent implements OnDestroy { } //this.renderer.setStyle(this.tipContainer.nativeElement, 'left', `${left}px`); } - console.log(left) } } diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index e5d1d3e63..0e8ba1a19 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -462,6 +462,7 @@ "NOTIFICATION_LNK_VIEW": "View anyway" }, "IDEA_DIALOG": { + "TOOLTIP_REPLIES_DISABLED": "Replies are turned off", "BTN_REPLY": "@:COMPONENTS.ARGUMENT.BTN_REPLY", "OPTION_EDIT": "@:COMPONENTS.IDEABOX.OPTION_EDIT", "OPTION_FAVOURITE": "@:VIEWS.TOPICS_TOPICID.OPTION_FAVOURITE", @@ -2299,6 +2300,10 @@ "DEADLINE_TIME_OPTION_PM": "@:COMPONENTS.EDIT_IDEATION_DEADLINE.DEADLINE_TIME_OPTION_PM", "DEADLINE_LBL_TIMEZONE": "@:COMPONENTS.EDIT_IDEATION_DEADLINE.DEADLINE_LBL_TIMEZONE", "SETTINGS_IDEATION_DEADLINE_PLACEHOLDER": "Select a date", + "SETTINGS_HEADING_ADVANCED_SETTINGS": "Advanced settings", + "SETTINGS_HEADING_ADVANCED_SETTINGS_DESC": "Further options to customise the idea gathering phase.", + "LBL_DISABLE_REPLIES": "Replies are turned: {{value}}", + "LBL_DISABLE_REPLIES_DESC": "Disable replies to ideas", "PREVIEW_INFO": "This is a preview of your topic! You can still edit your topic at any point prior to starting a vote.", "BTN_IDEATION_ACTIONS": "Manage idea gathering", "NO_IDEAS_HEADING": "There are no ideas yet", From 45f5b3e613831b32689f458491999744f61fcac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ilmar=20T=C3=BCrk?= Date: Fri, 31 Jan 2025 18:31:29 +0200 Subject: [PATCH 08/15] FIX #1819 --- .../topic-member-user/topic-member-user.component.html | 2 +- .../components/topic-member-user/topic-member-user.component.ts | 1 + .../topic-participants/topic-participants.component.html | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/topic/components/topic-member-user/topic-member-user.component.html b/src/app/topic/components/topic-member-user/topic-member-user.component.html index f6aeea17d..5f06d04a0 100644 --- a/src/app/topic/components/topic-member-user/topic-member-user.component.html +++ b/src/app/topic/components/topic-member-user/topic-member-user.component.html @@ -9,7 +9,7 @@
{{member.name}}
- + {{member.email}}
diff --git a/src/app/topic/components/topic-member-user/topic-member-user.component.ts b/src/app/topic/components/topic-member-user/topic-member-user.component.ts index 1cc198a0f..93dac5a03 100644 --- a/src/app/topic/components/topic-member-user/topic-member-user.component.ts +++ b/src/app/topic/components/topic-member-user/topic-member-user.component.ts @@ -21,6 +21,7 @@ export class TopicMemberUserComponent implements OnInit { @Input() member?: TopicMemberUser | any; @Input() topic: Topic | any; @Input() fields?: any; + @Input() withEmail?: boolean = true; userLevels = Object.keys(this.TopicService.LEVELS) constructor( diff --git a/src/app/topic/components/topic-participants/topic-participants.component.html b/src/app/topic/components/topic-participants/topic-participants.component.html index fec6503df..c2524d484 100644 --- a/src/app/topic/components/topic-participants/topic-participants.component.html +++ b/src/app/topic/components/topic-participants/topic-participants.component.html @@ -105,7 +105,7 @@

- +
From 166a5dd1c7ccad77f780e4cf193ab8c82e0c1836 Mon Sep 17 00:00:00 2001 From: Viktar Maslouski Date: Thu, 23 Jan 2025 15:31:01 +0100 Subject: [PATCH 09/15] uncomment ideation counter --- .../components/publicgroupbox/publicgroupbox.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/public-groups/components/publicgroupbox/publicgroupbox.component.html b/src/app/public-groups/components/publicgroupbox/publicgroupbox.component.html index e12c0b0a0..421f4fddf 100644 --- a/src/app/public-groups/components/publicgroupbox/publicgroupbox.component.html +++ b/src/app/public-groups/components/publicgroupbox/publicgroupbox.component.html @@ -50,14 +50,14 @@ {{group.members?.topics.count?.inProgress || 0}}
- +
Date: Thu, 23 Jan 2025 13:50:18 +0100 Subject: [PATCH 10/15] add component --- .../terms-links/terms-links.component.html | 10 +++++ .../terms-links/terms-links.component.scss | 15 +++++++ .../terms-links/terms-links.component.spec.ts | 25 +++++++++++ .../terms-links/terms-links.component.ts | 45 +++++++++++++++++++ src/app/shared/shared.module.ts | 3 ++ 5 files changed, 98 insertions(+) create mode 100644 src/app/shared/components/terms-links/terms-links.component.html create mode 100644 src/app/shared/components/terms-links/terms-links.component.scss create mode 100644 src/app/shared/components/terms-links/terms-links.component.spec.ts create mode 100644 src/app/shared/components/terms-links/terms-links.component.ts diff --git a/src/app/shared/components/terms-links/terms-links.component.html b/src/app/shared/components/terms-links/terms-links.component.html new file mode 100644 index 000000000..3a0eb8be4 --- /dev/null +++ b/src/app/shared/components/terms-links/terms-links.component.html @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/src/app/shared/components/terms-links/terms-links.component.scss b/src/app/shared/components/terms-links/terms-links.component.scss new file mode 100644 index 000000000..8bd56f9b6 --- /dev/null +++ b/src/app/shared/components/terms-links/terms-links.component.scss @@ -0,0 +1,15 @@ +.links_wrapper { + display: flex; + flex-direction: column; + align-items: flex-start; + list-style: none; + margin: 0; + padding: 0; + gap: 8px; + + .link { + display: flex; + gap: 8px; + align-items: center; + } +} \ No newline at end of file diff --git a/src/app/shared/components/terms-links/terms-links.component.spec.ts b/src/app/shared/components/terms-links/terms-links.component.spec.ts new file mode 100644 index 000000000..7e202e0a5 --- /dev/null +++ b/src/app/shared/components/terms-links/terms-links.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TermsLinksComponent } from './terms-links.component'; + +describe('TermsLinksComponent', () => { + let component: TermsLinksComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ TermsLinksComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(TermsLinksComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/shared/components/terms-links/terms-links.component.ts b/src/app/shared/components/terms-links/terms-links.component.ts new file mode 100644 index 000000000..82d275d00 --- /dev/null +++ b/src/app/shared/components/terms-links/terms-links.component.ts @@ -0,0 +1,45 @@ +import { Component, Input } from '@angular/core'; +import { ConfigService } from '@services/config.service'; + +interface ILink { + title: string; + href: string +} + +@Component({ + selector: 'terms-links', + templateUrl: './terms-links.component.html', + styleUrls: ['./terms-links.component.scss'] +}) +export class TermsLinksComponent { + @Input() withStatutLink?: boolean = true; + + config: Record & { + termsOfUse: string; + privacyPolicy: string; + statut: string; + }; + links: ILink[] = [] + constructor(ConfigService: ConfigService) { + this.config = ConfigService.get('legal'); + } + + ngOnInit() { + this.links = [ + { + title: "MODALS.PRIVACY_POLICY_LNK_TERMS_OF_USE", + href: this.config.termsOfUse, + }, + { + title: "MODALS.PRIVACY_POLICY_LNK_PRIVACY_POLICY", + href: this.config.privacyPolicy, + }, + ...(this.withStatutLink ? [ + { + title: "MODALS.PRIVACY_POLICY_LNK_ARTICLES_OF_ASSOCIATION", + href: this.config.statut, + } + ] : []) + ] + } +} diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index 8c0ecfb33..78419dd21 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -56,6 +56,7 @@ import { InterruptDialogComponent } from './components/interrupt-dialog/interrup import { TooltipComponent} from './components/tooltip/tooltip.component'; import { ImageEditorComponent } from './components/image-editor/image-editor.component'; import { SearchFilterComponent } from './components/search-filter/search-filter.component'; +import { TermsLinksComponent } from './components/terms-links/terms-links.component'; import { TopicVoteDeadlineComponent } from '../topic/components/topic-vote-deadline/topic-vote-deadline.component'; import { NotificationComponent } from '../core/components/notification/notification.component'; @@ -113,6 +114,7 @@ import { SiteNotificationComponent } from './components/site-notification/site-n TooltipComponent, ImageEditorComponent, SearchFilterComponent, + TermsLinksComponent, TopicVoteDeadlineComponent, NotificationComponent, MarkdownLinkDialogComponent, @@ -181,6 +183,7 @@ import { SiteNotificationComponent } from './components/site-notification/site-n TooltipComponent, ImageEditorComponent, SearchFilterComponent, + TermsLinksComponent, DialogModule, NotificationComponent, MarkdownLinkDialogComponent, From 487acab6eaf228ee46b0b8bca641d288dac34d28 Mon Sep 17 00:00:00 2001 From: Viktar Maslouski Date: Thu, 23 Jan 2025 13:50:37 +0100 Subject: [PATCH 11/15] use links component --- .../privacy-policy/privacy-policy.component.html | 14 +------------- .../components/profile/profile.component.html | 7 +++++++ src/app/core/components/help/help.component.html | 7 +++++++ src/app/core/components/help/help.component.scss | 14 +++++++++++++- src/assets/config/default.json | 1 + src/assets/i18n/en.json | 3 +++ 6 files changed, 32 insertions(+), 14 deletions(-) diff --git a/src/app/account/components/privacy-policy/privacy-policy.component.html b/src/app/account/components/privacy-policy/privacy-policy.component.html index 3f94b7057..60234b337 100644 --- a/src/app/account/components/privacy-policy/privacy-policy.component.html +++ b/src/app/account/components/privacy-policy/privacy-policy.component.html @@ -39,19 +39,7 @@

diff --git a/src/app/account/components/profile/profile.component.html b/src/app/account/components/profile/profile.component.html index 89cf97ca5..b996762a8 100644 --- a/src/app/account/components/profile/profile.component.html +++ b/src/app/account/components/profile/profile.component.html @@ -184,6 +184,13 @@ [model]="form.preferences?.showInSearch" (click)="form.preferences.showInSearch = !form.preferences.showInSearch">
+ +
+
+
+ +
+
diff --git a/src/app/core/components/help/help.component.html b/src/app/core/components/help/help.component.html index 419d41747..f3e2a017f 100644 --- a/src/app/core/components/help/help.component.html +++ b/src/app/core/components/help/help.component.html @@ -20,6 +20,7 @@
+
@@ -38,6 +39,7 @@
+
@@ -84,6 +86,11 @@
+ +
diff --git a/src/app/core/components/help/help.component.scss b/src/app/core/components/help/help.component.scss index 3b58b9c01..a14f037ec 100644 --- a/src/app/core/components/help/help.component.scss +++ b/src/app/core/components/help/help.component.scss @@ -133,6 +133,8 @@ border-radius: 4px; background: var(--color-surfaces); box-shadow: 0 0 8px 0 #727c84; + overflow-y: auto; + overflow-x: hidden; @include mixins.mobile { width: 100%; @@ -188,9 +190,19 @@ } } + .links_content { + padding: 16px; + border-radius: 4px; + background: var(--color-background); + margin-top: 16px; + + .links_content_title { + margin-bottom: 16px; + } + } + .help_content { width: 400px; - height: 100vh; @include mixins.mobile { width: 100%; diff --git a/src/assets/config/default.json b/src/assets/config/default.json index b15add427..fcc035d22 100644 --- a/src/assets/config/default.json +++ b/src/assets/config/default.json @@ -35,6 +35,7 @@ "legal": { "termsOfUse": "https://citizenos.com/legal/api/", "privacyPolicy": "https://citizenos.com/legal/privacy/", + "statut": "https://citizenos.com/legal/statute/", "version": "1" }, "attachments": { diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index a47352079..e5d1d3e63 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -1727,6 +1727,7 @@ "PRIVACY_POLICY_DESCRIPTION_NEW_USER": "Thanks for creating an account! Before you continue, please take a moment to read and accept our Terms of Use and Privacy Policy", "PRIVACY_POLICY_LNK_TERMS_OF_USE": "Terms of use", "PRIVACY_POLICY_LNK_PRIVACY_POLICY": "Privacy Policy", + "PRIVACY_POLICY_LNK_ARTICLES_OF_ASSOCIATION": "Articles of Association", "PRIVACY_POLICY_BTN_REJECT": "Reject", "PRIVACY_POLICY_BTN_ACCEPT": "Accept", "USER_DELETE_CONFIRM_HEADING": "Delete account", @@ -1982,6 +1983,8 @@ "TAB_ACCOUNT": "Account", "LBL_SHOW_IN_SEARCH": "Show my username in search results", "LBL_SHOW_IN_SEARCH_DESCRIPTION": "Display my username in invite search results so that other people can easily invite me to groups and topics", + "LBL_LINKS_TITLE": "Links", + "LBL_LINKS_DESCRIPTION": "If necessary, you can consult our legal documentation.", "LBL_DELETE_ACCOUNT": "Delete your account", "LBL_DELETE_ACCOUNT_DESCRIPTION": "When deleting your account all your contributions will stay visible in Citizen OS, but they will not be linked to your account anymore.", "LBL_PROFILE_LANGUAEG": "Set your profile language", From 5b6a29727734ffe95a74bb3639a85859d312ccc6 Mon Sep 17 00:00:00 2001 From: Viktar Maslouski Date: Wed, 22 Jan 2025 22:22:24 +0100 Subject: [PATCH 12/15] update handleActivityRedirect --- src/app/services/activity.service.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/services/activity.service.ts b/src/app/services/activity.service.ts index 037cb2214..f64b29980 100644 --- a/src/app/services/activity.service.ts +++ b/src/app/services/activity.service.ts @@ -694,6 +694,10 @@ export class ActivityService extends ItemsListService { state = state.concat(['topics', origin.id]); } + if ((object && (object['@type'] === 'Idea' || object['@type'] === 'IdeaVote'))) { + state = state.concat(['topics', object.topicId]); + } + /** * @note Assume that the first item is always present and is lang param. * No action needed in this case. From bc1530ece5cb0644ce3967db9f3d6f6632cc838c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ilmar=20T=C3=BCrk?= Date: Wed, 15 Jan 2025 23:12:42 +0200 Subject: [PATCH 13/15] WIP add new setting to ideation --- .../ideation-create.component.html | 39 +++++++++++ .../ideation-create.component.ts | 68 ++----------------- src/app/interfaces/ideation.ts | 3 +- 3 files changed, 48 insertions(+), 62 deletions(-) diff --git a/src/app/ideation/components/ideation-create/ideation-create.component.html b/src/app/ideation/components/ideation-create/ideation-create.component.html index 73c4740ca..9679e6189 100644 --- a/src/app/ideation/components/ideation-create/ideation-create.component.html +++ b/src/app/ideation/components/ideation-create/ideation-create.component.html @@ -983,6 +983,45 @@
+
+
+
3
+
+
+
+
+
3
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+ +
+ +
+
+
+
+
diff --git a/src/app/ideation/components/ideation-create/ideation-create.component.ts b/src/app/ideation/components/ideation-create/ideation-create.component.ts index 7b4ebf669..521456e70 100644 --- a/src/app/ideation/components/ideation-create/ideation-create.component.ts +++ b/src/app/ideation/components/ideation-create/ideation-create.component.ts @@ -78,6 +78,7 @@ export class IdeationCreateComponent extends TopicFormComponent implements Block creatorId: '', question: '', deadline: null, + disableReplies: false, createdAt: '', updatedAt: '' }; @@ -246,21 +247,14 @@ export class IdeationCreateComponent extends TopicFormComponent implements Block } } const tabIndex = this.tabs.indexOf(tab); - if (tabIndex === 2) { - /* if (this.voteCreateForm) - this.voteCreateForm.saveVoteSettings();*/ - } if (tabIndex === 2) { if (!this.ideation.question) { this.Notification.removeAll(); this.Notification.addError('VIEWS.IDEATION_CREATE.ERROR_MISSING_QUESTION'); return; } - /* if (this.voteCreateForm) - this.voteCreateForm.saveVoteSettings();*/ } if (tabIndex + 1 === 3) { - // this.voteCreateForm?.filterOptions(); setTimeout(() => { this.TopicService.readDescription(this.topic.id).pipe(take(1)).subscribe({ next: (topic) => { @@ -298,7 +292,7 @@ export class IdeationCreateComponent extends TopicFormComponent implements Block override saveAsDraft() { if (this.topic.status === this.TopicService.STATUSES.draft) { - const updateTopic = Object.assign({}, this.topic); + const updateTopic = { ...this.topic }; if (!updateTopic.intro?.length) { updateTopic.intro = null; } @@ -336,7 +330,7 @@ export class IdeationCreateComponent extends TopicFormComponent implements Block override publish() { this.titleInput?.nativeElement?.parentNode.parentNode.classList.remove('error'); const isDraft = (this.topic.status === this.TopicService.STATUSES.draft); - const updateTopic = Object.assign({}, this.topic); + const updateTopic = { ...this.topic }; if (!updateTopic.intro?.length) { updateTopic.intro = null; } @@ -385,47 +379,6 @@ export class IdeationCreateComponent extends TopicFormComponent implements Block }); } - /*override publish() { - this.titleInput?.nativeElement?.parentNode.parentNode.classList.remove('error'); - const isDraft = (this.topic.status === this.TopicService.STATUSES.draft); - const updateTopic = Object.assign({}, this.topic); - if (!updateTopic.intro?.length) { - updateTopic.intro = null; - } - - this.TopicService.patch(updateTopic).pipe(take(1)).subscribe({ - next: () => { - if (!this.ideation.id) { - this.createIdeation(true); - } else if ([this.TopicService.STATUSES.draft, this.TopicService.STATUSES.ideation].indexOf(this.topic.status) > -1) { - this.updateIdeation(true); - } - - this.topicGroups.forEach((group) => { - this.saveMemberGroup(group) - }); - this.saveImage() - .subscribe({ - next: (res: any) => { - if (res && !res.link) return; - if (res.link) { - this.topic.imageUrl = res.link; - } - this.hasChanges$.next(false); - this.router.navigate(['/', this.translate.currentLang, 'topics', this.topic.id]); - this.TopicService.reloadTopic(); - }, - error: (err) => { - console.log('publish error', err) - } - }); - }, - error: (err: any) => { - console.log('ERROR', err); - } - }); - }*/ - saveIdeationSettings(ideation?: any) { if (ideation) { this.ideation = ideation; @@ -433,7 +386,7 @@ export class IdeationCreateComponent extends TopicFormComponent implements Block } createIdeation(updateTopicStatus?: boolean) { - const createIdeation: any = Object.assign({ topicId: this.topic.id }, this.ideation); + const createIdeation: any = { topicId: this.topic.id , ...this.ideation }; if (!this.deadlineSelect) { createIdeation.deadline = null; } @@ -441,11 +394,10 @@ export class IdeationCreateComponent extends TopicFormComponent implements Block .pipe(take(1)) .subscribe({ next: (ideation) => { - // this.TopicService.reloadTopic(); this.ideation = ideation; if (updateTopicStatus) { const isDraft = (this.topic.status === this.TopicService.STATUSES.draft); - const updateTopic = Object.assign({}, this.topic); + const updateTopic = { ...this.topic }; updateTopic.status = this.TopicService.STATUSES.ideation; this.TopicService.patch(updateTopic).pipe(take(1)).subscribe({ next: (res) => { @@ -479,7 +431,7 @@ export class IdeationCreateComponent extends TopicFormComponent implements Block updateIdeation(updateTopicStatus?: boolean) { - const updateIdeation = Object.assign({ topicId: this.topic.id }, this.ideation); + const updateIdeation = { topicId: this.topic.id, ...this.ideation }; if (!this.deadlineSelect) { updateIdeation.deadline = null; } @@ -535,16 +487,10 @@ export class IdeationCreateComponent extends TopicFormComponent implements Block this.deadline.setMinutes(this.endsAt.min); this.ideation.deadline = this.deadline; this.daysToVoteEnd(); - - // this.setReminderOptions(); }; override isNextDisabled(tabSelected: string | void) { - if (tabSelected === 'preview' && !this.TopicService.canDelete(this.topic)) { - return true; - } else if (!this.topic.title || !this.topic.description) { - return true; - } else if (tabSelected === 'ideation_system' && !this.ideation.question) { + if ((tabSelected === 'preview' && !this.TopicService.canDelete(this.topic)) || !this.topic.title || !this.topic.description || (tabSelected === 'ideation_system' && !this.ideation.question)) { return true; } diff --git a/src/app/interfaces/ideation.ts b/src/app/interfaces/ideation.ts index 66784e406..2e78fab97 100644 --- a/src/app/interfaces/ideation.ts +++ b/src/app/interfaces/ideation.ts @@ -18,6 +18,7 @@ export interface Ideation { updatedAt: Date, ideas: { count: number - } + }, + disableReplies: boolean } From 4c4a3ab958006558a79c263ee3e0846c07e85ad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ilmar=20T=C3=BCrk?= Date: Sun, 19 Jan 2025 16:48:38 +0200 Subject: [PATCH 14/15] Update ideation settings to have disableReplies --- src/app/directives/cos-disabled.directive.ts | 2 +- .../idea/idea-dialog.component.html | 10 ++++- .../idea/idea-dialog.component.scss | 1 + .../components/idea/idea.component.ts | 43 ++++++++++--------- .../components/ideabox/ideabox.component.ts | 10 ++--- .../ideation-create.component.html | 24 +++-------- .../ideation-create.component.scss | 9 ++++ .../cos-toggle/cos-toggle.component.ts | 1 + .../components/tooltip/tooltip.component.ts | 22 +++------- src/assets/i18n/en.json | 5 +++ 10 files changed, 67 insertions(+), 60 deletions(-) diff --git a/src/app/directives/cos-disabled.directive.ts b/src/app/directives/cos-disabled.directive.ts index 844d9f8a8..e46ee8bb2 100644 --- a/src/app/directives/cos-disabled.directive.ts +++ b/src/app/directives/cos-disabled.directive.ts @@ -5,7 +5,7 @@ import { Directive, Input, ElementRef, SimpleChanges } from '@angular/core'; }) export class CosDisabledDirective { @Input() cosDisabled!: any; - constructor(private ElementRef: ElementRef) { + constructor(private readonly ElementRef: ElementRef) { } ngAfterViewInit(): void { diff --git a/src/app/ideation/components/idea/idea-dialog.component.html b/src/app/ideation/components/idea/idea-dialog.component.html index 22ab13223..84dd1611b 100644 --- a/src/app/ideation/components/idea/idea-dialog.component.html +++ b/src/app/ideation/components/idea/idea-dialog.component.html @@ -382,6 +382,9 @@
+
+
+
- + +
diff --git a/src/app/ideation/components/idea/idea-dialog.component.scss b/src/app/ideation/components/idea/idea-dialog.component.scss index 40d354bbc..f8a157bd9 100644 --- a/src/app/ideation/components/idea/idea-dialog.component.scss +++ b/src/app/ideation/components/idea/idea-dialog.component.scss @@ -337,6 +337,7 @@ .buttons_wrap { display: flex; gap: 16px; + position: relative; .btn_ghost_reply_idea { display: flex; diff --git a/src/app/ideation/components/idea/idea.component.ts b/src/app/ideation/components/idea/idea.component.ts index 6ddcc939c..ce3e2a8fe 100644 --- a/src/app/ideation/components/idea/idea.component.ts +++ b/src/app/ideation/components/idea/idea.component.ts @@ -15,6 +15,7 @@ import { TopicService } from '@services/topic.service'; import { Folder } from 'src/app/interfaces/folder'; import { DomSanitizer } from '@angular/platform-browser'; import { IdeaReplyComponent } from '../idea-reply/idea-reply.component'; +import { TopicIdeationService } from '@services/topic-ideation.service'; @Component({ selector: 'app-idea', @@ -24,32 +25,34 @@ export class IdeaComponent { ideaId: string = ''; topicId: string = ''; ideationId: string = ''; - constructor(dialog: DialogService, route: ActivatedRoute, TopicIdeaService: TopicIdeaService, router: Router, TopicService: TopicService) { + constructor(dialog: DialogService, route: ActivatedRoute, TopicIdeaService: TopicIdeaService, router: Router, TopicService: TopicService, TopicIdeationService: TopicIdeationService) { route.params.pipe(take(1), switchMap((params) => { this.ideaId = params['ideaId']; this.topicId = params['topicId']; this.ideationId = params['ideationId']; - return TopicIdeaService.get({ ideaId: this.ideaId, ideationId: this.ideationId, topicId: this.topicId }) - })).subscribe((idea) => { - TopicService.get(this.topicId).pipe(take(1)).subscribe((topic) => { - dialog.closeAll(); - const ideaDialog = dialog.open(IdeaDialogComponent, { - data: { - idea, - topic, - ideation: { id: this.ideationId }, - route: route - } - }); + return combineLatest([ + TopicIdeaService.get({ ideaId: this.ideaId, ideationId: this.ideationId, topicId: this.topicId }), + TopicService.get(this.topicId), + TopicIdeationService.get({ topicId: this.topicId, ideationId: this.ideationId }) + ]) + })).subscribe(([idea, topic, ideation]) => { + dialog.closeAll(); + const ideaDialog = dialog.open(IdeaDialogComponent, { + data: { + idea, + topic, + ideation, + route: route + } + }); - ideaDialog.afterClosed().subscribe((value) => { - if (value) { - TopicIdeaService.reload(); - router.navigate(['/', 'topics', this.topicId], { fragment: 'ideation' }) - } - }); - }) + ideaDialog.afterClosed().subscribe((value) => { + if (value) { + TopicIdeaService.reload(); + router.navigate(['/', 'topics', this.topicId], { fragment: 'ideation' }) + } + }); }); } } diff --git a/src/app/ideation/components/ideabox/ideabox.component.ts b/src/app/ideation/components/ideabox/ideabox.component.ts index c74138e72..d97dec9a4 100644 --- a/src/app/ideation/components/ideabox/ideabox.component.ts +++ b/src/app/ideation/components/ideabox/ideabox.component.ts @@ -3,17 +3,17 @@ import { AfterViewInit, Component, Input } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { Router } from '@angular/router'; import { take } from 'rxjs'; -import { Idea } from 'src/app/interfaces/idea'; +import { Idea } from '@interfaces/idea'; import { AuthService } from '@services/auth.service'; import { ConfigService } from '@services/config.service'; import { TopicIdeaService } from '@services/topic-idea.service'; -import { ConfirmDialogComponent } from 'src/app/shared/components/confirm-dialog/confirm-dialog.component'; -import { DialogService } from 'src/app/shared/dialog'; +import { ConfirmDialogComponent } from '@shared/components/confirm-dialog/confirm-dialog.component'; +import { DialogService } from '@shared/dialog'; import { IdeaReportComponent } from '../idea-report/idea-report.component'; import { AddIdeaFolderComponent } from '../add-idea-folder/add-idea-folder.component'; import { IdeaReportReasonComponent } from '../idea-report-reason/idea-report-reason.component'; -import { Topic } from 'src/app/interfaces/topic'; -import { Ideation } from 'src/app/interfaces/ideation'; +import { Topic } from '@interfaces/topic'; +import { Ideation } from '@interfaces/ideation'; import { IdeaReactionsComponent } from '../idea-reactions/idea-reactions.component'; import { TopicMemberUserService } from '@services/topic-member-user.service'; diff --git a/src/app/ideation/components/ideation-create/ideation-create.component.html b/src/app/ideation/components/ideation-create/ideation-create.component.html index 9679e6189..bb855fe5b 100644 --- a/src/app/ideation/components/ideation-create/ideation-create.component.html +++ b/src/app/ideation/components/ideation-create/ideation-create.component.html @@ -999,24 +999,14 @@
-
-
-
- +
+
+
+ +
-
-
- -
- +
+
diff --git a/src/app/ideation/components/ideation-create/ideation-create.component.scss b/src/app/ideation/components/ideation-create/ideation-create.component.scss index e8d66faf5..ec8dd650f 100644 --- a/src/app/ideation/components/ideation-create/ideation-create.component.scss +++ b/src/app/ideation/components/ideation-create/ideation-create.component.scss @@ -392,10 +392,19 @@ .radio_wrap { padding: 16px; border-radius: 8px; + width: 100%; + .radio_text_wrap { + width: 100%; + } &.selected { background-color: var(--color-dialog-ideation); } + .setting_toggle { + width: 100%; + align-items: center; + justify-content: space-between; + } } .date_selector { diff --git a/src/app/shared/components/cos-toggle/cos-toggle.component.ts b/src/app/shared/components/cos-toggle/cos-toggle.component.ts index ba69aafad..889ca3406 100644 --- a/src/app/shared/components/cos-toggle/cos-toggle.component.ts +++ b/src/app/shared/components/cos-toggle/cos-toggle.component.ts @@ -31,6 +31,7 @@ export class CosToggleComponent implements OnInit { } else { this.model = !this.model; } + console.log('CHANGE', this.model); this.modelChange.emit(this.model); }; diff --git a/src/app/shared/components/tooltip/tooltip.component.ts b/src/app/shared/components/tooltip/tooltip.component.ts index 8f2c3c059..4725fc301 100644 --- a/src/app/shared/components/tooltip/tooltip.component.ts +++ b/src/app/shared/components/tooltip/tooltip.component.ts @@ -5,23 +5,16 @@ import { Component, ElementRef, HostListener, ViewChild, Input, OnDestroy, Rende templateUrl: './tooltip.component.html', styleUrls: ['./tooltip.component.scss'] }) -export class TooltipComponent implements OnDestroy { +export class TooltipComponent { @Input() delay? = 190; // Optional delay input, in ms @Input() noIcon? = false; @ViewChild('tooltTipIcon') toolTipIcon!: ElementRef; @ViewChild('tipContainer') tipContainer!: ElementRef; @ViewChild('arrow') arrow!: ElementRef; - private timer: any; + private readonly timer: any; public visible = false; @Input() pos? = 'bottom'; - constructor(private el: ElementRef, private renderer: Renderer2) { - } - - ngAfterViewInit(): void { - } - - ngOnDestroy(): void { - + constructor(private readonly el: ElementRef, private readonly renderer: Renderer2) { } @HostListener('mouseenter') onMouseEnter() { @@ -48,11 +41,11 @@ export class TooltipComponent implements OnDestroy { } let left = containerPosition.right - window.innerWidth + 32; - const tipIconContainer = this.toolTipIcon.nativeElement.getBoundingClientRect(); - const arrowContainer = this.arrow.nativeElement.getBoundingClientRect(); + let tipIconContainer; + let arrowContainer; setTimeout(() => { - const tipIconContainer = this.toolTipIcon.nativeElement.getBoundingClientRect(); - const arrowContainer = this.arrow?.nativeElement.getBoundingClientRect(); + tipIconContainer = this.toolTipIcon.nativeElement.getBoundingClientRect(); + arrowContainer = this.arrow?.nativeElement.getBoundingClientRect(); if (tipIconContainer.left - arrowContainer.left > tipIconContainer.width / 2) this.renderer.setStyle(this.arrow.nativeElement, 'left', `${(tipIconContainer.left - arrowContainer.left + tipIconContainer.width / 2)}px`) }) @@ -83,6 +76,5 @@ export class TooltipComponent implements OnDestroy { } //this.renderer.setStyle(this.tipContainer.nativeElement, 'left', `${left}px`); } - console.log(left) } } diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index e5d1d3e63..0e8ba1a19 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -462,6 +462,7 @@ "NOTIFICATION_LNK_VIEW": "View anyway" }, "IDEA_DIALOG": { + "TOOLTIP_REPLIES_DISABLED": "Replies are turned off", "BTN_REPLY": "@:COMPONENTS.ARGUMENT.BTN_REPLY", "OPTION_EDIT": "@:COMPONENTS.IDEABOX.OPTION_EDIT", "OPTION_FAVOURITE": "@:VIEWS.TOPICS_TOPICID.OPTION_FAVOURITE", @@ -2299,6 +2300,10 @@ "DEADLINE_TIME_OPTION_PM": "@:COMPONENTS.EDIT_IDEATION_DEADLINE.DEADLINE_TIME_OPTION_PM", "DEADLINE_LBL_TIMEZONE": "@:COMPONENTS.EDIT_IDEATION_DEADLINE.DEADLINE_LBL_TIMEZONE", "SETTINGS_IDEATION_DEADLINE_PLACEHOLDER": "Select a date", + "SETTINGS_HEADING_ADVANCED_SETTINGS": "Advanced settings", + "SETTINGS_HEADING_ADVANCED_SETTINGS_DESC": "Further options to customise the idea gathering phase.", + "LBL_DISABLE_REPLIES": "Replies are turned: {{value}}", + "LBL_DISABLE_REPLIES_DESC": "Disable replies to ideas", "PREVIEW_INFO": "This is a preview of your topic! You can still edit your topic at any point prior to starting a vote.", "BTN_IDEATION_ACTIONS": "Manage idea gathering", "NO_IDEAS_HEADING": "There are no ideas yet", From faddd658a6a2d4ccc94fc840b109b6d895cb14f6 Mon Sep 17 00:00:00 2001 From: Viktar Maslouski Date: Tue, 4 Feb 2025 16:12:38 +0100 Subject: [PATCH 15/15] update group indicators --- src/app/group/group.component.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/group/group.component.html b/src/app/group/group.component.html index a79d4a865..c1825b187 100644 --- a/src/app/group/group.component.html +++ b/src/app/group/group.component.html @@ -353,7 +353,7 @@
{{group.members.topics.count.inProgress || 0}}
- +
{{group.members.topics.count.ideation || 0}}
+