From a39dc76645132fb848cb474a04178844bd6a70e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jarka=20Kadlecova=CC=81?= Date: Tue, 23 Jan 2018 08:03:01 +0100 Subject: Translate issuable sidebar --- doc/development/i18n/externalization.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/development') diff --git a/doc/development/i18n/externalization.md b/doc/development/i18n/externalization.md index f493ad4ae66..f4542932295 100644 --- a/doc/development/i18n/externalization.md +++ b/doc/development/i18n/externalization.md @@ -110,6 +110,8 @@ You can mark that content for translation with: In JavaScript we added the `__()` (double underscore parenthesis) function for translations. +In order to test JavaScript translations you have to change the GitLab localization to other language than English and you have to generate JSON files using `bundle exec rake gettext:po_to_json` or `bundle exec rake gettext:compile`. + ## Updating the PO files with the new content Now that the new content is marked for translation, we need to update the PO -- cgit v1.2.1 From c807a79979fe7c6335c625fcd0eaa9fd5cb900b2 Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Wed, 7 Feb 2018 14:24:47 +0100 Subject: Add a note about merge conflicts in `gitlab.pot` --- doc/development/i18n/externalization.md | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/development') diff --git a/doc/development/i18n/externalization.md b/doc/development/i18n/externalization.md index f493ad4ae66..695b2dbbfdb 100644 --- a/doc/development/i18n/externalization.md +++ b/doc/development/i18n/externalization.md @@ -124,6 +124,9 @@ strings and remove any strings that aren't used anymore. You should check this file in. Once the changes are on master, they will be picked up by [Crowdin](http://translate.gitlab.com) and be presented for translation. +If there are merge conflicts in the `gitlab.pot` file, you can delete the file +and regenerate it using the same command. Confirm that you are not deleting any strings accidentally by looking over the diff. + The command also updates the translation files for each language: `locale/*/gitlab.po` These changes can be discarded, the languange files will be updated by Crowdin automatically. -- cgit v1.2.1 From 917fb1744c10cdddd50c22bda690dfcca9a47eff Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Thu, 8 Feb 2018 09:15:45 +0100 Subject: [docs] Info rescheduling background migrations --- doc/development/background_migrations.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'doc/development') diff --git a/doc/development/background_migrations.md b/doc/development/background_migrations.md index af2026c483e..fc1b202b5eb 100644 --- a/doc/development/background_migrations.md +++ b/doc/development/background_migrations.md @@ -94,6 +94,18 @@ jobs = [['BackgroundMigrationClassName', [1]], BackgroundMigrationWorker.bulk_perform_in(5.minutes, jobs) ``` +### Rescheduling background migrations + +If one of the background migrations contains a bug that is fixed in a patch +release, the background migration needs to be rescheduled so the migration would +be repeated on systems that already performed the initial migration. + +When you reschedule the background migration, make sure to turn the original +scheduling into a no-op by clearing up the `#up` and `#down` methods of the +migration performing the scheduling. Otherwise the background migration would be +scheduled multiple times on systems that are upgrading multiple patch releases at +once. + ## Cleaning Up >**Note:** -- cgit v1.2.1 From 801f5205cd7b0837329d466875c32ebc3cdbedf5 Mon Sep 17 00:00:00 2001 From: Simon Knox Date: Thu, 8 Feb 2018 09:28:38 +0000 Subject: Update style_guide_scss.md --- doc/development/fe_guide/style_guide_scss.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/development') diff --git a/doc/development/fe_guide/style_guide_scss.md b/doc/development/fe_guide/style_guide_scss.md index 86a8b4135af..655d94793dd 100644 --- a/doc/development/fe_guide/style_guide_scss.md +++ b/doc/development/fe_guide/style_guide_scss.md @@ -7,6 +7,8 @@ easy to maintain, and performant for the end-user. ### Naming +Filenames should use `snake_case`. + CSS classes should use the `lowercase-hyphenated` format rather than `snake_case` or `camelCase`. -- cgit v1.2.1 From 469148b23184a1dd2d5ce6ceedcce48c2b02a7d1 Mon Sep 17 00:00:00 2001 From: George Tsiolis Date: Thu, 8 Feb 2018 21:06:18 +0200 Subject: Update vue component naming guidelines --- doc/development/fe_guide/style_guide_js.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'doc/development') diff --git a/doc/development/fe_guide/style_guide_js.md b/doc/development/fe_guide/style_guide_js.md index 02773162801..cd26baa4243 100644 --- a/doc/development/fe_guide/style_guide_js.md +++ b/doc/development/fe_guide/style_guide_js.md @@ -302,20 +302,20 @@ Please check this [rules][eslint-plugin-vue-rules] for more documentation. #### Naming 1. **Extensions**: Use `.vue` extension for Vue components. -1. **Reference Naming**: Use camelCase for their instances: +1. **Reference Naming**: Use PascalCase for their instances: ```javascript // bad - import CardBoard from 'cardBoard' + import cardBoard from 'cardBoard.vue' components: { - CardBoard: + cardBoard, }; // good - import cardBoard from 'cardBoard' + import CardBoard from 'cardBoard.vue' components: { - cardBoard: + CardBoard, }; ``` -- cgit v1.2.1 From c5a3dfe1a67184fe9fc215907030506db404a3eb Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Fri, 9 Feb 2018 10:53:07 +0000 Subject: Improve docs about allowing some side effects on the constructor --- doc/development/fe_guide/style_guide_js.md | 33 ++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'doc/development') diff --git a/doc/development/fe_guide/style_guide_js.md b/doc/development/fe_guide/style_guide_js.md index 02773162801..2e2d58b6d66 100644 --- a/doc/development/fe_guide/style_guide_js.md +++ b/doc/development/fe_guide/style_guide_js.md @@ -207,10 +207,39 @@ Do not use them anymore and feel free to remove them when refactoring legacy cod var c = pureFunction(values.foo); ``` -1. Avoid constructors with side-effects +1. Avoid constructors with side-effects. +Although we aim for code without side-effects we need some side-effects for our code to run. + +If the class won't do anything if we only instantiate it, it's ok to add side effects into the constructor (_Note:_ The following it's just an example. If the all purpose of the class is to add an event listener and handle the callback a function will be more suitable.) + +```javascript +// Bad +export class Foo { + constructor() { + this.init(); + } + init() { + document.addEventListener('click', this.handleCallback) + }, + handleCallback() { + + } +} + +// Good +export class Foo { + constructor() { + document.addEventListener() + } + handleCallback() { + } +} +``` + +On the other hand, if a class only needs to extend a third party/add event listeners in some specific cases, they should be inited oustside of the constructor. 1. Prefer `.map`, `.reduce` or `.filter` over `.forEach` -A forEach will cause side effects, it will be mutating the array being iterated. Prefer using `.map`, +A forEach will most likely cause side effects, it will be mutating the array being iterated. Prefer using `.map`, `.reduce` or `.filter` ```javascript const users = [ { name: 'Foo' }, { name: 'Bar' } ]; -- cgit v1.2.1 From ee8ac683f704849d5d57a5f943a97b4ffbc2aeb4 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Fri, 9 Feb 2018 12:01:05 +0000 Subject: Fix english in style_guide_js.md --- doc/development/fe_guide/style_guide_js.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/development') diff --git a/doc/development/fe_guide/style_guide_js.md b/doc/development/fe_guide/style_guide_js.md index 2e2d58b6d66..26eda80685e 100644 --- a/doc/development/fe_guide/style_guide_js.md +++ b/doc/development/fe_guide/style_guide_js.md @@ -210,7 +210,7 @@ Do not use them anymore and feel free to remove them when refactoring legacy cod 1. Avoid constructors with side-effects. Although we aim for code without side-effects we need some side-effects for our code to run. -If the class won't do anything if we only instantiate it, it's ok to add side effects into the constructor (_Note:_ The following it's just an example. If the all purpose of the class is to add an event listener and handle the callback a function will be more suitable.) +If the class won't do anything if we only instantiate it, it's ok to add side effects into the constructor (_Note:_ The following is just an example. If the only purpose of the class is to add an event listener and handle the callback a function will be more suitable.) ```javascript // Bad @@ -236,7 +236,7 @@ export class Foo { } ``` -On the other hand, if a class only needs to extend a third party/add event listeners in some specific cases, they should be inited oustside of the constructor. +On the other hand, if a class only needs to extend a third party/add event listeners in some specific cases, they should be initialized oustside of the constructor. 1. Prefer `.map`, `.reduce` or `.filter` over `.forEach` A forEach will most likely cause side effects, it will be mutating the array being iterated. Prefer using `.map`, -- cgit v1.2.1 From e8648270affc4954f619aa7bd64a2f6e988f8a8a Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Tue, 13 Feb 2018 16:08:02 +1100 Subject: Document all_queues.yml in sidekiq_style_guide.md --- doc/development/sidekiq_style_guide.md | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/development') diff --git a/doc/development/sidekiq_style_guide.md b/doc/development/sidekiq_style_guide.md index 59ebf41e09f..b3e74fc71cc 100644 --- a/doc/development/sidekiq_style_guide.md +++ b/doc/development/sidekiq_style_guide.md @@ -17,6 +17,9 @@ would be `process_something`. If you're not sure what queue a worker uses, you can find it using `SomeWorker.queue`. There is almost never a reason to manually override the queue name using `sidekiq_options queue: :some_queue`. +You must always add any new queues to `gitlab/app/workers/all_queues.yml` +otherwise your worker will not run. + ## Queue Namespaces While different workers cannot share a queue, they can share a queue namespace. -- cgit v1.2.1 From bbcc18080b90bb21465d8b843f93703eca4a7c6f Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Tue, 13 Feb 2018 05:10:04 +0000 Subject: Update sidekiq_style_guide.md --- doc/development/sidekiq_style_guide.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/development') diff --git a/doc/development/sidekiq_style_guide.md b/doc/development/sidekiq_style_guide.md index b3e74fc71cc..76ff51446ba 100644 --- a/doc/development/sidekiq_style_guide.md +++ b/doc/development/sidekiq_style_guide.md @@ -17,8 +17,8 @@ would be `process_something`. If you're not sure what queue a worker uses, you can find it using `SomeWorker.queue`. There is almost never a reason to manually override the queue name using `sidekiq_options queue: :some_queue`. -You must always add any new queues to `gitlab/app/workers/all_queues.yml` -otherwise your worker will not run. +You must always add any new queues to `app/workers/all_queues.yml` otherwise +your worker will not run. ## Queue Namespaces -- cgit v1.2.1 From 2bdb578032073f09f41e16c7114f96899aa17927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Tue, 13 Feb 2018 15:41:47 +0100 Subject: Port some RuboCop and doc changes from EE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- doc/development/ee_features.md | 7 +++---- doc/development/testing_guide/testing_levels.md | 4 ++++ 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'doc/development') diff --git a/doc/development/ee_features.md b/doc/development/ee_features.md index f8cee89e650..f6a14de96b2 100644 --- a/doc/development/ee_features.md +++ b/doc/development/ee_features.md @@ -28,9 +28,8 @@ we still need to merge changes from GitLab CE to EE. To help us get there, we should make sure that we no longer edit CE files in place in order to implement EE features. -Instead, all EE codes should be put inside the `ee/` top-level directory, and -tests should be put inside `spec/ee/`. We don't use `ee/spec` for now due to -technical limitation. The rest of codes should be as close as to the CE files. +Instead, all EE code should be put inside the `ee/` top-level directory. The +rest of the code should be as close to the CE files as possible. [single code base]: https://gitlab.com/gitlab-org/gitlab-ee/issues/2952#note_41016454 @@ -318,7 +317,7 @@ When you're testing EE-only features, avoid adding examples to the existing CE specs. Also do no change existing CE examples, since they should remain working as-is when EE is running without a license. -Instead place EE specs in the `spec/ee/spec` folder. +Instead place EE specs in the `ee/spec` folder. ## JavaScript code in `assets/javascripts/` diff --git a/doc/development/testing_guide/testing_levels.md b/doc/development/testing_guide/testing_levels.md index 4adf0dc7c7a..e86c1f5232a 100644 --- a/doc/development/testing_guide/testing_levels.md +++ b/doc/development/testing_guide/testing_levels.md @@ -134,6 +134,10 @@ learn more. [GitLab QA]: https://gitlab.com/gitlab-org/gitlab-qa [part of GitLab Rails]: https://gitlab.com/gitlab-org/gitlab-ce/tree/master/qa +## EE-specific tests + +EE-specific tests follows the same organization, but under the `ee/spec` folder. + ## How to test at the correct level? As many things in life, deciding what to test at each level of testing is a -- cgit v1.2.1 From e3bd674e81d565ef3bd399a70b3039316b518693 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Tue, 13 Feb 2018 16:40:23 +0100 Subject: Remove Sentry reporting for query limiting Using Sentry, while useful, poses two problems you have to choose from: 1. All errors are reported separately, making it easy to create issues but also making it next to impossible to see other errors (due to the sheer volume of threshold errors). 2. Errors can be grouped or merged together, reducing the noise. This however also means it's (as far as I can tell) much harder to automatically create GitLab issues from Sentry for the offending controllers. Since both solutions are terrible I decided to go with a third option: not using Sentry for this at all. Instead we'll investigate using Prometheus alerts and Grafana dashboards for this, which has the added benefit of being able to more accurately measure the behaviour over time. Note that throwing errors in test environments is still enabled, and whitelisting is still necessary to prevent that from happening (and that in turn still requires that developers create issues). --- doc/development/query_count_limits.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'doc/development') diff --git a/doc/development/query_count_limits.md b/doc/development/query_count_limits.md index ebb6e0c2dac..310e3faf61b 100644 --- a/doc/development/query_count_limits.md +++ b/doc/development/query_count_limits.md @@ -1,8 +1,7 @@ # Query Count Limits -Each controller or API endpoint is allowed to execute up to 100 SQL queries. In -a production environment we'll only log an error in case this threshold is -exceeded, but in a test environment we'll raise an error instead. +Each controller or API endpoint is allowed to execute up to 100 SQL queries and +in test environments we'll raise an error when this threshold is exceeded. ## Solving Failing Tests -- cgit v1.2.1 From 6377228717ff658ee1c61f0e6618df3dd7de454b Mon Sep 17 00:00:00 2001 From: James Ramsay Date: Tue, 13 Feb 2018 21:10:42 +0000 Subject: Add clearer proofreader process to docs --- doc/development/i18n/index.md | 28 +--------------------- doc/development/i18n/proofreader.md | 47 +++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 27 deletions(-) create mode 100644 doc/development/i18n/proofreader.md (limited to 'doc/development') diff --git a/doc/development/i18n/index.md b/doc/development/i18n/index.md index 8aa0462d213..176f3cdeae5 100644 --- a/doc/development/i18n/index.md +++ b/doc/development/i18n/index.md @@ -44,33 +44,7 @@ Proof reading helps ensure the accuracy and consistency of translations. All translations are proof read before being accepted. If a translations requires changes, you will be notified with a comment explaining why. -Community assistance proof reading translations is encouraged and appreciated. -Requests to become a proof reader will be considered on the merits of previous translations. - -- Bulgarian -- Chinese Simplified - - [Huang Tao](https://crowdin.com/profile/htve) -- Chinese Traditional - - [Huang Tao](https://crowdin.com/profile/htve) -- Chinese Traditional, Hong Kong - - [Huang Tao](https://crowdin.com/profile/htve) -- Dutch -- Esperanto -- French -- German -- Italian - - [Paolo Falomo](https://crowdin.com/profile/paolo.falomo) -- Japanese -- Korean - - [Huang Tao](https://crowdin.com/profile/htve) -- Portuguese, Brazilian -- Russian - - [Alexy Lustin](https://crowdin.com/profile/lustin) - - [Nikita Grylov](https://crowdin.com/profile/nixel2007) -- Spanish -- Ukrainian - -If you would like to be added as a proof reader, please [open an issue](https://gitlab.com/gitlab-org/gitlab-ce/issues). +See [Proofreading translations](proofreader.md). ## Release diff --git a/doc/development/i18n/proofreader.md b/doc/development/i18n/proofreader.md new file mode 100644 index 00000000000..c4c4cd033d1 --- /dev/null +++ b/doc/development/i18n/proofreader.md @@ -0,0 +1,47 @@ +# Proofread Translations + +Most translations are contributed, reviewed and accepted by the community. We +are very appreciative of the work done by translators and proofreaders! + +## Proofreaders + +- Bulgarian +- Chinese Simplified + - Huang Tao - [GitLab](https://gitlab.com/htve), [Crowdin](https://crowdin.com/profile/htve) +- Chinese Traditional + - Huang Tao - [GitLab](https://gitlab.com/htve), [Crowdin](https://crowdin.com/profile/htve) +- Chinese Traditional, Hong Kong + - Huang Tao - [GitLab](https://gitlab.com/htve), [Crowdin](https://crowdin.com/profile/htve) +- Dutch +- Esperanto +- French +- German +- Italian + - Paolo Falomo - [GitLab](https://gitlab.com/paolofalomo), [Crowdin](https://crowdin.com/profile/paolo.falomo) +- Japanese +- Korean + - Huang Tao - [GitLab](https://gitlab.com/htve), [Crowdin](https://crowdin.com/profile/htve) +- Portuguese, Brazilian + - Paulo George Gomes Bezerra - [GitLab](https://gitlab.com/paulobezerra), [Crowdin](https://crowdin.com/profile/paulogomes.rep) +- Russian + - Nikita Grylov - [GitLab](https://gitlab.com/nixel2007), [Crowdin](https://crowdin.com/profile/nixel2007) + - Alexy Lustin - [GitLab](https://gitlab.com/allustin), [Crowdin](https://crowdin.com/profile/lustin) +- Spanish +- Ukrainian + - Volodymyr Sobotovych - [GitLab](https://gitlab.com/wheleph), [Crowdin](https://crowdin.com/profile/wheleph) + - Andrew Vityuk - [GitLab](https://gitlab.com/3_1_3_u), [Crowdin](https://crowdin.com/profile/andruwa13) + +## Become a proofreader + +> **Note:** Before requesting Proofreader permissions in Crowdin please make +> sure that you have a history of contributing translations to the GitLab +> project. + +1. Once your translations have been accepted, + [open a merge request](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/new) + to request Proofreader permissions and add yourself to the list above. + + Please include links to any projects you have previously translated. + +1. Your request to become a proofreader will be considered on the merits of + your previous translations. -- cgit v1.2.1 From 97988590a89b5c29dc83e45cee8c000ffd569e45 Mon Sep 17 00:00:00 2001 From: James Ramsay Date: Tue, 13 Feb 2018 21:51:12 +0000 Subject: Fix punctuation and address feedback --- doc/development/i18n/index.md | 9 +++++---- doc/development/i18n/proofreader.md | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'doc/development') diff --git a/doc/development/i18n/index.md b/doc/development/i18n/index.md index 176f3cdeae5..7290a175501 100644 --- a/doc/development/i18n/index.md +++ b/doc/development/i18n/index.md @@ -40,11 +40,12 @@ See [Translation guidelines](translation.md). ### Proof reading -Proof reading helps ensure the accuracy and consistency of translations. -All translations are proof read before being accepted. -If a translations requires changes, you will be notified with a comment explaining why. +Proof reading helps ensure the accuracy and consistency of translations. All +translations are proof read before being accepted. If a translations requires +changes, you will be notified with a comment explaining why. -See [Proofreading translations](proofreader.md). +See [Proofreading Translations](proofreader.md) for more information on who's +able to proofread and instructions on becoming a proofreader yourself. ## Release diff --git a/doc/development/i18n/proofreader.md b/doc/development/i18n/proofreader.md index c4c4cd033d1..795e1e83105 100644 --- a/doc/development/i18n/proofreader.md +++ b/doc/development/i18n/proofreader.md @@ -1,6 +1,6 @@ # Proofread Translations -Most translations are contributed, reviewed and accepted by the community. We +Most translations are contributed, reviewed, and accepted by the community. We are very appreciative of the work done by translators and proofreaders! ## Proofreaders @@ -41,7 +41,8 @@ are very appreciative of the work done by translators and proofreaders! [open a merge request](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/new) to request Proofreader permissions and add yourself to the list above. - Please include links to any projects you have previously translated. + In the merge request description, please include links to any projects you + have previously translated. 1. Your request to become a proofreader will be considered on the merits of your previous translations. -- cgit v1.2.1 From 5e2c1778c26cb1f5dceb1eb5aeb64463e0f2a211 Mon Sep 17 00:00:00 2001 From: Job van der Voort Date: Wed, 14 Feb 2018 12:40:06 +0000 Subject: clarify what kind of feature flags we support --- doc/development/feature_flags.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'doc/development') diff --git a/doc/development/feature_flags.md b/doc/development/feature_flags.md index 59e8a087e02..5d1f657015c 100644 --- a/doc/development/feature_flags.md +++ b/doc/development/feature_flags.md @@ -1,6 +1,6 @@ # Manage feature flags -Starting from GitLab 9.3 we support feature flags via +Starting from GitLab 9.3 we support feature flags for features in GitLab via [Flipper](https://github.com/jnunemaker/flipper/). You should use the `Feature` class (defined in `lib/feature.rb`) in your code to get, set and list feature flags. @@ -19,3 +19,8 @@ dynamic (querying the DB etc.). Once defined in `lib/feature.rb`, you will be able to activate a feature for a given feature group via the [`feature_group` param of the features API](../api/features.md#set-or-create-a-feature) + +## Feature flags for user applications + +GitLab does not yet support the use of feature flags in deployed user applications. +You can follow the progress on that [in the issue on our issue tracker](https://gitlab.com/gitlab-org/gitlab-ee/issues/779). \ No newline at end of file -- cgit v1.2.1 From 05f66d1342db228c1a659b4c58e15c890b522261 Mon Sep 17 00:00:00 2001 From: Winnie Hellmann Date: Wed, 14 Feb 2018 10:16:04 +0100 Subject: Add new modal Vue component --- doc/development/fe_guide/components.md | 61 ++++++++++++++++++++++++++++++ doc/development/fe_guide/dropdowns.md | 33 +--------------- doc/development/fe_guide/img/gl-modal.png | Bin 0 -> 25893 bytes doc/development/fe_guide/index.md | 6 ++- 4 files changed, 66 insertions(+), 34 deletions(-) create mode 100644 doc/development/fe_guide/components.md create mode 100644 doc/development/fe_guide/img/gl-modal.png (limited to 'doc/development') diff --git a/doc/development/fe_guide/components.md b/doc/development/fe_guide/components.md new file mode 100644 index 00000000000..66a8abe42f7 --- /dev/null +++ b/doc/development/fe_guide/components.md @@ -0,0 +1,61 @@ +# Components + +## Contents +* [Dropdowns](#dropdowns) +* [Modals](#modals) + +## Dropdowns + +See also the [corresponding UX guide](../ux_guide/components.md#dropdowns). + +### How to style a bootstrap dropdown +1. Use the HTML structure provided by the [docs][bootstrap-dropdowns] +1. Add a specific class to the top level `.dropdown` element + + + ```Haml + .dropdown.my-dropdown + %button{ type: 'button', data: { toggle: 'dropdown' }, 'aria-haspopup': true, 'aria-expanded': false } + %span.dropdown-toggle-text + Toggle Dropdown + = icon('chevron-down') + + %ul.dropdown-menu + %li + %a + item! + ``` + + Or use the helpers + ```Haml + .dropdown.my-dropdown + = dropdown_toggle('Toogle!', { toggle: 'dropdown' }) + = dropdown_content + %li + %a + item! + ``` + +[bootstrap-dropdowns]: https://getbootstrap.com/docs/3.3/javascript/#dropdowns + +## Modals + +See also the [corresponding UX guide](../ux_guide/components.md#modals). + +We have a reusable Vue component for modals: [vue_shared/components/gl-modal.vue](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/assets/javascripts/vue_shared/components/gl-modal.vue) + +Here is an example of how to use it: + +```html + + {{ s__('ModalExample|You’re about to let the dogs out.') }} + +``` + +![example modal](img/gl-modal.png) diff --git a/doc/development/fe_guide/dropdowns.md b/doc/development/fe_guide/dropdowns.md index 6314f8f38d2..e9d6244355c 100644 --- a/doc/development/fe_guide/dropdowns.md +++ b/doc/development/fe_guide/dropdowns.md @@ -1,32 +1 @@ -# Dropdowns - - -## How to style a bootstrap dropdown -1. Use the HTML structure provided by the [docs][bootstrap-dropdowns] -1. Add a specific class to the top level `.dropdown` element - - - ```Haml - .dropdown.my-dropdown - %button{ type: 'button', data: { toggle: 'dropdown' }, 'aria-haspopup': true, 'aria-expanded': false } - %span.dropdown-toggle-text - Toggle Dropdown - = icon('chevron-down') - - %ul.dropdown-menu - %li - %a - item! - ``` - - Or use the helpers - ```Haml - .dropdown.my-dropdown - = dropdown_toggle('Toogle!', { toggle: 'dropdown' }) - = dropdown_content - %li - %a - item! - ``` - -[bootstrap-dropdowns]: https://getbootstrap.com/docs/3.3/javascript/#dropdowns +This page has moved [here](components.md#dropdowns). diff --git a/doc/development/fe_guide/img/gl-modal.png b/doc/development/fe_guide/img/gl-modal.png new file mode 100644 index 00000000000..47302e857bc Binary files /dev/null and b/doc/development/fe_guide/img/gl-modal.png differ diff --git a/doc/development/fe_guide/index.md b/doc/development/fe_guide/index.md index 72cb557d054..5c2e50e8c8e 100644 --- a/doc/development/fe_guide/index.md +++ b/doc/development/fe_guide/index.md @@ -77,8 +77,10 @@ Axios specific practices and gotchas. ## [Icons](icons.md) How we use SVG for our Icons. -## [Dropdowns](dropdowns.md) -How we use dropdowns. +## [Components](components.md) + +How we use UI components. + --- ## Style Guides -- cgit v1.2.1 From 4634e3a109f2b3a761bf959128812226b425fc7d Mon Sep 17 00:00:00 2001 From: Clement Ho Date: Thu, 15 Feb 2018 17:19:54 -0600 Subject: Add axios to frontend docs as the default network request library --- doc/development/fe_guide/index.md | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/development') diff --git a/doc/development/fe_guide/index.md b/doc/development/fe_guide/index.md index 5c2e50e8c8e..12dfc10812b 100644 --- a/doc/development/fe_guide/index.md +++ b/doc/development/fe_guide/index.md @@ -21,6 +21,8 @@ Working with our frontend assets requires Node (v4.3 or greater) and Yarn [jQuery][jquery] is used throughout the application's JavaScript, with [Vue.js][vue] for particularly advanced, dynamic elements. +We also use [Axios][axios] to handle all of our network requests. + ### Browser Support For our currently-supported browsers, see our [requirements][requirements]. @@ -124,6 +126,7 @@ The [externalization part of the guide](../i18n/externalization.md) explains the [webpack]: https://webpack.js.org/ [jquery]: https://jquery.com/ [vue]: http://vuejs.org/ +[axios]: https://github.com/axios/axios [airbnb-js-style-guide]: https://github.com/airbnb/javascript [scss-lint]: https://github.com/brigade/scss-lint [install]: ../../install/installation.md#4-node -- cgit v1.2.1 From bda4f0811e3d7f3530d1d6c338e2de6ada5bf1f2 Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Fri, 16 Feb 2018 17:38:45 +1100 Subject: Improve error handling for Gitlab::Profiler and improve doc about providing a user --- doc/development/profiling.md | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'doc/development') diff --git a/doc/development/profiling.md b/doc/development/profiling.md index 97c997e0568..11878b4009b 100644 --- a/doc/development/profiling.md +++ b/doc/development/profiling.md @@ -27,6 +27,17 @@ Gitlab::Profiler.profile('/my-user') # Returns a RubyProf::Profile where 100 seconds is spent in UsersController#show ``` +For routes that require authorization you will need to provide a user to +`Gitlab::Profiler`. You can do this like so: + +```ruby +Gitlab::Profiler.profile('/gitlab-org/gitlab-test', user: User.first) +``` + +The user you provide will need to have a [personal access +token](https://docs.gitlab.com/ce/user/profile/personal_access_tokens.html) in +the GitLab instance. + Passing a `logger:` keyword argument to `Gitlab::Profiler.profile` will send ActiveRecord and ActionController log output to that logger. Further options are documented with the method source. -- cgit v1.2.1