Frontend refactor: move Vue related code from index.js to components dir, and remove unused codes. #17301

Merged
lunny merged 14 commits from frontend-refactor into main 2021-10-15 02:35:27 +00:00
Contributor

This is the first big frontend refactor for Frontend Plan (https://github.com/go-gitea/gitea/issues/17149)

Major changes:

  • A guideline document is added
  • Remove unused tags from head.tmpl, including:
    • <head data-suburl="{{AppSubUrl}}">
    • <meta name="_uid" content="{{.SignedUser.ID}}" />
    • <meta name="_context_uid" content="{{.ContextUser.ID}}" />
    • <meta name="_search_limit" content="{{.SearchLimit}}" />
  • Remove unused code submitDeleteForm from repo/view_file.tmpl
  • Move all Vue related code from index.js to components dir, including:
    • DashboardRepoList.js: used by the repo list on the home dashboard
    • RepoActivityTopAuthors.vue, used by /org/repo/activity to show a bar chart for top activity users
    • RepoBranchTagDropdown.js, used by repo pages to show a dropdown list to select branches and tags.
  • Remove most ignorePatterns items from .eslint, we are clear enough now!
This is the first big frontend refactor for Frontend Plan (https://github.com/go-gitea/gitea/issues/17149) Major changes: * A guideline document is added * Remove unused tags from `head.tmpl`, including: * `<head data-suburl="{{AppSubUrl}}">` * `<meta name="_uid" content="{{.SignedUser.ID}}" />` * `<meta name="_context_uid" content="{{.ContextUser.ID}}" />` * `<meta name="_search_limit" content="{{.SearchLimit}}" />` * Remove unused code `submitDeleteForm` from `repo/view_file.tmpl` * Move all Vue related code from `index.js` to `components` dir, including: * `DashboardRepoList.js`: used by the repo list on the home dashboard * `RepoActivityTopAuthors.vue`, used by `/org/repo/activity` to show a bar chart for top activity users * `RepoBranchTagDropdown.js`, used by repo pages to show a dropdown list to select branches and tags. * Remove most `ignorePatterns` items from `.eslint`, we are clear enough now!
delvh reviewed 2021-10-13 21:39:41 +00:00
Contributor
### Gitea specific guidelines:
```suggestion ### Gitea specific guidelines: ```
Contributor
1. Every feature (Fomantic-UI/jQuery module) should be put in separate files/ directories.
```suggestion 1. Every feature (Fomantic-UI/jQuery module) should be put in separate files/ directories. ```
Contributor
2. HTML ids and classes should use kebab-case.
3. HTML ids and classes used in JavaScript should be unique for the whole project, and should contain 2-3 feature related keywords. We recommend to use the `js-` prefix for classes that are only used in JavaScript.
```suggestion 2. HTML ids and classes should use kebab-case. 3. HTML ids and classes used in JavaScript should be unique for the whole project, and should contain 2-3 feature related keywords. We recommend to use the `js-` prefix for classes that are only used in JavaScript. ```
Contributor
5. CSS styling for classes provided by frameworks should not be overwritten. Always use new class-names to overwrite framework styles. We recommend to use the `us-` prefix for user defined styles.  
```suggestion 5. CSS styling for classes provided by frameworks should not be overwritten. Always use new class-names to overwrite framework styles. We recommend to use the `us-` prefix for user defined styles. ```
Contributor
6. The backend can pass complex data to the frontend by using `ctx.PageData["myModuleData"] = map{}`
```suggestion 6. The backend can pass complex data to the frontend by using `ctx.PageData["myModuleData"] = map{}` ```
Contributor
### Too much code in `web_src/index.js`
```suggestion ### Too much code in `web_src/index.js` ```
Contributor
Previously, most JavaScript code was written into `web_src/index.js` directly, making the file unmaintainable.
Try to keep this file small by creating new modules instead. These modules can be put in the `web_src/js/features` directory for now.
```suggestion Previously, most JavaScript code was written into `web_src/index.js` directly, making the file unmaintainable. Try to keep this file small by creating new modules instead. These modules can be put in the `web_src/js/features` directory for now. ```
Contributor
7. Simple pages and SEO-related pages use the Go Text Template render to generate static Fomantic-UI HTML output. Complex pages can use Vue2 (or Vue3 in future).
```suggestion 7. Simple pages and SEO-related pages use the Go Text Template render to generate static Fomantic-UI HTML output. Complex pages can use Vue2 (or Vue3 in future). ```
Contributor
Gitea is using Vue2 now, we plan to upgrade to Vue3. We decided not to introduce JSX to keep the HTML and the JavaScript code separated.
```suggestion Gitea is using Vue2 now, we plan to upgrade to Vue3. We decided not to introduce JSX to keep the HTML and the JavaScript code separated. ```
@ -0,0 +21,4 @@
## Background
Gitea uses [Less CSS](https://lesscss.org), [Fomantic-UI](https://fomantic-ui.com/introduction/getting-started.html) (based on [jQuery](https://api.jquery.com)) and [Vue2](https://vuejs.org/v2/guide/) for its frontend.
Contributor
Gitea uses [Less CSS](https://lesscss.org), [Fomantic-UI](https://fomantic-ui.com/introduction/getting-started.html) (based on [jQuery](https://api.jquery.com)), and [Vue2](https://vuejs.org/v2/guide/) for its frontend.
```suggestion Gitea uses [Less CSS](https://lesscss.org), [Fomantic-UI](https://fomantic-ui.com/introduction/getting-started.html) (based on [jQuery](https://api.jquery.com)), and [Vue2](https://vuejs.org/v2/guide/) for its frontend. ```
@ -0,0 +27,4 @@
## General Guidelines
We recommend [Google HTML/CSS Style Guide](https://google.github.io/styleguide/htmlcssguide.html) and [Google JavaScript Style Guide](https://google.github.io/styleguide/jsguide.html)
Contributor
We recommend the [Google HTML/CSS Style Guide](https://google.github.io/styleguide/htmlcssguide.html) and [Google JavaScript Style Guide](https://google.github.io/styleguide/jsguide.html)
```suggestion We recommend the [Google HTML/CSS Style Guide](https://google.github.io/styleguide/htmlcssguide.html) and [Google JavaScript Style Guide](https://google.github.io/styleguide/jsguide.html) ```
Contributor
Frontend development should follow the [Guidelines for Frontend Development](./guidelines-frontend.md)

Of course, you could also just build once:
```suggestion Frontend development should follow the [Guidelines for Frontend Development](./guidelines-frontend.md) Of course, you could also just build once: ```
@ -62,3 +62,3 @@
if ctx.Data["ActivityTopAuthors"], err = models.GetActivityStatsTopAuthors(ctx.Repo.Repository, timeFrom, 10); err != nil {
if ctx.PageData["repoActivityTopAuthors"], err = models.GetActivityStatsTopAuthors(ctx.Repo.Repository, timeFrom, 10); err != nil {
ctx.ServerError("GetActivityStatsTopAuthors", err)
Contributor

Do we use UpperCamelCase for ctx.Data and lowerCamelCase for ctx.PageData? Why?
Could we please be consistent here, or would that lead to UpperCamelCase variables in the frontend?

Do we use UpperCamelCase for `ctx.Data` and lowerCamelCase for `ctx.PageData`? Why? Could we please be consistent here, or would that lead to UpperCamelCase variables in the frontend?
@ -110,1 +110,4 @@
ctx.PageData["dashboardRepoList"] = map[string]interface{}{
"searchLimit": setting.UI.User.RepoPagingNum,
}
Contributor

😕
What's the benefit in this case of using a single-entry map instead of a simple int?

:confused: What's the benefit in this case of using a single-entry map instead of a simple int?
@ -1,6 +1,6 @@
<!DOCTYPE html>
<html lang="{{.Lang}}" class="theme-{{.SignedUser.Theme}}">
Contributor

I don't think that will form a valid html file. Was that taken out by accident? Did you perhaps simply want to remove the data-suburl?

<html lang="{{.Lang}}" class="theme-{{.SignedUser.Theme}}">
<head>

Alternatively, the original line:

<html lang="{{.Lang}}" class="theme-{{.SignedUser.Theme}}">
<head data-suburl="{{AppSubUrl}}">
I don't think that will form a valid html file. Was that taken out by accident? Did you perhaps simply want to remove the `data-suburl`? ```suggestion <html lang="{{.Lang}}" class="theme-{{.SignedUser.Theme}}"> <head> ``` Alternatively, the original line: ```suggestion <html lang="{{.Lang}}" class="theme-{{.SignedUser.Theme}}"> <head data-suburl="{{AppSubUrl}}"> ```
@ -36,3 +28,3 @@
csrf: '{{.CsrfToken}}',
PageData: {{ .PageData }},
pageData: {{ .PageData }},
HighlightJS: {{if .RequireHighlightJS}}true{{else}}false{{end}},
Contributor

Were those extracted to ctx.PageData and are hence not needed anymore?

Were those extracted to `ctx.PageData` and are hence not needed anymore?
Contributor
					<div id="repo-activity-top-authors-chart" class="ui attached segment"></div>
```suggestion <div id="repo-activity-top-authors-chart" class="ui attached segment"></div> ```
Contributor

What happened to this function? Why could it be deleted (as it seems without replacement as far as I can see)?

What happened to this function? Why could it be deleted (as it seems without replacement as far as I can see)?
@ -1,8 +1,7 @@
<div id="app" class="six wide column">
<div id="dashboard-repo-list" class="six wide column">
<repo-search
Contributor

Assuming it still works: 👍

Assuming it still works: :+1:
@ -70,4 +70,3 @@ export default {
},
};
</script>
<style scoped/>
Contributor

You now only require this file when you are on the correct page and hence removed the scoped attribute?

You now only require this file when you are on the correct page and hence removed the `scoped` attribute?
@ -0,0 +26,4 @@
},
organizations: {
type: Array,
default: () => [],
Contributor
        default: [],

Or why would you use an additional function call?

```suggestion default: [], ``` Or why would you use an additional function call?
@ -0,0 +30,4 @@
},
isOrganization: {
type: Boolean,
default: true
Contributor
        default: false

Why would you assume by default that our user is an organization?

```suggestion default: false ``` Why would you assume by default that our user is an organization?
@ -0,0 +252,4 @@
break;
default:
this.archivedFilter = 'unarchived';
break;
Contributor
          case 'unarchived':
            this.archivedFilter = 'archived';
            break;
          case 'archived':
            this.archivedFilter = 'both';
            break;
          case 'both':
          default:
            this.archivedFilter = 'unarchived';
            break;
```suggestion case 'unarchived': this.archivedFilter = 'archived'; break; case 'archived': this.archivedFilter = 'both'; break; case 'both': default: this.archivedFilter = 'unarchived'; break; ```
@ -0,0 +274,4 @@
break;
default:
this.privateFilter = 'both';
break;
Contributor
          case 'private':
          default:
            this.privateFilter = 'both';
            break;
```suggestion case 'private': default: this.privateFilter = 'both'; break; ```
@ -0,0 +291,4 @@
}
if (this.page < 1) {
this.page = 1;
}
Contributor
        this.page = Math.min(page, this.finalPage);
        this.page = Math.max(this.page, 1);
```suggestion this.page = Math.min(page, this.finalPage); this.page = Math.max(this.page, 1); ```
@ -0,0 +6,4 @@
let vueEnvInited = false;
function initVueEnv() {
if (vueEnvInited) return;
vueEnvInited = true;
Contributor
let vueEnvInitialized = false;
function initVueEnv() {
  if (vueEnvInitialized) return;
  vueEnvInitialized = true;
```suggestion let vueEnvInitialized = false; function initVueEnv() { if (vueEnvInitialized) return; vueEnvInitialized = true; ```
@ -0,0 +16,4 @@
let vueSvgInited = false;
function initVueSvg() {
if (vueSvgInited) return;
vueSvgInited = true;
Contributor
let vueSvgInitialized = false;
function initVueSvg() {
  if (vueSvgInitialized) return;
  vueSvgInitialized = true;
```suggestion let vueSvgInitialized = false; function initVueSvg() { if (vueSvgInitialized) return; vueSvgInitialized = true; ```
wxiaoguang reviewed 2021-10-14 01:03:40 +00:00
@ -0,0 +21,4 @@
## Background
Gitea uses [Less CSS](https://lesscss.org), [Fomantic-UI](https://fomantic-ui.com/introduction/getting-started.html) (based on [jQuery](https://api.jquery.com)) and [Vue2](https://vuejs.org/v2/guide/) for its frontend.
Author
Contributor

It's not a syntax problem. See: https://www.grammarly.com/blog/comma-before-and/

It's not a syntax problem. See: https://www.grammarly.com/blog/comma-before-and/
wxiaoguang reviewed 2021-10-14 01:04:42 +00:00
@ -0,0 +27,4 @@
## General Guidelines
We recommend [Google HTML/CSS Style Guide](https://google.github.io/styleguide/htmlcssguide.html) and [Google JavaScript Style Guide](https://google.github.io/styleguide/jsguide.html)
Author
Contributor
It's not a syntax problem: https://english.stackexchange.com/questions/273067/when-to-use-the-in-book-titles
wxiaoguang reviewed 2021-10-14 01:06:34 +00:00
Author
Contributor

In my mind, this list is supplementary clauses to the google guidelines, so we do not need a new section.

In my mind, this list is supplementary clauses to the google guidelines, so we do not need a new section.
wxiaoguang reviewed 2021-10-14 01:09:14 +00:00
Author
Contributor

As above, I think we do not call the Vue2 or the Go Text Template.

As above, I think we do not call `the Vue2` or `the Go Text Template`.
lunny reviewed 2021-10-14 01:10:25 +00:00
The HTML pages are rendered by [Go HTML Template](https://pkg.go.dev/html/template)
```suggestion The HTML pages are rendered by [Go HTML Template](https://pkg.go.dev/html/template) ```
wxiaoguang reviewed 2021-10-14 01:10:37 +00:00
Author
Contributor

watch-frontend is better for development so we had better keep it here

`watch-frontend` is better for development so we had better keep it here
wxiaoguang reviewed 2021-10-14 01:13:11 +00:00
@ -62,3 +62,3 @@
if ctx.Data["ActivityTopAuthors"], err = models.GetActivityStatsTopAuthors(ctx.Repo.Repository, timeFrom, 10); err != nil {
if ctx.PageData["repoActivityTopAuthors"], err = models.GetActivityStatsTopAuthors(ctx.Repo.Repository, timeFrom, 10); err != nil {
ctx.ServerError("GetActivityStatsTopAuthors", err)
Author
Contributor

Most keys in window.config use PascalCase. Some people prefer to use camelCase for (new) JavaScript keys.

Both are fine to me.

Most keys in `window.config` use PascalCase. Some people prefer to use camelCase for (new) JavaScript keys. Both are fine to me.
wxiaoguang reviewed 2021-10-14 01:14:55 +00:00
@ -110,1 +110,4 @@
ctx.PageData["dashboardRepoList"] = map[string]interface{}{
"searchLimit": setting.UI.User.RepoPagingNum,
}
Author
Contributor

More options can be added in future. And PageData passes data for JavaScript modeuls like ctx.PageData["theModuleName"], so we can not just put an int here.

More options can be added in future. And `PageData` passes data for JavaScript modeuls like `ctx.PageData["theModuleName"]`, so we can not just put an int here.
wxiaoguang reviewed 2021-10-14 01:16:26 +00:00
@ -36,3 +28,3 @@
csrf: '{{.CsrfToken}}',
PageData: {{ .PageData }},
pageData: {{ .PageData }},
HighlightJS: {{if .RequireHighlightJS}}true{{else}}false{{end}},
Author
Contributor

Yes, I searched the whole project, only legacy dashboard repo list depends on <meta name="_search_limit"

Yes, I searched the whole project, only legacy `dashboard repo list` depends on `<meta name="_search_limit"`
wxiaoguang reviewed 2021-10-14 01:19:39 +00:00
Author
Contributor

I think it won't work. It's difficult to tune the CSS styles mixing with a Vue app element. So we just put the Vue app element inside a <div> we have full control.

I think it won't work. It's difficult to tune the CSS styles mixing with a Vue app element. So we just put the Vue app element inside a `<div>` we have full control.
wxiaoguang reviewed 2021-10-14 01:20:46 +00:00
Author
Contributor

No caller to it, the HTML id #delete-message and #delete-file-form also disappeared.

Now the deletion function is provided by /org/repo/_delete/master/FILENAME.

No caller to it, the HTML id `#delete-message` and `#delete-file-form` also disappeared. Now the deletion function is provided by `/org/repo/_delete/master/FILENAME`.
wxiaoguang reviewed 2021-10-14 01:23:49 +00:00
@ -1,8 +1,7 @@
<div id="app" class="six wide column">
<div id="dashboard-repo-list" class="six wide column">
<repo-search
Author
Contributor

Why not, it is used by DashboardRepoList.js

Why not, it is used by `DashboardRepoList.js`
wxiaoguang reviewed 2021-10-14 01:24:36 +00:00
@ -70,4 +70,3 @@ export default {
},
};
</script>
<style scoped/>
Author
Contributor

This is an incorrect syntax. No effect.

This is an incorrect syntax. No effect.
wxiaoguang reviewed 2021-10-14 01:26:28 +00:00
@ -0,0 +26,4 @@
},
organizations: {
type: Array,
default: () => [],
Author
Contributor

I just copied(moved) old code here, I won't make big change for the first commit, otherwise it will be difficult for us to view commit history and diff. Any refactor should happen in future after the move.

I just copied(moved) old code here, I won't make big change for the first commit, otherwise it will be difficult for us to view commit history and diff. Any refactor should happen in future after the move.
wxiaoguang reviewed 2021-10-14 01:26:54 +00:00
@ -0,0 +30,4 @@
},
isOrganization: {
type: Boolean,
default: true
Author
Contributor

As above, no big change to first copy-move refactor.

As above, no big change to first copy-move refactor.
wxiaoguang reviewed 2021-10-14 01:27:07 +00:00
@ -0,0 +252,4 @@
break;
default:
this.archivedFilter = 'unarchived';
break;
Author
Contributor

As above, no big change to first copy-move refactor.

As above, no big change to first copy-move refactor.
wxiaoguang reviewed 2021-10-14 01:27:12 +00:00
@ -0,0 +274,4 @@
break;
default:
this.privateFilter = 'both';
break;
Author
Contributor

As above, no big change to first copy-move refactor.

As above, no big change to first copy-move refactor.
wxiaoguang reviewed 2021-10-14 01:27:17 +00:00
@ -0,0 +291,4 @@
}
if (this.page < 1) {
this.page = 1;
}
Author
Contributor

As above, no big change to first copy-move refactor.

As above, no big change to first copy-move refactor.
wxiaoguang reviewed 2021-10-14 01:29:02 +00:00
@ -0,0 +6,4 @@
let vueEnvInited = false;
function initVueEnv() {
if (vueEnvInited) return;
vueEnvInited = true;
Author
Contributor

inited is OK for abbr.

https://www.definify.com/word/inited

`inited` is OK for abbr. https://www.definify.com/word/inited
wxiaoguang reviewed 2021-10-14 01:29:09 +00:00
@ -0,0 +16,4 @@
let vueSvgInited = false;
function initVueSvg() {
if (vueSvgInited) return;
vueSvgInited = true;
Author
Contributor

As above

As above
delvh reviewed 2021-10-14 09:30:19 +00:00
@ -0,0 +27,4 @@
## General Guidelines
We recommend [Google HTML/CSS Style Guide](https://google.github.io/styleguide/htmlcssguide.html) and [Google JavaScript Style Guide](https://google.github.io/styleguide/jsguide.html)
Contributor

That only applies inside the book title, not when referencing the book:
What that StackExchange discussion is saying is:
It is perfectly fine to call the book Lord of the rings.
You should, however, append the the when referencing the Lord of the rings series.

That only applies **inside** the _book title_, not when **referencing** the book: What that StackExchange discussion is saying is: It is perfectly fine to call the book `Lord of the rings`. You should, however, append the `the` when referencing **the** `Lord of the rings` series.
delvh reviewed 2021-10-14 09:31:34 +00:00
Contributor

Not a new section, a subsection.
Simply for the visual difference.

Not a new section, a subsection. Simply for the visual difference.
delvh reviewed 2021-10-14 09:33:40 +00:00
Contributor

Yes, but it is already mentioned a few lines (5 to 10) above.
That way, it simply is duplicated.

Yes, but it is already mentioned a few lines (5 to 10) above. That way, it simply is duplicated.
delvh reviewed 2021-10-14 09:35:45 +00:00
@ -110,1 +110,4 @@
ctx.PageData["dashboardRepoList"] = map[string]interface{}{
"searchLimit": setting.UI.User.RepoPagingNum,
}
Contributor

What I mean: This setting was previously rendered on the server-side, if I see that correctly.
Now the same thing seems to be rendered on the frontend with a more complicated mechanism?
Correct me if I'm wrong.

What I mean: This setting was previously rendered on the server-side, if I see that correctly. Now the same thing seems to be rendered on the frontend with a more complicated mechanism? Correct me if I'm wrong.
delvh reviewed 2021-10-14 09:37:03 +00:00
@ -70,4 +70,3 @@ export default {
},
};
</script>
<style scoped/>
Contributor

Also makes sense.

Also makes sense.
wxiaoguang reviewed 2021-10-14 09:39:07 +00:00
@ -0,0 +27,4 @@
## General Guidelines
We recommend [Google HTML/CSS Style Guide](https://google.github.io/styleguide/htmlcssguide.html) and [Google JavaScript Style Guide](https://google.github.io/styleguide/jsguide.html)
Author
Contributor

Do you read Harry Potter? or Do you read the Harry Potter?

That's similar to the guideline names. Do we like Google Guideline?

`Do you read Harry Potter?` or `Do you read the Harry Potter?` That's similar to the guideline names. `Do we like Google Guideline?`
wxiaoguang reviewed 2021-10-14 09:45:06 +00:00
@ -110,1 +110,4 @@
ctx.PageData["dashboardRepoList"] = map[string]interface{}{
"searchLimit": setting.UI.User.RepoPagingNum,
}
Author
Contributor

I don't understand why it's more complicated.

With old mechanism, a tag also must be written into the template. And frontend must query the tag.

The new mechanism, we just construct a map and frontend just reads it, nothing else. If you mean to write ctx.PageData["SearcLimit"] = xxx, I am totally against it, it pollutes the namespace. More code doesn't mean more complicated.

I don't understand why it's more complicated. With old mechanism, a tag also must be written into the template. And frontend must query the tag. The new mechanism, we just construct a map and frontend just reads it, nothing else. If you mean to write `ctx.PageData["SearcLimit"] = xxx`, I am totally against it, it pollutes the namespace. More code doesn't mean more complicated.
delvh reviewed 2021-10-14 09:45:19 +00:00
Contributor

Isn't the <div> by default an invisible element where it makes no difference if it exists or not?
I think this approach should behave just the same.

Isn't the `<div>` by default an invisible element where it makes no difference if it exists or not? I think this approach should behave just the same.
wxiaoguang reviewed 2021-10-14 09:49:53 +00:00
Author
Contributor

It won't work.

My code

image

Your code

image
It won't work. # My code <img width="1200" alt="image" src="https://user-images.githubusercontent.com/2114189/137294054-6b616bb4-72f1-422c-b5eb-2fa3c4810097.png"> # Your code <img width="1181" alt="image" src="https://user-images.githubusercontent.com/2114189/137294093-68fd08e1-ac17-4691-bc25-ff3fa7a109ba.png">
delvh reviewed 2021-10-14 09:59:05 +00:00
@ -0,0 +27,4 @@
## General Guidelines
We recommend [Google HTML/CSS Style Guide](https://google.github.io/styleguide/htmlcssguide.html) and [Google JavaScript Style Guide](https://google.github.io/styleguide/jsguide.html)
Contributor

That's similar to the guideline names. Do we like Google Guideline?

I would say that's part of the problem: guideline/ style guide are normal English words.
While they are also inside the title, for me it makes more sense to use them as the words they are, not as parts of the title.
To me, Do we like Google Guideline? sounds like incorrect English.

> That's similar to the guideline names. `Do we like Google Guideline?` I would say that's part of the problem: `guideline`/ `style guide` are normal English words. While they are also inside the title, for me it makes more sense to use them as the words they are, not as parts of the title. To me, `Do we like Google Guideline?` sounds like incorrect English.
delvh reviewed 2021-10-14 10:00:16 +00:00
@ -110,1 +110,4 @@
ctx.PageData["dashboardRepoList"] = map[string]interface{}{
"searchLimit": setting.UI.User.RepoPagingNum,
}
Contributor

That is also true.
Okay, then I'm fine with it.

That is also true. Okay, then I'm fine with it.
delvh reviewed 2021-10-14 10:00:44 +00:00
Contributor

Interesting. Then ignore my comment.

Interesting. Then ignore my comment.
wxiaoguang reviewed 2021-10-14 10:03:02 +00:00
Author
Contributor

That's how Vue works. If we want to add CSS style to the root element, I think it must be added to the template directly. Otherwise the attached element will be replaced.

That's how Vue works. If we want to add CSS style to the root element, I think it must be added to the template directly. Otherwise the attached element will be replaced.
6543 (Migrated from github.com) reviewed 2021-10-14 16:30:11 +00:00
@ -0,0 +27,4 @@
## General Guidelines
We recommend [Google HTML/CSS Style Guide](https://google.github.io/styleguide/htmlcssguide.html) and [Google JavaScript Style Guide](https://google.github.io/styleguide/jsguide.html)
6543 (Migrated from github.com) commented 2021-10-14 16:30:10 +00:00
Owner

this is bike shading ... and Germans do like the :D (I use it to much too - it's not so common if you listen to native speaker ....)

anyway lets just leave it as is!

this is bike shading ... and Germans do like the :D (I use it to much too - it's not so common if you listen to native speaker ....) anyway lets just leave it as is!
6543 (Migrated from github.com) reviewed 2021-10-14 16:33:16 +00:00
6543 (Migrated from github.com) commented 2021-10-14 16:33:16 +00:00
Owner

it's for the beginners ... let it be duplicated

it's for the beginners ... let it be duplicated
6543 (Migrated from github.com) approved these changes 2021-10-14 16:49:38 +00:00
lunny approved these changes 2021-10-15 02:17:17 +00:00
zeripath reviewed 2021-10-18 19:57:18 +00:00
@ -36,3 +28,3 @@
csrf: '{{.CsrfToken}}',
PageData: {{ .PageData }},
pageData: {{ .PageData }},
HighlightJS: {{if .RequireHighlightJS}}true{{else}}false{{end}},
Contributor

The dashboard repo list depended on the uid and removing this has broken the dashboard repo list.

The dashboard repo list depended on the uid and removing this has broken the dashboard repo list.
zeripath reviewed 2021-10-18 20:03:15 +00:00
@ -36,3 +28,3 @@
csrf: '{{.CsrfToken}}',
PageData: {{ .PageData }},
pageData: {{ .PageData }},
HighlightJS: {{if .RequireHighlightJS}}true{{else}}false{{end}},
Contributor

context_uid was used to fix the dashboard repo list for organisations too.

context_uid was used to fix the dashboard repo list for organisations too.
delvh reviewed 2021-10-18 20:04:52 +00:00
@ -36,3 +28,3 @@
csrf: '{{.CsrfToken}}',
PageData: {{ .PageData }},
pageData: {{ .PageData }},
HighlightJS: {{if .RequireHighlightJS}}true{{else}}false{{end}},
Contributor

But there has to be a better way to achieve this than adding it as a global header for every single page.
I dunno, what about the pageData mechanism?

But there has to be a better way to achieve this than adding it as a **global header for every single page**. I dunno, what about the `pageData` mechanism?
delvh reviewed 2021-10-18 20:06:59 +00:00
@ -36,3 +28,3 @@
csrf: '{{.CsrfToken}}',
PageData: {{ .PageData }},
pageData: {{ .PageData }},
HighlightJS: {{if .RequireHighlightJS}}true{{else}}false{{end}},
Contributor

Also, in what way did it break the dashboard repo list? Seemed fine to me, and I have a PR currently where I refactor that file (#17340)…

Also, in what way did it break the `dashboard repo list`? Seemed fine to me, and I have a PR currently where I refactor that file (#17340)…
This repo is archived. You cannot comment on pull requests.
No reviewers
No Milestone
No project
No Assignees
4 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: lunny/gitea#17301
No description provided.