From 7029368ab1fc7f4ebbddcaca3d7140f4441d2873 Mon Sep 17 00:00:00 2001 From: seraph Date: Fri, 1 May 2020 19:10:17 +0200 Subject: [PATCH] upgrade archi with modules --- .storybook/main.js | 4 - .storybook/tsconfig.json | 20 - .storybook/typings.d.ts | 4 - README.md | 43 +- angular.json | 3 +- backend-api-endpoints-doc.md | 44 - backend-api-endpoints-doc.txt | 46 + e2e/tsconfig.json | 18 +- package.json | 30 +- src/app/app-routing.module.ts | 52 +- src/app/app.component.html | 47 +- src/app/app.component.scss | 13 - src/app/app.component.ts | 52 +- src/app/app.module.ts | 79 +- .../components/footer/footer.component.html | 10 +- .../components/header/header.component.html | 74 + .../header.component.scss} | 0 .../header.component.spec.ts} | 12 +- .../components/header/header.component.ts | 16 + .../core/components/home/home.component.html | 19 + .../components}/home/home.component.scss | 0 .../components}/home/home.component.spec.ts | 0 .../core/components/home/home.component.ts | 12 + .../components/login/login.component.html | 1 + .../login.component.scss} | 0 .../components/login/login.component.spec.ts} | 12 +- .../core/components/login/login.component.ts | 12 + .../core/components/logo/logo.component.html | 2 +- .../components/navbar/navbar.component.html | 1 - .../components/navbar/navbar.component.ts | 12 - .../page-not-found.component.html | 3 - .../language-selector.component.html | 0 .../language-selector.component.scss | 0 .../language-selector.component.spec.ts | 0 .../language-selector.component.ts | 4 +- .../theme-selector.component.html | 0 .../theme-selector.component.scss} | 0 .../theme-selector.component.spec.ts | 0 .../theme-selector.component.ts | 4 +- .../navigation/navigation.component.html | 23 + .../navigation/navigation.component.scss} | 0 .../navigation/navigation.component.spec.ts | 0 .../navigation/navigation.component.ts | 18 + src/app/core/core.module.ts | 25 +- src/app/core/enums/message-severity.enum.ts | 6 + src/app/core/enums/poll-type.enum.ts | 4 - src/app/core/enums/user-role.enum.ts | 5 + src/app/core/enums/workflow-step.enum.ts | 5 + src/app/core/models/poll.model.ts | 16 +- src/app/core/models/user.model.ts | 2 + src/app/core/services/api.service.ts | 109 +- .../message-displayer.service.spec.ts | 16 + .../services/message-displayer.service.ts | 19 + src/app/core/services/mocking.service.spec.ts | 16 + src/app/core/services/mocking.service.ts | 37 + src/app/core/services/poll.service.ts | 39 +- src/app/core/services/theme.service.ts | 2 +- src/app/core/services/user.service.ts | 20 +- .../core/services/workflow.service.spec.ts | 16 + src/app/core/services/workflow.service.ts | 30 + src/app/core/utils/poll-utils.service.ts | 2 +- .../administration-routing.module.ts | 27 +- .../administration.component.html | 13 +- .../administration.component.ts | 4 + .../administration/administration.module.ts | 25 +- .../edit-configuration.component.html | 1 + .../edit-configuration.component.scss} | 0 .../edit-configuration.component.spec.ts | 24 + .../edit-configuration.component.ts | 12 + .../edit-description.component.html | 33 + .../edit-description.component.scss} | 0 .../edit-description.component.spec.ts | 24 + .../edit-description.component.ts | 41 + .../edit-options/edit-options.component.html | 1 + .../edit-options/edit-options.component.scss} | 0 .../edit-options.component.spec.ts | 24 + .../edit-options/edit-options.component.ts | 12 + .../poll-edit/poll-edit.component.html | 33 + .../poll-edit/poll-edit.component.scss} | 0 .../poll-edit/poll-edit.component.spec.ts | 24 + .../poll-edit/poll-edit.component.ts | 41 + .../profile/profile.component.html | 59 + .../profile/profile.component.scss} | 0 .../profile/profile.component.spec.ts | 24 + .../profile/profile.component.ts | 24 + .../stepper/stepper.component.html | 1 + .../stepper/stepper.component.scss} | 0 .../stepper/stepper.component.spec.ts | 24 + .../stepper/stepper.component.ts | 51 + .../old-stuff}/config/DateUtilities.ts | 0 .../old-stuff}/config/PollConfig.ts | 6 +- .../old-stuff}/config/PollUtilities.ts | 0 .../old-stuff}/config/defaultConfigs.ts | 0 .../date-value-accessor.metadata.json | 0 .../date-value-accessor.ts | 0 .../date-value-accessor/index.metadata.json | 0 .../custom-lib/date-value-accessor/index.ts | 0 .../date-value-accessor/module.metadata.json | 0 .../custom-lib/date-value-accessor/module.ts | 0 .../old-stuff/old-stuff-routing.module.ts | 46 + .../features/old-stuff/old-stuff.module.ts | 74 + .../pages/admin/admin.component.html | 0 .../pages/admin/admin.component.scss | 0 .../pages/admin/admin.component.spec.ts | 0 .../old-stuff}/pages/admin/admin.component.ts | 4 +- .../pages/answers/answers.component.html | 4 +- .../pages/answers/answers.component.scss} | 0 .../pages/answers/answers.component.spec.ts | 0 .../pages/answers/answers.component.ts | 2 +- .../create-or-retrieve.component.html | 2 +- .../create-or-retrieve.component.scss | 0 .../create-or-retrieve.component.spec.ts | 0 .../create-or-retrieve.component.ts | 2 +- .../pages/dates/dates.component.html | 4 +- .../pages/dates/dates.component.scss | 0 .../pages/dates/dates.component.spec.ts | 0 .../old-stuff}/pages/dates/dates.component.ts | 2 +- .../end-confirmation.component.html | 0 .../end-confirmation.component.scss | 0 .../end-confirmation.component.spec.ts | 0 .../end-confirmation.component.ts | 2 +- .../example/base-page/base.component.html | 2 +- .../example/base-page/base.component.scss} | 0 .../example/base-page/base.component.spec.ts | 0 .../pages/example/base-page/base.component.ts | 0 .../pages/example/kind/kind.component.html | 10 +- .../pages/example/kind/kind.component.scss | 0 .../pages/example/kind/kind.component.spec.ts | 0 .../pages/example/kind/kind.component.ts | 2 +- .../example/pictures/pictures.component.html | 2 +- .../example/pictures/pictures.component.scss} | 0 .../pictures/pictures.component.spec.ts | 0 .../example/pictures/pictures.component.ts | 2 +- .../old-stuff}/pages/home/home.component.html | 6 +- .../old-stuff/pages/home/home.component.scss} | 0 .../pages/home/home.component.spec.ts | 24 + .../old-stuff}/pages/home/home.component.ts | 2 +- .../pages/password/password.component.html | 0 .../pages/password/password.component.scss | 0 .../pages/password/password.component.spec.ts | 0 .../pages/password/password.component.ts | 2 +- .../poll-display/poll-display.component.html | 0 .../poll-display/poll-display.component.scss | 1 + .../poll-display.component.spec.ts | 0 .../poll-display/poll-display.component.ts | 8 +- .../poll-graphic/poll-graphic.component.html | 0 .../poll-graphic/poll-graphic.component.scss | 0 .../poll-graphic.component.spec.ts | 0 .../poll-graphic/poll-graphic.component.ts | 4 +- .../pages/resume/resume.component.html | 10 +- .../pages/resume/resume.component.scss | 0 .../pages/resume/resume.component.spec.ts | 0 .../pages/resume/resume.component.ts | 0 .../visibility/visibility.component.html | 6 +- .../visibility/visibility.component.scss | 0 .../visibility/visibility.component.spec.ts | 0 .../pages/visibility/visibility.component.ts | 2 +- .../choices-list/choices-list.component.html | 0 .../choices-list/choices-list.component.scss} | 0 .../choices-list.component.spec.ts | 0 .../choices-list/choices-list.component.ts | 0 .../comments-list.component.html | 0 .../comments-list.component.scss} | 0 .../comments-list.component.spec.ts | 0 .../comments-list/comments-list.component.ts | 0 .../voting-choice.component.html | 0 .../voting-choice.component.scss | 2 +- .../voting-choice.component.spec.ts | 4 +- .../voting-choice/voting-choice.component.ts | 0 .../voting-comment.component.html | 0 .../voting-comment.component.scss | 0 .../voting-comment.component.spec.ts | 0 .../voting-comment.component.ts | 4 +- .../voting-graph/voting-graph.component.html | 0 .../voting-graph/voting-graph.component.scss | 0 .../voting-graph.component.spec.ts | 0 .../voting-graph/voting-graph.component.ts | 2 +- .../voting-navigation.component.html | 8 +- .../voting-navigation.component.scss | 0 .../voting-navigation.component.spec.ts | 0 .../voting-navigation.component.ts | 0 .../voting-summary.component.html | 0 .../voting-summary.component.scss | 2 +- .../voting-summary.component.spec.ts | 0 .../voting-summary.component.ts | 2 +- .../pages/voting/voting.component.html | 0 .../pages/voting/voting.component.scss | 0 .../pages/voting/voting.component.spec.ts | 0 .../pages/voting/voting.component.ts | 2 +- .../old-stuff}/services/config.service.ts | 16 +- .../services/progression.service.spec.ts | 0 .../ui/copy-text/copy-text.component.html | 8 +- .../ui/copy-text/copy-text.component.scss | 0 .../ui/copy-text/copy-text.component.spec.ts | 0 .../ui/copy-text/copy-text.component.ts | 12 +- .../resettable-input.directive.spec.ts | 0 .../directives/resettable-input.directive.ts | 0 .../erasable-input.component.html | 0 .../erasable-input.component.scss | 0 .../erasable-input.component.spec.ts | 0 .../erasable-input.component.ts | 2 +- .../ui}/two-links/two-links.component.html | 0 .../ui/two-links/two-links.component.scss | 0 .../ui}/two-links/two-links.component.spec.ts | 0 .../ui}/two-links/two-links.component.ts | 0 .../participation-routing.module.ts | 11 +- .../participation.component.html | 9 +- .../participation/participation.module.ts | 3 +- .../participation/poll/poll.component.html | 12 + .../participation/poll/poll.component.scss | 0 .../participation/poll/poll.component.spec.ts | 24 + .../participation/poll/poll.component.ts | 34 + .../poll-administration.module.ts | 8 - .../poll-display/poll-display.component.scss | 1 - .../poll-participation.module.ts | 8 - .../page-not-found.component.html | 9 + .../page-not-found.component.scss | 0 .../page-not-found.component.spec.ts | 0 .../page-not-found.component.ts | 7 +- .../poll-page/poll-page.component.html | 1 + .../poll-page/poll-page.component.scss | 0 .../poll-page/poll-page.component.spec.ts | 24 + .../poll-page/poll-page.component.ts | 12 + src/app/shared/shared.module.ts | 46 +- src/app/ui/debugger/debugger.component.html | 30 - src/app/ui/debugger/debugger.component.ts | 28 - .../ui/navigation/navigation.component.html | 44 - .../ui/navigation/navigation.component.scss | 1 - src/app/ui/navigation/navigation.component.ts | 30 - .../theme-selector.component.scss | 4 - src/assets/css/bootstrap-reboot-4.3.1.css | 346 -- src/assets/i18n/EN.json | 4 + src/assets/i18n/FR.json | 4 + src/environments/environment.prod.ts | 50 + src/environments/environment.ts | 38 +- src/index.html | 4 - src/jest.setup.ts | 25 + src/stories/0-Welcome.stories.ts | 15 - src/stories/1-Button.stories.ts | 52 - src/styles.scss | 6 +- tsconfig.spec.json | 2 +- yarn.lock | 5348 +++++------------ 242 files changed, 3128 insertions(+), 4988 deletions(-) delete mode 100644 .storybook/main.js delete mode 100644 .storybook/tsconfig.json delete mode 100644 .storybook/typings.d.ts delete mode 100644 backend-api-endpoints-doc.md create mode 100644 backend-api-endpoints-doc.txt create mode 100644 src/app/core/components/header/header.component.html rename src/app/core/components/{navbar/navbar.component.scss => header/header.component.scss} (100%) rename src/app/core/components/{navbar/navbar.component.spec.ts => header/header.component.spec.ts} (56%) create mode 100644 src/app/core/components/header/header.component.ts create mode 100644 src/app/core/components/home/home.component.html rename src/app/{pages => core/components}/home/home.component.scss (100%) rename src/app/{pages => core/components}/home/home.component.spec.ts (100%) create mode 100644 src/app/core/components/home/home.component.ts create mode 100644 src/app/core/components/login/login.component.html rename src/app/core/components/{page-not-found/page-not-found.component.scss => login/login.component.scss} (100%) rename src/app/{ui/debugger/debugger.component.spec.ts => core/components/login/login.component.spec.ts} (54%) create mode 100644 src/app/core/components/login/login.component.ts delete mode 100644 src/app/core/components/navbar/navbar.component.html delete mode 100644 src/app/core/components/navbar/navbar.component.ts delete mode 100644 src/app/core/components/page-not-found/page-not-found.component.html rename src/app/{ui => core/components}/selectors/language-selector/language-selector.component.html (100%) rename src/app/{ui => core/components}/selectors/language-selector/language-selector.component.scss (100%) rename src/app/{ui => core/components}/selectors/language-selector/language-selector.component.spec.ts (100%) rename src/app/{ui => core/components}/selectors/language-selector/language-selector.component.ts (89%) rename src/app/{ui => core/components}/selectors/theme-selector/theme-selector.component.html (100%) rename src/app/{pages/answers/answers.component.scss => core/components/selectors/theme-selector/theme-selector.component.scss} (100%) rename src/app/{ui => core/components}/selectors/theme-selector/theme-selector.component.spec.ts (100%) rename src/app/{ui => core/components}/selectors/theme-selector/theme-selector.component.ts (82%) create mode 100644 src/app/core/components/sibebar/navigation/navigation.component.html rename src/app/{pages/example/base-page/base.component.scss => core/components/sibebar/navigation/navigation.component.scss} (100%) rename src/app/{ui => core/components/sibebar}/navigation/navigation.component.spec.ts (100%) create mode 100644 src/app/core/components/sibebar/navigation/navigation.component.ts create mode 100644 src/app/core/enums/message-severity.enum.ts delete mode 100644 src/app/core/enums/poll-type.enum.ts create mode 100644 src/app/core/enums/user-role.enum.ts create mode 100644 src/app/core/enums/workflow-step.enum.ts create mode 100644 src/app/core/services/message-displayer.service.spec.ts create mode 100644 src/app/core/services/message-displayer.service.ts create mode 100644 src/app/core/services/mocking.service.spec.ts create mode 100644 src/app/core/services/mocking.service.ts create mode 100644 src/app/core/services/workflow.service.spec.ts create mode 100644 src/app/core/services/workflow.service.ts create mode 100644 src/app/features/administration/edit-configuration/edit-configuration.component.html rename src/app/{pages/example/pictures/pictures.component.scss => features/administration/edit-configuration/edit-configuration.component.scss} (100%) create mode 100644 src/app/features/administration/edit-configuration/edit-configuration.component.spec.ts create mode 100644 src/app/features/administration/edit-configuration/edit-configuration.component.ts create mode 100644 src/app/features/administration/edit-description/edit-description.component.html rename src/app/{pages/voting/choices-list/choices-list.component.scss => features/administration/edit-description/edit-description.component.scss} (100%) create mode 100644 src/app/features/administration/edit-description/edit-description.component.spec.ts create mode 100644 src/app/features/administration/edit-description/edit-description.component.ts create mode 100644 src/app/features/administration/edit-options/edit-options.component.html rename src/app/{pages/voting/comments-list/comments-list.component.scss => features/administration/edit-options/edit-options.component.scss} (100%) create mode 100644 src/app/features/administration/edit-options/edit-options.component.spec.ts create mode 100644 src/app/features/administration/edit-options/edit-options.component.ts create mode 100644 src/app/features/administration/poll-edit/poll-edit.component.html rename src/app/{pages/voting/voting-comment/voting-comment.component.scss => features/administration/poll-edit/poll-edit.component.scss} (100%) create mode 100644 src/app/features/administration/poll-edit/poll-edit.component.spec.ts create mode 100644 src/app/features/administration/poll-edit/poll-edit.component.ts create mode 100644 src/app/features/administration/profile/profile.component.html rename src/app/{pages/voting/voting-graph/voting-graph.component.scss => features/administration/profile/profile.component.scss} (100%) create mode 100644 src/app/features/administration/profile/profile.component.spec.ts create mode 100644 src/app/features/administration/profile/profile.component.ts create mode 100644 src/app/features/administration/stepper/stepper.component.html rename src/app/{pages/voting/voting-navigation/voting-navigation.component.scss => features/administration/stepper/stepper.component.scss} (100%) create mode 100644 src/app/features/administration/stepper/stepper.component.spec.ts create mode 100644 src/app/features/administration/stepper/stepper.component.ts rename src/app/{ => features/old-stuff}/config/DateUtilities.ts (100%) rename src/app/{ => features/old-stuff}/config/PollConfig.ts (94%) rename src/app/{ => features/old-stuff}/config/PollUtilities.ts (100%) rename src/app/{ => features/old-stuff}/config/defaultConfigs.ts (100%) rename src/app/{ => features/old-stuff}/custom-lib/date-value-accessor/date-value-accessor.metadata.json (100%) rename src/app/{ => features/old-stuff}/custom-lib/date-value-accessor/date-value-accessor.ts (100%) rename src/app/{ => features/old-stuff}/custom-lib/date-value-accessor/index.metadata.json (100%) rename src/app/{ => features/old-stuff}/custom-lib/date-value-accessor/index.ts (100%) rename src/app/{ => features/old-stuff}/custom-lib/date-value-accessor/module.metadata.json (100%) rename src/app/{ => features/old-stuff}/custom-lib/date-value-accessor/module.ts (100%) create mode 100644 src/app/features/old-stuff/old-stuff-routing.module.ts create mode 100644 src/app/features/old-stuff/old-stuff.module.ts rename src/app/{ => features/old-stuff}/pages/admin/admin.component.html (100%) rename src/app/{ => features/old-stuff}/pages/admin/admin.component.scss (100%) rename src/app/{ => features/old-stuff}/pages/admin/admin.component.spec.ts (100%) rename src/app/{ => features/old-stuff}/pages/admin/admin.component.ts (95%) rename src/app/{ => features/old-stuff}/pages/answers/answers.component.html (96%) rename src/app/{pages/voting/voting.component.scss => features/old-stuff/pages/answers/answers.component.scss} (100%) rename src/app/{ => features/old-stuff}/pages/answers/answers.component.spec.ts (100%) rename src/app/{ => features/old-stuff}/pages/answers/answers.component.ts (99%) rename src/app/{ => features/old-stuff}/pages/create-or-retrieve/create-or-retrieve.component.html (95%) rename src/app/{ => features/old-stuff}/pages/create-or-retrieve/create-or-retrieve.component.scss (100%) rename src/app/{ => features/old-stuff}/pages/create-or-retrieve/create-or-retrieve.component.spec.ts (100%) rename src/app/{ => features/old-stuff}/pages/create-or-retrieve/create-or-retrieve.component.ts (97%) rename src/app/{ => features/old-stuff}/pages/dates/dates.component.html (97%) rename src/app/{ => features/old-stuff}/pages/dates/dates.component.scss (100%) rename src/app/{ => features/old-stuff}/pages/dates/dates.component.spec.ts (100%) rename src/app/{ => features/old-stuff}/pages/dates/dates.component.ts (99%) rename src/app/{ => features/old-stuff}/pages/end-confirmation/end-confirmation.component.html (100%) rename src/app/{ => features/old-stuff}/pages/end-confirmation/end-confirmation.component.scss (100%) rename src/app/{ => features/old-stuff}/pages/end-confirmation/end-confirmation.component.spec.ts (100%) rename src/app/{ => features/old-stuff}/pages/end-confirmation/end-confirmation.component.ts (97%) rename src/app/{ => features/old-stuff}/pages/example/base-page/base.component.html (57%) rename src/app/{services/progression.service.spec.ts => features/old-stuff/pages/example/base-page/base.component.scss} (100%) rename src/app/{ => features/old-stuff}/pages/example/base-page/base.component.spec.ts (100%) rename src/app/{ => features/old-stuff}/pages/example/base-page/base.component.ts (100%) rename src/app/{ => features/old-stuff}/pages/example/kind/kind.component.html (94%) rename src/app/{ => features/old-stuff}/pages/example/kind/kind.component.scss (100%) rename src/app/{ => features/old-stuff}/pages/example/kind/kind.component.spec.ts (100%) rename src/app/{ => features/old-stuff}/pages/example/kind/kind.component.ts (95%) rename src/app/{ => features/old-stuff}/pages/example/pictures/pictures.component.html (51%) rename src/app/{ui/copy-text/copy-text.component.scss => features/old-stuff/pages/example/pictures/pictures.component.scss} (100%) rename src/app/{ => features/old-stuff}/pages/example/pictures/pictures.component.spec.ts (100%) rename src/app/{ => features/old-stuff}/pages/example/pictures/pictures.component.ts (95%) rename src/app/{ => features/old-stuff}/pages/home/home.component.html (88%) rename src/app/{ui/debugger/debugger.component.scss => features/old-stuff/pages/home/home.component.scss} (100%) create mode 100644 src/app/features/old-stuff/pages/home/home.component.spec.ts rename src/app/{ => features/old-stuff}/pages/home/home.component.ts (95%) rename src/app/{ => features/old-stuff}/pages/password/password.component.html (100%) rename src/app/{ => features/old-stuff}/pages/password/password.component.scss (100%) rename src/app/{ => features/old-stuff}/pages/password/password.component.spec.ts (100%) rename src/app/{ => features/old-stuff}/pages/password/password.component.ts (95%) rename src/app/{ => features/old-stuff}/pages/poll/poll-display/poll-display.component.html (100%) create mode 100644 src/app/features/old-stuff/pages/poll/poll-display/poll-display.component.scss rename src/app/{ => features/old-stuff}/pages/poll/poll-display/poll-display.component.spec.ts (100%) rename src/app/{ => features/old-stuff}/pages/poll/poll-display/poll-display.component.ts (89%) rename src/app/{ => features/old-stuff}/pages/poll/poll-graphic/poll-graphic.component.html (100%) rename src/app/{ => features/old-stuff}/pages/poll/poll-graphic/poll-graphic.component.scss (100%) rename src/app/{ => features/old-stuff}/pages/poll/poll-graphic/poll-graphic.component.spec.ts (100%) rename src/app/{ => features/old-stuff}/pages/poll/poll-graphic/poll-graphic.component.ts (95%) rename src/app/{ => features/old-stuff}/pages/resume/resume.component.html (87%) rename src/app/{ => features/old-stuff}/pages/resume/resume.component.scss (100%) rename src/app/{ => features/old-stuff}/pages/resume/resume.component.spec.ts (100%) rename src/app/{ => features/old-stuff}/pages/resume/resume.component.ts (100%) rename src/app/{ => features/old-stuff}/pages/visibility/visibility.component.html (96%) rename src/app/{ => features/old-stuff}/pages/visibility/visibility.component.scss (100%) rename src/app/{ => features/old-stuff}/pages/visibility/visibility.component.spec.ts (100%) rename src/app/{ => features/old-stuff}/pages/visibility/visibility.component.ts (93%) rename src/app/{ => features/old-stuff}/pages/voting/choices-list/choices-list.component.html (100%) rename src/app/{ui/erasable-input/erasable-input.component.scss => features/old-stuff/pages/voting/choices-list/choices-list.component.scss} (100%) rename src/app/{ => features/old-stuff}/pages/voting/choices-list/choices-list.component.spec.ts (100%) rename src/app/{ => features/old-stuff}/pages/voting/choices-list/choices-list.component.ts (100%) rename src/app/{ => features/old-stuff}/pages/voting/comments-list/comments-list.component.html (100%) rename src/app/{ui/navigation/two-links/two-links.component.scss => features/old-stuff/pages/voting/comments-list/comments-list.component.scss} (100%) rename src/app/{ => features/old-stuff}/pages/voting/comments-list/comments-list.component.spec.ts (100%) rename src/app/{ => features/old-stuff}/pages/voting/comments-list/comments-list.component.ts (100%) rename src/app/{ => features/old-stuff}/pages/voting/voting-choice/voting-choice.component.html (100%) rename src/app/{ => features/old-stuff}/pages/voting/voting-choice/voting-choice.component.scss (99%) rename src/app/{ => features/old-stuff}/pages/voting/voting-choice/voting-choice.component.spec.ts (95%) rename src/app/{ => features/old-stuff}/pages/voting/voting-choice/voting-choice.component.ts (100%) rename src/app/{ => features/old-stuff}/pages/voting/voting-comment/voting-comment.component.html (100%) create mode 100644 src/app/features/old-stuff/pages/voting/voting-comment/voting-comment.component.scss rename src/app/{ => features/old-stuff}/pages/voting/voting-comment/voting-comment.component.spec.ts (100%) rename src/app/{ => features/old-stuff}/pages/voting/voting-comment/voting-comment.component.ts (78%) rename src/app/{ => features/old-stuff}/pages/voting/voting-graph/voting-graph.component.html (100%) create mode 100644 src/app/features/old-stuff/pages/voting/voting-graph/voting-graph.component.scss rename src/app/{ => features/old-stuff}/pages/voting/voting-graph/voting-graph.component.spec.ts (100%) rename src/app/{ => features/old-stuff}/pages/voting/voting-graph/voting-graph.component.ts (95%) rename src/app/{ => features/old-stuff}/pages/voting/voting-navigation/voting-navigation.component.html (84%) create mode 100644 src/app/features/old-stuff/pages/voting/voting-navigation/voting-navigation.component.scss rename src/app/{ => features/old-stuff}/pages/voting/voting-navigation/voting-navigation.component.spec.ts (100%) rename src/app/{ => features/old-stuff}/pages/voting/voting-navigation/voting-navigation.component.ts (100%) rename src/app/{ => features/old-stuff}/pages/voting/voting-summary/voting-summary.component.html (100%) rename src/app/{ => features/old-stuff}/pages/voting/voting-summary/voting-summary.component.scss (84%) rename src/app/{ => features/old-stuff}/pages/voting/voting-summary/voting-summary.component.spec.ts (100%) rename src/app/{ => features/old-stuff}/pages/voting/voting-summary/voting-summary.component.ts (95%) rename src/app/{ => features/old-stuff}/pages/voting/voting.component.html (100%) create mode 100644 src/app/features/old-stuff/pages/voting/voting.component.scss rename src/app/{ => features/old-stuff}/pages/voting/voting.component.spec.ts (100%) rename src/app/{ => features/old-stuff}/pages/voting/voting.component.ts (92%) rename src/app/{ => features/old-stuff}/services/config.service.ts (98%) create mode 100644 src/app/features/old-stuff/services/progression.service.spec.ts rename src/app/{ => features/old-stuff}/ui/copy-text/copy-text.component.html (51%) create mode 100644 src/app/features/old-stuff/ui/copy-text/copy-text.component.scss rename src/app/{ => features/old-stuff}/ui/copy-text/copy-text.component.spec.ts (100%) rename src/app/{ => features/old-stuff}/ui/copy-text/copy-text.component.ts (55%) rename src/app/{ => features/old-stuff}/ui/directives/resettable-input.directive.spec.ts (100%) rename src/app/{ => features/old-stuff}/ui/directives/resettable-input.directive.ts (100%) rename src/app/{ => features/old-stuff}/ui/erasable-input/erasable-input.component.html (100%) create mode 100644 src/app/features/old-stuff/ui/erasable-input/erasable-input.component.scss rename src/app/{ => features/old-stuff}/ui/erasable-input/erasable-input.component.spec.ts (100%) rename src/app/{ => features/old-stuff}/ui/erasable-input/erasable-input.component.ts (95%) rename src/app/{ui/navigation => features/old-stuff/ui}/two-links/two-links.component.html (100%) create mode 100644 src/app/features/old-stuff/ui/two-links/two-links.component.scss rename src/app/{ui/navigation => features/old-stuff/ui}/two-links/two-links.component.spec.ts (100%) rename src/app/{ui/navigation => features/old-stuff/ui}/two-links/two-links.component.ts (100%) create mode 100644 src/app/features/participation/poll/poll.component.html create mode 100644 src/app/features/participation/poll/poll.component.scss create mode 100644 src/app/features/participation/poll/poll.component.spec.ts create mode 100644 src/app/features/participation/poll/poll.component.ts delete mode 100644 src/app/pages/poll/poll-administration/poll-administration.module.ts delete mode 100644 src/app/pages/poll/poll-display/poll-display.component.scss delete mode 100644 src/app/pages/poll/poll-participation/poll-participation.module.ts create mode 100644 src/app/shared/components/page-not-found/page-not-found.component.html create mode 100644 src/app/shared/components/page-not-found/page-not-found.component.scss rename src/app/{core => shared}/components/page-not-found/page-not-found.component.spec.ts (100%) rename src/app/{core => shared}/components/page-not-found/page-not-found.component.ts (50%) create mode 100644 src/app/shared/components/poll-page/poll-page.component.html create mode 100644 src/app/shared/components/poll-page/poll-page.component.scss create mode 100644 src/app/shared/components/poll-page/poll-page.component.spec.ts create mode 100644 src/app/shared/components/poll-page/poll-page.component.ts delete mode 100644 src/app/ui/debugger/debugger.component.html delete mode 100644 src/app/ui/debugger/debugger.component.ts delete mode 100644 src/app/ui/navigation/navigation.component.html delete mode 100644 src/app/ui/navigation/navigation.component.scss delete mode 100644 src/app/ui/navigation/navigation.component.ts delete mode 100644 src/app/ui/selectors/theme-selector/theme-selector.component.scss delete mode 100644 src/assets/css/bootstrap-reboot-4.3.1.css delete mode 100644 src/stories/0-Welcome.stories.ts delete mode 100644 src/stories/1-Button.stories.ts diff --git a/.storybook/main.js b/.storybook/main.js deleted file mode 100644 index ec3f5802..00000000 --- a/.storybook/main.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - stories: ['../src/**/*.stories.ts'], - addons: ['@storybook/addon-actions', '@storybook/addon-links', '@storybook/addon-notes'], -}; diff --git a/.storybook/tsconfig.json b/.storybook/tsconfig.json deleted file mode 100644 index 0bcfc758..00000000 --- a/.storybook/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "../tsconfig.app.json", - "compilerOptions": { - "types": [ - "node" - ] - }, - "exclude": [ - "../src/test.ts", - "../src/**/*.spec.ts", - "../projects/**/*.spec.ts" - ], - "include": [ - "../src/**/*", - "../projects/**/*" - ], - "files": [ - "./typings.d.ts" - ] -} diff --git a/.storybook/typings.d.ts b/.storybook/typings.d.ts deleted file mode 100644 index f73d61b3..00000000 --- a/.storybook/typings.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare module '*.md' { - const content: string; - export default content; -} diff --git a/README.md b/README.md index ed18df21..bc181dae 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,26 @@ ## LIBRARIES USED -| lib name | usage | -| ------------------------------------------------------------------ | -------------------------------------- | -| [axios](https://github.com/axios/axios) | http client | -| [bulma](https://bulma.io/) | CSS framework | -| [chart.js](https://www.chartjs.org/) | Generate beautiful graphs | -| [compodoc](https://compodoc.app/) | Generate technic documentation | -| [date-fns](https://date-fns.org) | manipulate dates | -| ESlint, Prettier, Lint-staged | Format & lint code | -| [font-awesome](https://github.com/FortAwesome/angular-fontawesome) | Icons collection | -| [fullcalendar](https://fullcalendar.io/docs/initialize-es6) | Manage & display calendars | -| [husky](https://www.npmjs.com/package/husky) | Hook actions on commit | -| [jest](https://jestjs.io/) | test engine | -| [locale-enum](https://www.npmjs.com/package/locale-enum) | enum of all locales | -| [ngx-clipboard](https://www.npmjs.com/package/ngx-clipboard) | Handle clipboard | -| [ngx-markdown](https://www.npmjs.com/package/ngx-markdown) | markdown parser | -| [ngx-toaster](https://www.npmjs.com/package/ngx-toaster) | toast notifications | -| [ngx-webstorage](https://www.npmjs.com/package/ngx-webstorage) | handle localStorage & webStorage | -| [primeNG](https://www.primefaces.org/primeng/) | UI components collection | -| [quill](https://www.npmjs.com/package/quill) | powerful rich text editor. WYSIWYG. | -| [storybook](https://storybook.js.org/) | StyleGuide UI | -| [ts-mockito](https://www.npmjs.com/package/ts-mockito) | Mocks for testing. | -| [uuid](https://www.npmjs.com/package/uuid) | handle client-side generation of uuids | +| status | lib name | usage | +| ------- | -------------------------------------------------------------- | -------------------------------------- | +| | [axios](https://github.com/axios/axios) | http client | +| | [bulma](https://bulma.io/) | CSS framework | +| | [chart.js](https://www.chartjs.org/) | Display graphs. (Commes with MomentJS) | +| | [compodoc](https://compodoc.app/) | Generate technic documentation | +| | [date-fns](https://date-fns.org) | manipulate dates | +| | ESlint, Prettier, Lint-staged | Format & lint code | +| | [fork-awesome](https://forkaweso.me) | Icons collection | +| | [fullcalendar](https://fullcalendar.io/docs/initialize-es6) | Manage & display calendars | +| | [husky](https://www.npmjs.com/package/husky) | Hook actions on commit | +| | [jest](https://jestjs.io/) | test engine | +| removed | [locale-enum](https://www.npmjs.com/package/locale-enum) | enum of all locales | +| | [ngx-clipboard](https://www.npmjs.com/package/ngx-clipboard) | Handle clipboard | +| | [ngx-markdown](https://www.npmjs.com/package/ngx-markdown) | markdown parser | +| | [ngx-webstorage](https://www.npmjs.com/package/ngx-webstorage) | handle localStorage & webStorage | +| | [primeNG](https://www.primefaces.org/primeng/) | UI components collection | +| | [quill](https://www.npmjs.com/package/quill) | powerful rich text editor. WYSIWYG. | +| removed | [storybook](https://storybook.js.org/) | StyleGuide UI | +| | [ts-mockito](https://www.npmjs.com/package/ts-mockito) | Mocks for testing. | +| | [uuid](https://www.npmjs.com/package/uuid) | handle client-side generation of uuids | --- diff --git a/angular.json b/angular.json index f9451678..57ef5b25 100644 --- a/angular.json +++ b/angular.json @@ -22,7 +22,6 @@ "main": "src/main.ts", "polyfills": "src/polyfills.ts", "tsConfig": "tsconfig.app.json", - "aot": true, "assets": ["src/favicon.ico", "src/assets"], "styles": [ "node_modules/fork-awesome/css/fork-awesome.min.css", @@ -50,9 +49,11 @@ "sourceMap": false, "extractCss": true, "namedChunks": false, + "aot": true, "extractLicenses": true, "vendorChunk": false, "buildOptimizer": true, + "crossOrigin": "anonymous", "budgets": [ { "type": "initial", diff --git a/backend-api-endpoints-doc.md b/backend-api-endpoints-doc.md deleted file mode 100644 index 63e99b0c..00000000 --- a/backend-api-endpoints-doc.md +++ /dev/null @@ -1,44 +0,0 @@ -// TODO: File to be deleted : just temporary documentation of backend API endpoints - -/** - * - * -------------------------- -------- -------- ------ ------------------------------------------------ - Name Method Scheme Host Path - -------------------------- -------- -------- ------ ------------------------------------------------ - _twig_error_test ANY ANY ANY /_error/{code}.{_format} - api_get_poll_comment GET ANY ANY /poll/{id}/comments - api_new_comment POST ANY ANY /poll/{id}/comment - api_poll_comments_delete DELETE ANY ANY /poll/{id}/comments - api_send_user_polls GET ANY ANY /send-polls-to-user/{email} - homepageget_default GET ANY ANY / - api_get_all_polls GET ANY ANY /poll/ - api_get_poll GET ANY ANY /poll/{id} - api_update_poll PUT ANY ANY /poll/{id}/{token} - api_new_poll POST ANY ANY /poll/ - api_test-mail-poll GET ANY ANY /poll/mail/test-mail-poll/{emailChoice} - api_poll_delete DELETE ANY ANY /poll/{id} - api_clean_expired_polls GET ANY ANY /poll/clean-polls - api_check_slug_is_unique GET ANY ANY /poll/admin/{token} - api_new_vote_stack POST ANY ANY /poll/{id}/vote - api_update_vote_stack PATCH ANY ANY /vote-stack/{id}/token/{modifierToken} - api_poll_votes_delete DELETE ANY ANY /poll/{id}/votes/{accessToken} - app.swagger GET ANY ANY /doc.json - -------------------------- -------- -------- ------ ------------------------------------------------ - */ - -/** - * WANTED CHANGES (seraf) - * -------------------------- -------- -------- ------ ------------------------------------------------ - Name Method Scheme Host Path - -------------------------- -------- -------- ------ ------------------------------------------------ - api_get_poll_comment GET ANY ANY /poll/{id}/comment - api_delete_poll_comments DELETE ANY ANY /poll/{id}/comment - api_user_polls_send_by_email GET ANY ANY /user/{email}/polls/send-by-email - api_get_user_polls GET ANY ANY /user/{email}/polls - api_get_poll_slug GET ANY ANY /poll/slug/{id}/{token} - api_clean_expired_polls GET ANY ANY /admin/clean-polls/{token} - - api_test-mail-poll GET ANY ANY /poll/mail/test-mail-poll/{emailChoice} - api_update_vote_stack PATCH ANY ANY /vote-stack/{id}/token/{modifierToken} - -------------------------- -------- -------- ------ ------------------------------------------------ - */ diff --git a/backend-api-endpoints-doc.txt b/backend-api-endpoints-doc.txt new file mode 100644 index 00000000..a134d711 --- /dev/null +++ b/backend-api-endpoints-doc.txt @@ -0,0 +1,46 @@ +// TODO: File to be deleted : just temporary documentation of backend API endpoints + +/** + * + * -------------------------- -------- -------- ------ ------------------------------------------------ + Name Method Scheme Host Path + -------------------------- -------- -------- ------ ------------------------------------------------ +_twig_error_test ANY ANY ANY /_error/{code}.{_format} +admin_homepage_get_default GET ANY ANY /admin/ +admin_homepage_clean_expired_polls GET ANY ANY /admin/polls/clean/{token} +api_get_poll_comment GET ANY ANY /polls/{id}/comments +api_new_comment POST ANY ANY /polls/{id}/comments +api_poll_comments_delete DELETE ANY ANY /polls/{id}/comments +user_homepageget_default GET ANY ANY /users/ +user_homepage_polls_send_by_email GET ANY ANY /users/{email}/polls/send-by-email +api_get_all_polls GET ANY ANY /polls/ +api_get_poll GET ANY ANY /polls/{id} +api_update_poll PUT ANY ANY /polls/{id}/{token} +api_new_poll POST ANY ANY /polls/ +api_test-mail-polls GET ANY ANY /polls/mail/test-mail-polls/{emailChoice} +api_poll_delete DELETE ANY ANY /polls/{id} +api_check_slug_is_unique GET ANY ANY /polls/slugs/{slug} +api_get_admin_config GET ANY ANY /polls/admin/{token} +api_new_vote_stack POST ANY ANY /polls/{id}/votes +api_update_vote_stack PATCH ANY ANY /votes-stacks/{id}/token/{modifierToken} +api_poll_votes_delete DELETE ANY ANY /polls/{id}/votes/{accessToken} +app.swagger GET ANY ANY /api/doc.json + -------------------------- -------- -------- ------ ------------------------------------------------ + */ + +/** + * WANTED CHANGES (seraf) + * -------------------------- -------- -------- ------ ------------------------------------------------ + Name Method Scheme Host Path + -------------------------- -------- -------- ------ ------------------------------------------------ + api_get_poll_comment GET ANY ANY /polls/{id}/comment + api_delete_poll_comments DELETE ANY ANY /polls/{id}/comment + api_user_polls_send_by_email GET ANY ANY /users/{email}/polls/send-by-email + api_get_user_polls GET ANY ANY /users/{email}/polls + api_get_poll_slug GET ANY ANY /polls/slug/{id}/{token} + api_clean_expired_polls GET ANY ANY /admin/clean-polls/{token} + + api_test-mail-polls GET ANY ANY /polls/mail/test-mail-polls/{emailChoice} + api_update_vote_stack PATCH ANY ANY /votes-stack/{id}/token/{modifierToken} + -------------------------- -------- -------- ------ ------------------------------------------------ + */ diff --git a/e2e/tsconfig.json b/e2e/tsconfig.json index 39b800f7..ce6ba906 100644 --- a/e2e/tsconfig.json +++ b/e2e/tsconfig.json @@ -1,13 +1,9 @@ { - "extends": "../tsconfig.json", - "compilerOptions": { - "outDir": "../out-tsc/e2e", - "module": "commonjs", - "target": "es5", - "types": [ - "jasmine", - "jasminewd2", - "node" - ] - } + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "../out-tsc/e2e", + "module": "commonjs", + "target": "es5", + "types": ["jasmine", "jasminewd2", "node"] + } } diff --git a/package.json b/package.json index f71a5d2c..0a841ba6 100644 --- a/package.json +++ b/package.json @@ -5,11 +5,8 @@ "scripts": { "ng": "ng", "start": "ng serve", - "compodoc": "compodoc -p tsconfig.json", - "build": "ng build --crossOrigin=anonymous --prod", - "package": "cat dist/framadate/*.js > dist/framadate/framadate-scripts-bundled.js && ls -l dist/framadate", - "bld:pkg": "npm run build && npm run package", - "build:demo": "ng build --crossOrigin=anonymous --extractCss=true --progress=true --prod && npm run package", + "build": "ng build --prod --progress=true", + "build-prod-stats": "ng build --prod --stats-json", "test": "jest", "test:watch": "jest --watch", "test:ci": "jest --runInBand", @@ -18,13 +15,12 @@ "format:check": "prettier --list-different \"src/{app,environments,assets}/**/*{.ts,.js,.json,.css,.scss}\"", "format:all": "prettier --write \"src/**/*.{js,jsx,ts,tsx,md,html,css,scss}\"", "trans": "ng xi18n --output-path=src/locale --i18n-locale=fr", - "storybook": "start-storybook -p 6006", - "build-storybook": "build-storybook" + "compodoc": "compodoc -p tsconfig.app.json" }, "private": false, "dependencies": { "@angular/animations": "^9.1.1", - "@angular/cdk": "^9.2.0", + "@angular/cdk": "^9.2.2", "@angular/common": "^9.0.7", "@angular/compiler": "^9.0.7", "@angular/core": "^9.0.7", @@ -39,13 +35,11 @@ "angular-date-value-accessor": "^1.0.2", "axios": "^0.19.2", "bulma": "^0.8.2", - "chart.js": "^2.8.0", + "chart.js": "^2.9.3", "date-fns": "^2.12.0", "fork-awesome": "^1.1.7", - "locale-enum": "^1.1.0", "ngx-clipboard": "^13.0.0", "ngx-markdown": "^9.0.0", - "ngx-toaster": "^1.0.1", "ngx-webstorage": "^5.0.0", "primeicons": "^2.0.0", "primeng": "^9.0.6", @@ -53,7 +47,7 @@ "rxjs": "^6.5.5", "rxjs-compat": "^6.5.5", "tslib": "^1.11.1", - "uuid": "^7.0.3", + "uuid": "^8.0.0", "zone.js": "^0.10.3" }, "devDependencies": { @@ -64,25 +58,19 @@ "@angular/language-service": "^9.0.7", "@babel/core": "^7.9.0", "@babel/preset-env": "^7.9.5", - "@storybook/addon-actions": "^5.3.18", - "@storybook/addon-links": "^5.3.18", - "@storybook/addon-notes": "^5.3.18", - "@storybook/addons": "^5.3.18", - "@storybook/angular": "^5.3.18", + "@babel/preset-typescript": "^7.9.0", + "@compodoc/compodoc": "^1.1.11", "@types/jest": "^25.2.1", "@types/node": "^13.13.2", "@types/uuid": "^7.0.2", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "babel-jest": "^25.4.0", - "babel-loader": "^8.1.0", - "babel-polyfill": "^6.26.0", - "compodoc": "^0.0.41", "eslint": "^6.8.0", "eslint-config-prettier": "^6.11.0", "eslint-plugin-prettier": "^3.1.3", "husky": "^4.2.5", - "jest": "^25.4.0", + "jest": "^25.5.1", "jest-environment-jsdom-sixteen": "^1.0.3", "jest-preset-angular": "^8.1.3", "lint-staged": "^10.1.7", diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 917948fe..93f2c91c 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,45 +1,13 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; -import { PageNotFoundComponent } from './core/components/page-not-found/page-not-found.component'; -import { AdminComponent } from './pages/admin/admin.component'; -import { AnswersComponent } from './pages/answers/answers.component'; -import { CreateOrRetrieveComponent } from './pages/create-or-retrieve/create-or-retrieve.component'; -import { DatesComponent } from './pages/dates/dates.component'; -import { EndConfirmationComponent } from './pages/end-confirmation/end-confirmation.component'; -import { BaseComponent } from './pages/example/base-page/base.component'; -import { KindComponent } from './pages/example/kind/kind.component'; -import { PicturesComponent } from './pages/example/pictures/pictures.component'; -import { HomeComponent } from './pages/home/home.component'; -import { PasswordComponent } from './pages/password/password.component'; -import { PollDisplayComponent } from './pages/poll/poll-display/poll-display.component'; -import { PollGraphicComponent } from './pages/poll/poll-graphic/poll-graphic.component'; -import { ResumeComponent } from './pages/resume/resume.component'; -import { VisibilityComponent } from './pages/visibility/visibility.component'; -import { VotingChoiceComponent } from './pages/voting/voting-choice/voting-choice.component'; -import { VotingComponent } from './pages/voting/voting.component'; +import { HomeComponent } from './core/components/home/home.component'; +import { LoginComponent } from './core/components/login/login.component'; +import { PageNotFoundComponent } from './shared/components/page-not-found/page-not-found.component'; const routes: Routes = [ - { path: '', redirectTo: 'step/creation', pathMatch: 'full' }, - { path: 'admin/:token', component: AdminComponent }, // http://localhost:4200/#/admin/srfdgedsTGETHRYJtujTUjTUkTIUKTK - { path: 'home', component: HomeComponent }, - { path: 'base', component: BaseComponent }, - { path: 'step/base', component: BaseComponent }, - { path: 'step/creation', component: CreateOrRetrieveComponent }, - { path: 'step/date', component: DatesComponent }, - { path: 'step/kind', component: KindComponent }, - { path: 'step/answers', component: AnswersComponent }, - { path: 'step/admin', component: AdminComponent }, - { path: 'step/pictures', component: PicturesComponent }, - { path: 'step/visibility', component: VisibilityComponent }, - { path: 'step/resume', component: ResumeComponent }, - { path: 'step/end', component: EndConfirmationComponent }, - { path: 'graphic/:poll', component: PollGraphicComponent }, - { path: 'vote/poll/id/:poll', component: PollDisplayComponent }, - { path: 'vote/poll/slug/:pollSlug', component: PollDisplayComponent }, - { path: 'votingchoice', component: VotingChoiceComponent }, - { path: 'voting', component: VotingComponent }, - { path: 'step/password', component: PasswordComponent }, + { path: '', component: HomeComponent }, + { path: 'login', component: LoginComponent }, { path: 'administration', loadChildren: () => @@ -49,11 +17,19 @@ const routes: Routes = [ path: 'participation', loadChildren: () => import('./features/participation/participation.module').then((m) => m.ParticipationModule), }, + { + path: 'oldstuff', + loadChildren: () => import('./features/old-stuff/old-stuff.module').then((m) => m.OldStuffModule), + }, { path: '**', component: PageNotFoundComponent }, ]; @NgModule({ - imports: [RouterModule.forRoot(routes, { useHash: true, anchorScrolling: 'enabled' })], + imports: [ + RouterModule.forRoot(routes, { + // enableTracing: true, // <-- debugging purposes only + }), + ], exports: [RouterModule], }) export class AppRoutingModule {} diff --git a/src/app/app.component.html b/src/app/app.component.html index 30173eef..5fe0ccca 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,42 +1,15 @@
-
-
-
-
- menu icon -
- Menu -
-
- -
-
- -
-
- -
-
-
-
+
-
-
-
- - -
-
- -
-
-
+
- + +
+ + + + + + diff --git a/src/app/app.component.scss b/src/app/app.component.scss index 603699f0..e69de29b 100644 --- a/src/app/app.component.scss +++ b/src/app/app.component.scss @@ -1,13 +0,0 @@ -@charset "UTF-8"; - -.big-header { - padding: 0.5rem; -} - -i { - display: block; -} - -.language-selector { - width: auto; -} diff --git a/src/app/app.component.ts b/src/app/app.component.ts index be38d5b2..8cd65e6f 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,14 +1,12 @@ -import { DOCUMENT } from '@angular/common'; -import { Component, Inject, OnInit, OnDestroy } from '@angular/core'; +import { Component, OnDestroy, OnInit } from '@angular/core'; import { Title } from '@angular/platform-browser'; -import { NavigationStart, Router } from '@angular/router'; -import { Observable, Subscription } from 'rxjs'; -import { filter } from 'rxjs/operators'; +import { Subscription } from 'rxjs'; import { environment } from '../environments/environment'; import { Theme } from './core/enums/theme.enum'; +import { UserRole } from './core/enums/user-role.enum'; +import { MockingService } from './core/services/mocking.service'; import { ThemeService } from './core/services/theme.service'; -import { ConfigService } from './services/config.service'; @Component({ selector: 'app-root', @@ -18,24 +16,19 @@ import { ConfigService } from './services/config.service'; export class AppComponent implements OnInit, OnDestroy { public appTitle: string = environment.appTitle; public themeClass: string; - public isDebugMode = false; + public isSidebarOpened = false; private themeSubscription: Subscription; - public step: string; - constructor( private titleService: Title, private themeService: ThemeService, - public config: ConfigService, - @Inject(DOCUMENT) private document, - private router: Router + private mockingService: MockingService ) {} ngOnInit(): void { if (!environment.production) { - this.isDebugMode = true; - this.appTitle += ' | DEV'; - console.info(' ######### framadate | DEV ######### we are NOT in production env, filling with mock values'); + this.appTitle += ' [DEV]'; + this.mockingService.loadUser(UserRole.REGISTERED); } this.titleService.setTitle(this.appTitle); this.themeSubscription = this.themeService.theme.subscribe((theme: Theme) => { @@ -50,8 +43,6 @@ export class AppComponent implements OnInit, OnDestroy { this.themeClass = 'theme-light-watermelon'; } }); - - this.detectCurrentTabOnRouteChange(); } ngOnDestroy(): void { @@ -60,30 +51,7 @@ export class AppComponent implements OnInit, OnDestroy { } } - public detectCurrentTabOnRouteChange(): void { - this.router.events - .pipe(filter((event) => event instanceof NavigationStart)) - .subscribe((event: NavigationStart) => { - this.scrollGoToTop(); - this.updateCurrentTab(event); - // only if there is a poll ID - this.config.fetchPollFromRoute(event); - }); - } - - public scrollGoToTop(): void { - this.document.documentElement.scrollTop = 0; - } - - public updateCurrentTab(event): void { - if (event.url) { - const tab: string[] = event.url.split('/'); - this.step = tab && tab[2] ? tab[2] : 'home'; - } - } - - public toggleMenu(): void { - // TODO: move this logic elsewhere, probably in Navbar component - this.config.menuVisible = !this.config.menuVisible; + public toggleSidebar(status: boolean): void { + this.isSidebarOpened = status === true; } } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index af931889..06a910e4 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -15,48 +15,13 @@ import { TranslateHttpLoader } from '@ngx-translate/http-loader'; import { ClipboardModule } from 'ngx-clipboard'; import { MarkdownModule } from 'ngx-markdown'; import { NgxWebstorageModule } from 'ngx-webstorage'; -import { ConfirmationService, MessageModule, MessageService } from 'primeng'; -import { ConfirmDialogModule } from 'primeng/confirmdialog'; -import { DialogModule } from 'primeng/dialog'; -import { ToastModule } from 'primeng/toast'; import { environment } from '../environments/environment'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { CoreModule } from './core/core.module'; -import { DateValueAccessorModule } from './custom-lib/date-value-accessor'; -import { AdminComponent } from './pages/admin/admin.component'; -import { AnswersComponent } from './pages/answers/answers.component'; -import { CreateOrRetrieveComponent } from './pages/create-or-retrieve/create-or-retrieve.component'; -import { DatesComponent } from './pages/dates/dates.component'; -import { EndConfirmationComponent } from './pages/end-confirmation/end-confirmation.component'; -import { BaseComponent } from './pages/example/base-page/base.component'; -import { KindComponent } from './pages/example/kind/kind.component'; -import { PicturesComponent } from './pages/example/pictures/pictures.component'; -import { HomeComponent } from './pages/home/home.component'; -import { PasswordComponent } from './pages/password/password.component'; -import { PollDisplayComponent } from './pages/poll/poll-display/poll-display.component'; -import { PollGraphicComponent } from './pages/poll/poll-graphic/poll-graphic.component'; -import { ResumeComponent } from './pages/resume/resume.component'; -import { VisibilityComponent } from './pages/visibility/visibility.component'; -import { ChoicesListComponent } from './pages/voting/choices-list/choices-list.component'; -import { CommentsListComponent } from './pages/voting/comments-list/comments-list.component'; -import { VotingChoiceComponent } from './pages/voting/voting-choice/voting-choice.component'; -import { VotingCommentComponent } from './pages/voting/voting-comment/voting-comment.component'; -import { VotingGraphComponent } from './pages/voting/voting-graph/voting-graph.component'; -import { VotingNavigationComponent } from './pages/voting/voting-navigation/voting-navigation.component'; -import { VotingSummaryComponent } from './pages/voting/voting-summary/voting-summary.component'; -import { VotingComponent } from './pages/voting/voting.component'; -import { ConfigService } from './services/config.service'; +import { OldStuffModule } from './features/old-stuff/old-stuff.module'; import { SharedModule } from './shared/shared.module'; -import { CopyTextComponent } from './ui/copy-text/copy-text.component'; -import { DebuggerComponent } from './ui/debugger/debugger.component'; -import { ResettableInputDirective } from './ui/directives/resettable-input.directive'; -import { ErasableInputComponent } from './ui/erasable-input/erasable-input.component'; -import { NavigationComponent } from './ui/navigation/navigation.component'; -import { TwoLinksComponent } from './ui/navigation/two-links/two-links.component'; -import { LanguageSelectorComponent } from './ui/selectors/language-selector/language-selector.component'; -import { ThemeSelectorComponent } from './ui/selectors/theme-selector/theme-selector.component'; export class MyMissingTranslationHandler implements MissingTranslationHandler { public handle(params: MissingTranslationHandlerParams): string { @@ -69,56 +34,19 @@ export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader { } @NgModule({ - declarations: [ - AdminComponent, - AnswersComponent, - AppComponent, - BaseComponent, - ChoicesListComponent, - CommentsListComponent, - CopyTextComponent, - CreateOrRetrieveComponent, - DatesComponent, - DebuggerComponent, - EndConfirmationComponent, - ErasableInputComponent, - HomeComponent, - KindComponent, - NavigationComponent, - PasswordComponent, - PicturesComponent, - PollDisplayComponent, - PollGraphicComponent, - ResettableInputDirective, - ResumeComponent, - ThemeSelectorComponent, - TwoLinksComponent, - VisibilityComponent, - VotingChoiceComponent, - VotingGraphComponent, - VotingComponent, - VotingCommentComponent, - VotingSummaryComponent, - VotingNavigationComponent, - LanguageSelectorComponent, - ], + declarations: [AppComponent], imports: [ AppRoutingModule, BrowserAnimationsModule, BrowserModule, ClipboardModule, CommonModule, - ConfirmDialogModule, CoreModule, - DateValueAccessorModule, - DialogModule, FormsModule, HttpClientModule, MarkdownModule.forRoot(), - MessageModule, NgxWebstorageModule.forRoot({ prefix: environment.localStorage.key }), SharedModule, - ToastModule, TranslateModule.forRoot({ loader: { provide: TranslateLoader, @@ -131,8 +59,9 @@ export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader { }, useDefaultLang: false, }), + OldStuffModule, ], - providers: [ConfigService, ConfirmationService, MessageService, Title, TranslateService], + providers: [Title, TranslateService], bootstrap: [AppComponent], }) export class AppModule {} diff --git a/src/app/core/components/footer/footer.component.html b/src/app/core/components/footer/footer.component.html index 28c0d7d7..46e0b269 100644 --- a/src/app/core/components/footer/footer.component.html +++ b/src/app/core/components/footer/footer.component.html @@ -1 +1,9 @@ -

footer works!

+ diff --git a/src/app/core/components/header/header.component.html b/src/app/core/components/header/header.component.html new file mode 100644 index 00000000..3a3e0b95 --- /dev/null +++ b/src/app/core/components/header/header.component.html @@ -0,0 +1,74 @@ +
+ +
diff --git a/src/app/core/components/navbar/navbar.component.scss b/src/app/core/components/header/header.component.scss similarity index 100% rename from src/app/core/components/navbar/navbar.component.scss rename to src/app/core/components/header/header.component.scss diff --git a/src/app/core/components/navbar/navbar.component.spec.ts b/src/app/core/components/header/header.component.spec.ts similarity index 56% rename from src/app/core/components/navbar/navbar.component.spec.ts rename to src/app/core/components/header/header.component.spec.ts index e5f5deac..9f373039 100644 --- a/src/app/core/components/navbar/navbar.component.spec.ts +++ b/src/app/core/components/header/header.component.spec.ts @@ -1,19 +1,19 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { NavbarComponent } from './navbar.component'; +import { HeaderComponent } from './header.component'; -describe('NavbarComponent', () => { - let component: NavbarComponent; - let fixture: ComponentFixture; +describe('HeaderComponent', () => { + let component: HeaderComponent; + let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [NavbarComponent], + declarations: [HeaderComponent], }).compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(NavbarComponent); + fixture = TestBed.createComponent(HeaderComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/core/components/header/header.component.ts b/src/app/core/components/header/header.component.ts new file mode 100644 index 00000000..245b95a0 --- /dev/null +++ b/src/app/core/components/header/header.component.ts @@ -0,0 +1,16 @@ +import { Component, EventEmitter, Output, Input } from '@angular/core'; + +@Component({ + selector: 'app-header', + templateUrl: './header.component.html', + styleUrls: ['./header.component.scss'], +}) +export class HeaderComponent { + @Input() isSidebarOpened: boolean; + @Output() toggleSidebarEE = new EventEmitter(); + + public toggleSidebarOpening(): void { + this.isSidebarOpened = !this.isSidebarOpened; + this.toggleSidebarEE.emit(this.isSidebarOpened); + } +} diff --git a/src/app/core/components/home/home.component.html b/src/app/core/components/home/home.component.html new file mode 100644 index 00000000..514e3526 --- /dev/null +++ b/src/app/core/components/home/home.component.html @@ -0,0 +1,19 @@ +
+
+
+

+ Bienvenue sur Framasondage +

+

+ Se consulter simplement pour s’organiser collectivement. +

+ +
+
+
diff --git a/src/app/pages/home/home.component.scss b/src/app/core/components/home/home.component.scss similarity index 100% rename from src/app/pages/home/home.component.scss rename to src/app/core/components/home/home.component.scss diff --git a/src/app/pages/home/home.component.spec.ts b/src/app/core/components/home/home.component.spec.ts similarity index 100% rename from src/app/pages/home/home.component.spec.ts rename to src/app/core/components/home/home.component.spec.ts diff --git a/src/app/core/components/home/home.component.ts b/src/app/core/components/home/home.component.ts new file mode 100644 index 00000000..4aeb12a4 --- /dev/null +++ b/src/app/core/components/home/home.component.ts @@ -0,0 +1,12 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-home', + templateUrl: './home.component.html', + styleUrls: ['./home.component.scss'], +}) +export class HomeComponent implements OnInit { + constructor() {} + + ngOnInit(): void {} +} diff --git a/src/app/core/components/login/login.component.html b/src/app/core/components/login/login.component.html new file mode 100644 index 00000000..147cfc4f --- /dev/null +++ b/src/app/core/components/login/login.component.html @@ -0,0 +1 @@ +

login works!

diff --git a/src/app/core/components/page-not-found/page-not-found.component.scss b/src/app/core/components/login/login.component.scss similarity index 100% rename from src/app/core/components/page-not-found/page-not-found.component.scss rename to src/app/core/components/login/login.component.scss diff --git a/src/app/ui/debugger/debugger.component.spec.ts b/src/app/core/components/login/login.component.spec.ts similarity index 54% rename from src/app/ui/debugger/debugger.component.spec.ts rename to src/app/core/components/login/login.component.spec.ts index 16036bd7..486bf2bc 100644 --- a/src/app/ui/debugger/debugger.component.spec.ts +++ b/src/app/core/components/login/login.component.spec.ts @@ -1,19 +1,19 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { DebuggerComponent } from './debugger.component'; +import { LoginComponent } from './login.component'; -describe('DebuggerComponent', () => { - let component: DebuggerComponent; - let fixture: ComponentFixture; +describe('LoginComponent', () => { + let component: LoginComponent; + let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [DebuggerComponent], + declarations: [LoginComponent], }).compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(DebuggerComponent); + fixture = TestBed.createComponent(LoginComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/core/components/login/login.component.ts b/src/app/core/components/login/login.component.ts new file mode 100644 index 00000000..a062274e --- /dev/null +++ b/src/app/core/components/login/login.component.ts @@ -0,0 +1,12 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-login', + templateUrl: './login.component.html', + styleUrls: ['./login.component.scss'], +}) +export class LoginComponent implements OnInit { + constructor() {} + + ngOnInit(): void {} +} diff --git a/src/app/core/components/logo/logo.component.html b/src/app/core/components/logo/logo.component.html index ee9476c9..f8ebc8a3 100644 --- a/src/app/core/components/logo/logo.component.html +++ b/src/app/core/components/logo/logo.component.html @@ -1,5 +1,5 @@ diff --git a/src/app/pages/voting/voting.component.scss b/src/app/features/old-stuff/pages/answers/answers.component.scss similarity index 100% rename from src/app/pages/voting/voting.component.scss rename to src/app/features/old-stuff/pages/answers/answers.component.scss diff --git a/src/app/pages/answers/answers.component.spec.ts b/src/app/features/old-stuff/pages/answers/answers.component.spec.ts similarity index 100% rename from src/app/pages/answers/answers.component.spec.ts rename to src/app/features/old-stuff/pages/answers/answers.component.spec.ts diff --git a/src/app/pages/answers/answers.component.ts b/src/app/features/old-stuff/pages/answers/answers.component.ts similarity index 99% rename from src/app/pages/answers/answers.component.ts rename to src/app/features/old-stuff/pages/answers/answers.component.ts index 8b939f75..b24acece 100644 --- a/src/app/pages/answers/answers.component.ts +++ b/src/app/features/old-stuff/pages/answers/answers.component.ts @@ -22,7 +22,7 @@ export class AnswersComponent extends BaseComponent implements OnInit, AfterView } // todo, manage validation of each page in a common way - ngOnInit() {} + ngOnInit(): void {} ngOnChanges() { this.checkValidAnswers(); diff --git a/src/app/pages/create-or-retrieve/create-or-retrieve.component.html b/src/app/features/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.html similarity index 95% rename from src/app/pages/create-or-retrieve/create-or-retrieve.component.html rename to src/app/features/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.html index 4207bcfc..aa57eb70 100644 --- a/src/app/pages/create-or-retrieve/create-or-retrieve.component.html +++ b/src/app/features/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.html @@ -9,7 +9,7 @@ {{ 'config.description' | translate }}

-
diff --git a/src/app/pages/create-or-retrieve/create-or-retrieve.component.scss b/src/app/features/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.scss similarity index 100% rename from src/app/pages/create-or-retrieve/create-or-retrieve.component.scss rename to src/app/features/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.scss diff --git a/src/app/pages/create-or-retrieve/create-or-retrieve.component.spec.ts b/src/app/features/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.spec.ts similarity index 100% rename from src/app/pages/create-or-retrieve/create-or-retrieve.component.spec.ts rename to src/app/features/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.spec.ts diff --git a/src/app/pages/create-or-retrieve/create-or-retrieve.component.ts b/src/app/features/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.ts similarity index 97% rename from src/app/pages/create-or-retrieve/create-or-retrieve.component.ts rename to src/app/features/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.ts index d1b2ba53..50c3a1a4 100644 --- a/src/app/pages/create-or-retrieve/create-or-retrieve.component.ts +++ b/src/app/features/old-stuff/pages/create-or-retrieve/create-or-retrieve.component.ts @@ -14,7 +14,7 @@ export class CreateOrRetrieveComponent extends BaseComponent implements OnInit { super(config); } - ngOnInit() { + ngOnInit(): void { // if (!environment.production) { // this.findMyPollsByEmail('tktest@tktest.com') // } diff --git a/src/app/pages/dates/dates.component.html b/src/app/features/old-stuff/pages/dates/dates.component.html similarity index 97% rename from src/app/pages/dates/dates.component.html rename to src/app/features/old-stuff/pages/dates/dates.component.html index e970bdf9..4c1253e2 100644 --- a/src/app/pages/dates/dates.component.html +++ b/src/app/features/old-stuff/pages/dates/dates.component.html @@ -160,9 +160,9 @@ - + C'est parfait! - diff --git a/src/app/pages/dates/dates.component.scss b/src/app/features/old-stuff/pages/dates/dates.component.scss similarity index 100% rename from src/app/pages/dates/dates.component.scss rename to src/app/features/old-stuff/pages/dates/dates.component.scss diff --git a/src/app/pages/dates/dates.component.spec.ts b/src/app/features/old-stuff/pages/dates/dates.component.spec.ts similarity index 100% rename from src/app/pages/dates/dates.component.spec.ts rename to src/app/features/old-stuff/pages/dates/dates.component.spec.ts diff --git a/src/app/pages/dates/dates.component.ts b/src/app/features/old-stuff/pages/dates/dates.component.ts similarity index 99% rename from src/app/pages/dates/dates.component.ts rename to src/app/features/old-stuff/pages/dates/dates.component.ts index 4a888794..68fb628f 100644 --- a/src/app/pages/dates/dates.component.ts +++ b/src/app/features/old-stuff/pages/dates/dates.component.ts @@ -38,7 +38,7 @@ export class DatesComponent extends BaseComponent implements OnInit { /** * set the interval options */ - ngOnInit() { + ngOnInit(): void { const dateCurrent = new Date(); const dateJson = dateCurrent.toISOString(); this.startDateInterval = dateJson.substring(0, 10); diff --git a/src/app/pages/end-confirmation/end-confirmation.component.html b/src/app/features/old-stuff/pages/end-confirmation/end-confirmation.component.html similarity index 100% rename from src/app/pages/end-confirmation/end-confirmation.component.html rename to src/app/features/old-stuff/pages/end-confirmation/end-confirmation.component.html diff --git a/src/app/pages/end-confirmation/end-confirmation.component.scss b/src/app/features/old-stuff/pages/end-confirmation/end-confirmation.component.scss similarity index 100% rename from src/app/pages/end-confirmation/end-confirmation.component.scss rename to src/app/features/old-stuff/pages/end-confirmation/end-confirmation.component.scss diff --git a/src/app/pages/end-confirmation/end-confirmation.component.spec.ts b/src/app/features/old-stuff/pages/end-confirmation/end-confirmation.component.spec.ts similarity index 100% rename from src/app/pages/end-confirmation/end-confirmation.component.spec.ts rename to src/app/features/old-stuff/pages/end-confirmation/end-confirmation.component.spec.ts diff --git a/src/app/pages/end-confirmation/end-confirmation.component.ts b/src/app/features/old-stuff/pages/end-confirmation/end-confirmation.component.ts similarity index 97% rename from src/app/pages/end-confirmation/end-confirmation.component.ts rename to src/app/features/old-stuff/pages/end-confirmation/end-confirmation.component.ts index 370cb6a4..c42fa16a 100644 --- a/src/app/pages/end-confirmation/end-confirmation.component.ts +++ b/src/app/features/old-stuff/pages/end-confirmation/end-confirmation.component.ts @@ -17,7 +17,7 @@ export class EndConfirmationComponent extends BaseComponent implements OnInit { this.mailToRecieve = this.config.myEmail; } - ngOnInit() {} + ngOnInit(): void {} copyLink(str: any) { this.messageService.add({ diff --git a/src/app/pages/example/base-page/base.component.html b/src/app/features/old-stuff/pages/example/base-page/base.component.html similarity index 57% rename from src/app/pages/example/base-page/base.component.html rename to src/app/features/old-stuff/pages/example/base-page/base.component.html index 1571aa12..86001560 100644 --- a/src/app/pages/example/base-page/base.component.html +++ b/src/app/features/old-stuff/pages/example/base-page/base.component.html @@ -1,4 +1,4 @@

Ce composant est celui de base pour les pages

- + {{ 'config.perfect' | translate }} diff --git a/src/app/services/progression.service.spec.ts b/src/app/features/old-stuff/pages/example/base-page/base.component.scss similarity index 100% rename from src/app/services/progression.service.spec.ts rename to src/app/features/old-stuff/pages/example/base-page/base.component.scss diff --git a/src/app/pages/example/base-page/base.component.spec.ts b/src/app/features/old-stuff/pages/example/base-page/base.component.spec.ts similarity index 100% rename from src/app/pages/example/base-page/base.component.spec.ts rename to src/app/features/old-stuff/pages/example/base-page/base.component.spec.ts diff --git a/src/app/pages/example/base-page/base.component.ts b/src/app/features/old-stuff/pages/example/base-page/base.component.ts similarity index 100% rename from src/app/pages/example/base-page/base.component.ts rename to src/app/features/old-stuff/pages/example/base-page/base.component.ts diff --git a/src/app/pages/example/kind/kind.component.html b/src/app/features/old-stuff/pages/example/kind/kind.component.html similarity index 94% rename from src/app/pages/example/kind/kind.component.html rename to src/app/features/old-stuff/pages/example/kind/kind.component.html index 35bb97e1..a1dec45c 100644 --- a/src/app/pages/example/kind/kind.component.html +++ b/src/app/features/old-stuff/pages/example/kind/kind.component.html @@ -3,7 +3,7 @@ cette étape est en cours de développement.
S'inspirer de la page de Home pour réaliser d'autres pages

-C'est parfait! +C'est parfait!

Atoms

@@ -17,14 +17,14 @@

Links

- + primary - outline - default @@ -192,7 +192,7 @@

Align right

- ok +ok diff --git a/src/app/ui/copy-text/copy-text.component.scss b/src/app/features/old-stuff/pages/example/pictures/pictures.component.scss similarity index 100% rename from src/app/ui/copy-text/copy-text.component.scss rename to src/app/features/old-stuff/pages/example/pictures/pictures.component.scss diff --git a/src/app/pages/example/pictures/pictures.component.spec.ts b/src/app/features/old-stuff/pages/example/pictures/pictures.component.spec.ts similarity index 100% rename from src/app/pages/example/pictures/pictures.component.spec.ts rename to src/app/features/old-stuff/pages/example/pictures/pictures.component.spec.ts diff --git a/src/app/pages/example/pictures/pictures.component.ts b/src/app/features/old-stuff/pages/example/pictures/pictures.component.ts similarity index 95% rename from src/app/pages/example/pictures/pictures.component.ts rename to src/app/features/old-stuff/pages/example/pictures/pictures.component.ts index f7baa6b5..3ae5f225 100644 --- a/src/app/pages/example/pictures/pictures.component.ts +++ b/src/app/features/old-stuff/pages/example/pictures/pictures.component.ts @@ -12,5 +12,5 @@ export class PicturesComponent extends BaseComponent implements OnInit { super(config); } - ngOnInit() {} + ngOnInit(): void {} } diff --git a/src/app/pages/home/home.component.html b/src/app/features/old-stuff/pages/home/home.component.html similarity index 88% rename from src/app/pages/home/home.component.html rename to src/app/features/old-stuff/pages/home/home.component.html index 52161912..1eec32ce 100644 --- a/src/app/pages/home/home.component.html +++ b/src/app/features/old-stuff/pages/home/home.component.html @@ -77,15 +77,15 @@
- - -
diff --git a/src/app/ui/debugger/debugger.component.scss b/src/app/features/old-stuff/pages/home/home.component.scss similarity index 100% rename from src/app/ui/debugger/debugger.component.scss rename to src/app/features/old-stuff/pages/home/home.component.scss diff --git a/src/app/features/old-stuff/pages/home/home.component.spec.ts b/src/app/features/old-stuff/pages/home/home.component.spec.ts new file mode 100644 index 00000000..85666544 --- /dev/null +++ b/src/app/features/old-stuff/pages/home/home.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { HomeComponent } from './home.component'; + +describe('HomeComponent', () => { + let component: HomeComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [HomeComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(HomeComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/home/home.component.ts b/src/app/features/old-stuff/pages/home/home.component.ts similarity index 95% rename from src/app/pages/home/home.component.ts rename to src/app/features/old-stuff/pages/home/home.component.ts index 49dd54fc..6cb3d1fc 100644 --- a/src/app/pages/home/home.component.ts +++ b/src/app/features/old-stuff/pages/home/home.component.ts @@ -13,5 +13,5 @@ export class HomeComponent extends BaseComponent implements OnInit { super(config); } - ngOnInit() {} + ngOnInit(): void {} } diff --git a/src/app/pages/password/password.component.html b/src/app/features/old-stuff/pages/password/password.component.html similarity index 100% rename from src/app/pages/password/password.component.html rename to src/app/features/old-stuff/pages/password/password.component.html diff --git a/src/app/pages/password/password.component.scss b/src/app/features/old-stuff/pages/password/password.component.scss similarity index 100% rename from src/app/pages/password/password.component.scss rename to src/app/features/old-stuff/pages/password/password.component.scss diff --git a/src/app/pages/password/password.component.spec.ts b/src/app/features/old-stuff/pages/password/password.component.spec.ts similarity index 100% rename from src/app/pages/password/password.component.spec.ts rename to src/app/features/old-stuff/pages/password/password.component.spec.ts diff --git a/src/app/pages/password/password.component.ts b/src/app/features/old-stuff/pages/password/password.component.ts similarity index 95% rename from src/app/pages/password/password.component.ts rename to src/app/features/old-stuff/pages/password/password.component.ts index ccc1bc58..b8bca6e8 100644 --- a/src/app/pages/password/password.component.ts +++ b/src/app/features/old-stuff/pages/password/password.component.ts @@ -12,5 +12,5 @@ export class PasswordComponent extends BaseComponent implements OnInit { super(config); } - ngOnInit() {} + ngOnInit(): void {} } diff --git a/src/app/pages/poll/poll-display/poll-display.component.html b/src/app/features/old-stuff/pages/poll/poll-display/poll-display.component.html similarity index 100% rename from src/app/pages/poll/poll-display/poll-display.component.html rename to src/app/features/old-stuff/pages/poll/poll-display/poll-display.component.html diff --git a/src/app/features/old-stuff/pages/poll/poll-display/poll-display.component.scss b/src/app/features/old-stuff/pages/poll/poll-display/poll-display.component.scss new file mode 100644 index 00000000..5ab410dc --- /dev/null +++ b/src/app/features/old-stuff/pages/poll/poll-display/poll-display.component.scss @@ -0,0 +1 @@ +@import '../../../../../../styles/variables'; diff --git a/src/app/pages/poll/poll-display/poll-display.component.spec.ts b/src/app/features/old-stuff/pages/poll/poll-display/poll-display.component.spec.ts similarity index 100% rename from src/app/pages/poll/poll-display/poll-display.component.spec.ts rename to src/app/features/old-stuff/pages/poll/poll-display/poll-display.component.spec.ts diff --git a/src/app/pages/poll/poll-display/poll-display.component.ts b/src/app/features/old-stuff/pages/poll/poll-display/poll-display.component.ts similarity index 89% rename from src/app/pages/poll/poll-display/poll-display.component.ts rename to src/app/features/old-stuff/pages/poll/poll-display/poll-display.component.ts index 683b84ef..d78f0337 100644 --- a/src/app/pages/poll/poll-display/poll-display.component.ts +++ b/src/app/features/old-stuff/pages/poll/poll-display/poll-display.component.ts @@ -1,10 +1,10 @@ import { Component, OnInit } from '@angular/core'; import { BaseComponent } from '../../example/base-page/base.component'; import { ConfigService } from '../../../services/config.service'; -import { mockComments } from '../../../mocks/mock-comments'; +import { mockComments } from '../../../../../mocks/mock-comments'; import { ActivatedRoute, Router } from '@angular/router'; -import { environment } from '../../../../environments/environment'; -import { mockPoll3 } from '../../../mocks/mock-poll3'; +import { environment } from '../../../../../../environments/environment'; +import { mockPoll3 } from '../../../../../mocks/mock-poll3'; @Component({ selector: 'app-poll-display', @@ -26,7 +26,7 @@ export class PollDisplayComponent extends BaseComponent implements OnInit { }); } - ngOnInit() {} + ngOnInit(): void {} // fetch poll with its ID or slug. fetchPoll() { diff --git a/src/app/pages/poll/poll-graphic/poll-graphic.component.html b/src/app/features/old-stuff/pages/poll/poll-graphic/poll-graphic.component.html similarity index 100% rename from src/app/pages/poll/poll-graphic/poll-graphic.component.html rename to src/app/features/old-stuff/pages/poll/poll-graphic/poll-graphic.component.html diff --git a/src/app/pages/poll/poll-graphic/poll-graphic.component.scss b/src/app/features/old-stuff/pages/poll/poll-graphic/poll-graphic.component.scss similarity index 100% rename from src/app/pages/poll/poll-graphic/poll-graphic.component.scss rename to src/app/features/old-stuff/pages/poll/poll-graphic/poll-graphic.component.scss diff --git a/src/app/pages/poll/poll-graphic/poll-graphic.component.spec.ts b/src/app/features/old-stuff/pages/poll/poll-graphic/poll-graphic.component.spec.ts similarity index 100% rename from src/app/pages/poll/poll-graphic/poll-graphic.component.spec.ts rename to src/app/features/old-stuff/pages/poll/poll-graphic/poll-graphic.component.spec.ts diff --git a/src/app/pages/poll/poll-graphic/poll-graphic.component.ts b/src/app/features/old-stuff/pages/poll/poll-graphic/poll-graphic.component.ts similarity index 95% rename from src/app/pages/poll/poll-graphic/poll-graphic.component.ts rename to src/app/features/old-stuff/pages/poll/poll-graphic/poll-graphic.component.ts index 01b2c5df..a68cefcb 100644 --- a/src/app/pages/poll/poll-graphic/poll-graphic.component.ts +++ b/src/app/features/old-stuff/pages/poll/poll-graphic/poll-graphic.component.ts @@ -1,9 +1,9 @@ import { Component, Inject, OnInit } from '@angular/core'; import { Chart } from 'chart.js'; import { DOCUMENT } from '@angular/common'; -import { mockGraphConfig } from '../../../mocks/mock-graph'; +import { mockGraphConfig } from '../../../../../mocks/mock-graph'; import { ConfigService } from '../../../services/config.service'; -import { mockPoll3 } from '../../../mocks/mock-poll3'; +import { mockPoll3 } from '../../../../../mocks/mock-poll3'; @Component({ selector: 'app-poll-graphic', diff --git a/src/app/pages/resume/resume.component.html b/src/app/features/old-stuff/pages/resume/resume.component.html similarity index 87% rename from src/app/pages/resume/resume.component.html rename to src/app/features/old-stuff/pages/resume/resume.component.html index 5a9f2025..6188de00 100644 --- a/src/app/pages/resume/resume.component.html +++ b/src/app/features/old-stuff/pages/resume/resume.component.html @@ -1,6 +1,4 @@ -

- Récapitulatif -

+

Aperçu

{{ config.title }} @@ -57,15 +55,15 @@

- diff --git a/src/app/pages/resume/resume.component.scss b/src/app/features/old-stuff/pages/resume/resume.component.scss similarity index 100% rename from src/app/pages/resume/resume.component.scss rename to src/app/features/old-stuff/pages/resume/resume.component.scss diff --git a/src/app/pages/resume/resume.component.spec.ts b/src/app/features/old-stuff/pages/resume/resume.component.spec.ts similarity index 100% rename from src/app/pages/resume/resume.component.spec.ts rename to src/app/features/old-stuff/pages/resume/resume.component.spec.ts diff --git a/src/app/pages/resume/resume.component.ts b/src/app/features/old-stuff/pages/resume/resume.component.ts similarity index 100% rename from src/app/pages/resume/resume.component.ts rename to src/app/features/old-stuff/pages/resume/resume.component.ts diff --git a/src/app/pages/visibility/visibility.component.html b/src/app/features/old-stuff/pages/visibility/visibility.component.html similarity index 96% rename from src/app/pages/visibility/visibility.component.html rename to src/app/features/old-stuff/pages/visibility/visibility.component.html index b374e68b..b59e98b1 100644 --- a/src/app/pages/visibility/visibility.component.html +++ b/src/app/features/old-stuff/pages/visibility/visibility.component.html @@ -102,8 +102,8 @@ {{ 'visibility.access_instructions' | translate }} @@ -159,7 +159,7 @@ diff --git a/src/app/pages/visibility/visibility.component.scss b/src/app/features/old-stuff/pages/visibility/visibility.component.scss similarity index 100% rename from src/app/pages/visibility/visibility.component.scss rename to src/app/features/old-stuff/pages/visibility/visibility.component.scss diff --git a/src/app/pages/visibility/visibility.component.spec.ts b/src/app/features/old-stuff/pages/visibility/visibility.component.spec.ts similarity index 100% rename from src/app/pages/visibility/visibility.component.spec.ts rename to src/app/features/old-stuff/pages/visibility/visibility.component.spec.ts diff --git a/src/app/pages/visibility/visibility.component.ts b/src/app/features/old-stuff/pages/visibility/visibility.component.ts similarity index 93% rename from src/app/pages/visibility/visibility.component.ts rename to src/app/features/old-stuff/pages/visibility/visibility.component.ts index a1d1859c..600be9df 100644 --- a/src/app/pages/visibility/visibility.component.ts +++ b/src/app/features/old-stuff/pages/visibility/visibility.component.ts @@ -1,7 +1,7 @@ import { Location } from '@angular/common'; import { Component, OnInit } from '@angular/core'; -import { environment } from '../../../environments/environment'; +import { environment } from '../../../../../environments/environment'; import { PollUtilities } from '../../config/PollUtilities'; import { ConfigService } from '../../services/config.service'; import { BaseComponent } from '../example/base-page/base.component'; diff --git a/src/app/pages/voting/choices-list/choices-list.component.html b/src/app/features/old-stuff/pages/voting/choices-list/choices-list.component.html similarity index 100% rename from src/app/pages/voting/choices-list/choices-list.component.html rename to src/app/features/old-stuff/pages/voting/choices-list/choices-list.component.html diff --git a/src/app/ui/erasable-input/erasable-input.component.scss b/src/app/features/old-stuff/pages/voting/choices-list/choices-list.component.scss similarity index 100% rename from src/app/ui/erasable-input/erasable-input.component.scss rename to src/app/features/old-stuff/pages/voting/choices-list/choices-list.component.scss diff --git a/src/app/pages/voting/choices-list/choices-list.component.spec.ts b/src/app/features/old-stuff/pages/voting/choices-list/choices-list.component.spec.ts similarity index 100% rename from src/app/pages/voting/choices-list/choices-list.component.spec.ts rename to src/app/features/old-stuff/pages/voting/choices-list/choices-list.component.spec.ts diff --git a/src/app/pages/voting/choices-list/choices-list.component.ts b/src/app/features/old-stuff/pages/voting/choices-list/choices-list.component.ts similarity index 100% rename from src/app/pages/voting/choices-list/choices-list.component.ts rename to src/app/features/old-stuff/pages/voting/choices-list/choices-list.component.ts diff --git a/src/app/pages/voting/comments-list/comments-list.component.html b/src/app/features/old-stuff/pages/voting/comments-list/comments-list.component.html similarity index 100% rename from src/app/pages/voting/comments-list/comments-list.component.html rename to src/app/features/old-stuff/pages/voting/comments-list/comments-list.component.html diff --git a/src/app/ui/navigation/two-links/two-links.component.scss b/src/app/features/old-stuff/pages/voting/comments-list/comments-list.component.scss similarity index 100% rename from src/app/ui/navigation/two-links/two-links.component.scss rename to src/app/features/old-stuff/pages/voting/comments-list/comments-list.component.scss diff --git a/src/app/pages/voting/comments-list/comments-list.component.spec.ts b/src/app/features/old-stuff/pages/voting/comments-list/comments-list.component.spec.ts similarity index 100% rename from src/app/pages/voting/comments-list/comments-list.component.spec.ts rename to src/app/features/old-stuff/pages/voting/comments-list/comments-list.component.spec.ts diff --git a/src/app/pages/voting/comments-list/comments-list.component.ts b/src/app/features/old-stuff/pages/voting/comments-list/comments-list.component.ts similarity index 100% rename from src/app/pages/voting/comments-list/comments-list.component.ts rename to src/app/features/old-stuff/pages/voting/comments-list/comments-list.component.ts diff --git a/src/app/pages/voting/voting-choice/voting-choice.component.html b/src/app/features/old-stuff/pages/voting/voting-choice/voting-choice.component.html similarity index 100% rename from src/app/pages/voting/voting-choice/voting-choice.component.html rename to src/app/features/old-stuff/pages/voting/voting-choice/voting-choice.component.html diff --git a/src/app/pages/voting/voting-choice/voting-choice.component.scss b/src/app/features/old-stuff/pages/voting/voting-choice/voting-choice.component.scss similarity index 99% rename from src/app/pages/voting/voting-choice/voting-choice.component.scss rename to src/app/features/old-stuff/pages/voting/voting-choice/voting-choice.component.scss index 00028e40..4b2f821e 100644 --- a/src/app/pages/voting/voting-choice/voting-choice.component.scss +++ b/src/app/features/old-stuff/pages/voting/voting-choice/voting-choice.component.scss @@ -5,7 +5,7 @@ // -- IMPORTS // ---------------------------- -@import '../../../../styles/variables'; +@import '../../../../../../styles/variables'; // -- VARIABLES // ---------------------------- diff --git a/src/app/pages/voting/voting-choice/voting-choice.component.spec.ts b/src/app/features/old-stuff/pages/voting/voting-choice/voting-choice.component.spec.ts similarity index 95% rename from src/app/pages/voting/voting-choice/voting-choice.component.spec.ts rename to src/app/features/old-stuff/pages/voting/voting-choice/voting-choice.component.spec.ts index 0df40949..9370c38a 100644 --- a/src/app/pages/voting/voting-choice/voting-choice.component.spec.ts +++ b/src/app/features/old-stuff/pages/voting/voting-choice/voting-choice.component.spec.ts @@ -7,8 +7,8 @@ import { ConfirmationService, MessageService } from 'primeng'; import { Router } from '@angular/router'; import { ConfigService } from '../../../services/config.service'; import { VotingChoiceComponent } from './voting-choice.component'; -import { mockChoice } from '../../../mocks/choice'; -import { mockPoll3 } from '../../../mocks/mock-poll3'; +import { mockChoice } from '../../../../../mocks/choice'; +import { mockPoll3 } from '../../../../../mocks/mock-poll3'; const routerSpy = jest.fn({ navigateByUrl: jest.fn() }); diff --git a/src/app/pages/voting/voting-choice/voting-choice.component.ts b/src/app/features/old-stuff/pages/voting/voting-choice/voting-choice.component.ts similarity index 100% rename from src/app/pages/voting/voting-choice/voting-choice.component.ts rename to src/app/features/old-stuff/pages/voting/voting-choice/voting-choice.component.ts diff --git a/src/app/pages/voting/voting-comment/voting-comment.component.html b/src/app/features/old-stuff/pages/voting/voting-comment/voting-comment.component.html similarity index 100% rename from src/app/pages/voting/voting-comment/voting-comment.component.html rename to src/app/features/old-stuff/pages/voting/voting-comment/voting-comment.component.html diff --git a/src/app/features/old-stuff/pages/voting/voting-comment/voting-comment.component.scss b/src/app/features/old-stuff/pages/voting/voting-comment/voting-comment.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/pages/voting/voting-comment/voting-comment.component.spec.ts b/src/app/features/old-stuff/pages/voting/voting-comment/voting-comment.component.spec.ts similarity index 100% rename from src/app/pages/voting/voting-comment/voting-comment.component.spec.ts rename to src/app/features/old-stuff/pages/voting/voting-comment/voting-comment.component.spec.ts diff --git a/src/app/pages/voting/voting-comment/voting-comment.component.ts b/src/app/features/old-stuff/pages/voting/voting-comment/voting-comment.component.ts similarity index 78% rename from src/app/pages/voting/voting-comment/voting-comment.component.ts rename to src/app/features/old-stuff/pages/voting/voting-comment/voting-comment.component.ts index 37691dda..8c3bdc6a 100644 --- a/src/app/pages/voting/voting-comment/voting-comment.component.ts +++ b/src/app/features/old-stuff/pages/voting/voting-comment/voting-comment.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { mockComments } from '../../../mocks/mock-comments'; +import { mockComments } from '../../../../../mocks/mock-comments'; @Component({ selector: 'app-voting-comment', @@ -11,5 +11,5 @@ export class VotingCommentComponent implements OnInit { constructor() {} - ngOnInit() {} + ngOnInit(): void {} } diff --git a/src/app/pages/voting/voting-graph/voting-graph.component.html b/src/app/features/old-stuff/pages/voting/voting-graph/voting-graph.component.html similarity index 100% rename from src/app/pages/voting/voting-graph/voting-graph.component.html rename to src/app/features/old-stuff/pages/voting/voting-graph/voting-graph.component.html diff --git a/src/app/features/old-stuff/pages/voting/voting-graph/voting-graph.component.scss b/src/app/features/old-stuff/pages/voting/voting-graph/voting-graph.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/pages/voting/voting-graph/voting-graph.component.spec.ts b/src/app/features/old-stuff/pages/voting/voting-graph/voting-graph.component.spec.ts similarity index 100% rename from src/app/pages/voting/voting-graph/voting-graph.component.spec.ts rename to src/app/features/old-stuff/pages/voting/voting-graph/voting-graph.component.spec.ts diff --git a/src/app/pages/voting/voting-graph/voting-graph.component.ts b/src/app/features/old-stuff/pages/voting/voting-graph/voting-graph.component.ts similarity index 95% rename from src/app/pages/voting/voting-graph/voting-graph.component.ts rename to src/app/features/old-stuff/pages/voting/voting-graph/voting-graph.component.ts index 92916dee..c0798ef5 100644 --- a/src/app/pages/voting/voting-graph/voting-graph.component.ts +++ b/src/app/features/old-stuff/pages/voting/voting-graph/voting-graph.component.ts @@ -12,5 +12,5 @@ export class VotingGraphComponent extends BaseComponent implements OnInit { super(config); } - ngOnInit() {} + ngOnInit(): void {} } diff --git a/src/app/pages/voting/voting-navigation/voting-navigation.component.html b/src/app/features/old-stuff/pages/voting/voting-navigation/voting-navigation.component.html similarity index 84% rename from src/app/pages/voting/voting-navigation/voting-navigation.component.html rename to src/app/features/old-stuff/pages/voting/voting-navigation/voting-navigation.component.html index b1612ea1..a0ad3065 100644 --- a/src/app/pages/voting/voting-navigation/voting-navigation.component.html +++ b/src/app/features/old-stuff/pages/voting/voting-navigation/voting-navigation.component.html @@ -2,23 +2,23 @@