Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganize Vue templates #440

Merged
merged 12 commits into from
Oct 30, 2023
Merged

Reorganize Vue templates #440

merged 12 commits into from
Oct 30, 2023

Conversation

vincent-olivert-riera
Copy link
Contributor

@vincent-olivert-riera vincent-olivert-riera commented Oct 30, 2023

Define the templates of all our Vue components as separate HTML files rather than JavaScript string variables, so they are:

  • Less error prone.
  • More maintainable.
  • Lintable and formatable.

Also, place all those templates inside a vue folder so it becomes clear they belong to Vue components.


This PR will make the future PR for migrating to Vue 3 much shorter.

In order to have all the templates for Vue components well organized, we are
going to move all of them inside a vue folder. The first one we have moved is
the template for the silence form.
Instead of defining the whole template for the bootstrap-panel component as a
string, which is more error prone, difficult to maintain and impossible to lint,
we are now using a separate html file for it which solves those three problems.
Using different delimiters in different components can be error prone and
confusing. Is better to stick to one kind of delimiters and use it always, for
the previous reasons and also for consistency.
Instead of defining the whole template for the exporter-result component as a
string, which is more error prone, difficult to maintain and impossible to lint,
we are now using a separate html file for it which solves those three problems.
Using different delimiters in different components can be error prone and
confusing. Is better to stick to one kind of delimiters and use it always, for
the previous reasons and also for consistency.
Instead of defining the whole template for the exporter-test component as a
string, which is more error prone, difficult to maintain and impossible to lint,
we are now using a separate html file for it which solves those three problems.
Using different delimiters in different components can be error prone and
confusing. Is better to stick to one kind of delimiters and use it always, for
the previous reasons and also for consistency.
Instead of defining the whole template for the promql-query component as a
string, which is more error prone, difficult to maintain and impossible to lint,
we are now using a separate html file for it which solves those three problems.
Using different delimiters in different components can be error prone and
confusing. Is better to stick to one kind of delimiters and use it always, for
the previous reasons and also for consistency.
@vincent-olivert-riera vincent-olivert-riera requested a review from a team as a code owner October 30, 2023 03:32
@vincent-olivert-riera vincent-olivert-riera changed the title Reorganize vue templates Reorganize Vue templates Oct 30, 2023
Copy link
Collaborator

@kfdm kfdm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Was there any more work you wanted to do or flatten some commits or are you fine for me to merge as is?

@vincent-olivert-riera
Copy link
Contributor Author

LGTM. Was there any more work you wanted to do or flatten some commits or are you fine for me to merge as is?

No, this PR is ready to be merged as it is. Thanks! 👍🏻

@kfdm kfdm merged commit 6e5af8c into master Oct 30, 2023
4 checks passed
@kfdm kfdm deleted the reorganize-vue-templates branch October 30, 2023 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants