<commit_before><!--
@license
Copyright (C) 2017 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script>
  (function(window) {
    'use strict';

    // Navigation parameters object format:
    //
    // Each object has a `view` property with a value from Gerrit.Nav.View. The
    // remaining properties depend on the value used for view.
    //
    //  - Gerrit.Nav.View.CHANGE:
    //    - `changeNum`, required, String: the numeric ID of the change.
    //    - `project`, optional, String: the project name.
    //    - `patchNum`, optional, Number: the patch for the right-hand-side of
    //        the diff.
    //    - `basePatchNum`, optional, Number: the patch for the left-hand-side
    //        of the diff. If `basePatchNum` is provided, then `patchNum` must
    //        also be provided.
    //    - `edit`, optional, Boolean: whether or not to load the file list with
    //        edit controls.
    //    - `messageHash`, optional, String: the hash of the change message to
    //        scroll to.
    //
    // - Gerrit.Nav.View.SEARCH:
    //    - `query`, optional, String: the literal search query. If provided,
    //        the string will be used as the query, and all other params will be
    //        ignored.
    //    - `owner`, optional, String: the owner name.
    //    - `project`, optional, String: the project name.
    //    - `branch`, optional, String: the branch name.
    //    - `topic`, optional, String: the topic name.
    //    - `hashtag`, optional, String: the hashtag name.
    //    - `statuses`, optional, Array<String>: the list of change statuses to
    //        search for. If more than one is provided, the search will OR them
    //        together.
    //    - `offset`, optional, Number: the offset for the query.
    //
    //  - Gerrit.Nav.View.DIFF:
    //    - `changeNum`, required, String: the numeric ID of the change.
    //    - `path`, required, String: the filepath of the diff.
    //    - `patchNum`, required, Number: the patch for the right-hand-side of
    //        the diff.
    //    - `basePatchNum`, optional, Number: the patch for the left-hand-side
    //        of the diff. If `basePatchNum` is provided, then `patchNum` must
    //        also be provided.
    //    - `lineNum`, optional, Number: the line number to be selected on load.
    //    - `leftSide`, optional, Boolean: if a `lineNum` is provided, a value
    //        of true selects the line from base of the patch range. False by
    //        default.
    //
    //  - Gerrit.Nav.View.GROUP:
    //    - `groupId`, required, String: the ID of the group.
    //    - `detail`, optional, String: the name of the group detail view.
    //      Takes any value from Gerrit.Nav.GroupDetailView.
    //
    //  - Gerrit.Nav.View.REPO:
    //    - `repoName`, required, String: the name of the repo
    //    - `detail`, optional, String: the name of the repo detail view.
    //      Takes any value from Gerrit.Nav.RepoDetailView.
    //
    //  - Gerrit.Nav.View.DASHBOARD
    //    - `repo`, optional, String.
    //    - `sections`, optional, Array of objects with `title` and `query`
    //      strings.
    //    - `user`, optional, String.
    //
    //  - Gerrit.Nav.View.ROOT:
    //    - no possible parameters.

    window.Gerrit = window.Gerrit || {};

    // Prevent redefinition.
    if (window.Gerrit.hasOwnProperty('Nav')) { return; }

    const uninitialized = () => {
      console.warn('Use of uninitialized routing');
    };

    const EDIT_PATCHNUM = 'edit';
    const PARENT_PATCHNUM = 'PARENT';

    const USER_PLACEHOLDER_PATTERN = /\$\{user\}/g;

    // NOTE: These queries are tested in Java. Any changes made to definitions
    // here require corresponding changes to:
    // javatests/com/google/gerrit/server/query/change/AbstractQueryChangesTest.java
    const DEFAULT_SECTIONS = [
      {
        // Changes with unpublished draft comments. This section is omitted when
        // viewing other users, so we don't need to filter anything out.
        name: 'Has draft comments',
        query: 'has:draft',
        selfOnly: true,
        hideIfEmpty: true,
        suffixForDashboard: 'limit:10',
      },
      {
        // Changes that are assigned to the viewed user.
        name: 'Assigned reviews',
        query: 'assignee:${user} (-is:wip OR owner:self OR assignee:self) ' +
            'is:open -is:ignored',
        hideIfEmpty: true,
      },
      {
        // WIP open changes owned by viewing user. This section is omitted when
        // viewing other users, so we don't need to filter anything out.
        name: 'Work in progress',
        query: 'is:open owner:${user} is:wip',
        selfOnly: true,
        hideIfEmpty: true,
      },
      {
        // Non-WIP open changes owned by viewed user. Filter out changes ignored
        // by the viewing user.
        name: 'Outgoing reviews',
        query: 'is:open owner:${user} -is:wip -is:ignored',
        isOutgoing: true,
      },
      {
        // Non-WIP open changes not owned by the viewed user, that the viewed user
        // is associated with (as either a reviewer or the assignee). Changes
        // ignored by the viewing user are filtered out.
        name: 'Incoming reviews',
        query: 'is:open -owner:${user} -is:wip -is:ignored ' +
            '(reviewer:${user} OR assignee:${user})',
      },
      {
        // Open changes the viewed user is CCed on. Changes ignored by the viewing
        // user are filtered out.
        name: 'CCed on',
        query: 'is:open -is:ignored cc:${user}',
      },
      {
        name: 'Recently closed',
        // Closed changes where viewed user is owner, reviewer, or assignee.
        // Changes ignored by the viewing user are filtered out, and so are WIP
        // changes not owned by the viewing user (the one instance of
        // 'owner:self' is intentional and implements this logic).
        query: 'is:closed -is:ignored (-is:wip OR owner:self) ' +
            '(owner:${user} OR reviewer:${user} OR assignee:${user} ' +
            'OR cc:${user})',
        suffixForDashboard: '-age:4w limit:10',
      },
    ];

    window.Gerrit.Nav = {<commit_msg>Ignore WIP changes in "CCed on" dashboard section<commit_after><!--
@license
Copyright (C) 2017 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script>
  (function(window) {
    'use strict';

    // Navigation parameters object format:
    //
    // Each object has a `view` property with a value from Gerrit.Nav.View. The
    // remaining properties depend on the value used for view.
    //
    //  - Gerrit.Nav.View.CHANGE:
    //    - `changeNum`, required, String: the numeric ID of the change.
    //    - `project`, optional, String: the project name.
    //    - `patchNum`, optional, Number: the patch for the right-hand-side of
    //        the diff.
    //    - `basePatchNum`, optional, Number: the patch for the left-hand-side
    //        of the diff. If `basePatchNum` is provided, then `patchNum` must
    //        also be provided.
    //    - `edit`, optional, Boolean: whether or not to load the file list with
    //        edit controls.
    //    - `messageHash`, optional, String: the hash of the change message to
    //        scroll to.
    //
    // - Gerrit.Nav.View.SEARCH:
    //    - `query`, optional, String: the literal search query. If provided,
    //        the string will be used as the query, and all other params will be
    //        ignored.
    //    - `owner`, optional, String: the owner name.
    //    - `project`, optional, String: the project name.
    //    - `branch`, optional, String: the branch name.
    //    - `topic`, optional, String: the topic name.
    //    - `hashtag`, optional, String: the hashtag name.
    //    - `statuses`, optional, Array<String>: the list of change statuses to
    //        search for. If more than one is provided, the search will OR them
    //        together.
    //    - `offset`, optional, Number: the offset for the query.
    //
    //  - Gerrit.Nav.View.DIFF:
    //    - `changeNum`, required, String: the numeric ID of the change.
    //    - `path`, required, String: the filepath of the diff.
    //    - `patchNum`, required, Number: the patch for the right-hand-side of
    //        the diff.
    //    - `basePatchNum`, optional, Number: the patch for the left-hand-side
    //        of the diff. If `basePatchNum` is provided, then `patchNum` must
    //        also be provided.
    //    - `lineNum`, optional, Number: the line number to be selected on load.
    //    - `leftSide`, optional, Boolean: if a `lineNum` is provided, a value
    //        of true selects the line from base of the patch range. False by
    //        default.
    //
    //  - Gerrit.Nav.View.GROUP:
    //    - `groupId`, required, String: the ID of the group.
    //    - `detail`, optional, String: the name of the group detail view.
    //      Takes any value from Gerrit.Nav.GroupDetailView.
    //
    //  - Gerrit.Nav.View.REPO:
    //    - `repoName`, required, String: the name of the repo
    //    - `detail`, optional, String: the name of the repo detail view.
    //      Takes any value from Gerrit.Nav.RepoDetailView.
    //
    //  - Gerrit.Nav.View.DASHBOARD
    //    - `repo`, optional, String.
    //    - `sections`, optional, Array of objects with `title` and `query`
    //      strings.
    //    - `user`, optional, String.
    //
    //  - Gerrit.Nav.View.ROOT:
    //    - no possible parameters.

    window.Gerrit = window.Gerrit || {};

    // Prevent redefinition.
    if (window.Gerrit.hasOwnProperty('Nav')) { return; }

    const uninitialized = () => {
      console.warn('Use of uninitialized routing');
    };

    const EDIT_PATCHNUM = 'edit';
    const PARENT_PATCHNUM = 'PARENT';

    const USER_PLACEHOLDER_PATTERN = /\$\{user\}/g;

    // NOTE: These queries are tested in Java. Any changes made to definitions
    // here require corresponding changes to:
    // javatests/com/google/gerrit/server/query/change/AbstractQueryChangesTest.java
    const DEFAULT_SECTIONS = [
      {
        // Changes with unpublished draft comments. This section is omitted when
        // viewing other users, so we don't need to filter anything out.
        name: 'Has draft comments',
        query: 'has:draft',
        selfOnly: true,
        hideIfEmpty: true,
        suffixForDashboard: 'limit:10',
      },
      {
        // Changes that are assigned to the viewed user.
        name: 'Assigned reviews',
        query: 'assignee:${user} (-is:wip OR owner:self OR assignee:self) ' +
            'is:open -is:ignored',
        hideIfEmpty: true,
      },
      {
        // WIP open changes owned by viewing user. This section is omitted when
        // viewing other users, so we don't need to filter anything out.
        name: 'Work in progress',
        query: 'is:open owner:${user} is:wip',
        selfOnly: true,
        hideIfEmpty: true,
      },
      {
        // Non-WIP open changes owned by viewed user. Filter out changes ignored
        // by the viewing user.
        name: 'Outgoing reviews',
        query: 'is:open owner:${user} -is:wip -is:ignored',
        isOutgoing: true,
      },
      {
        // Non-WIP open changes not owned by the viewed user, that the viewed user
        // is associated with (as either a reviewer or the assignee). Changes
        // ignored by the viewing user are filtered out.
        name: 'Incoming reviews',
        query: 'is:open -owner:${user} -is:wip -is:ignored ' +
            '(reviewer:${user} OR assignee:${user})',
      },
      {
        // Non-WIP open changes the viewed user is CCed on. Changes ignored by the
        // viewing user are filtered out.
        name: 'CCed on',
        query: 'is:open -is:wip -is:ignored cc:${user}',
      },
      {
        name: 'Recently closed',
        // Closed changes where viewed user is owner, reviewer, or assignee.
        // Changes ignored by the viewing user are filtered out, and so are WIP
        // changes not owned by the viewing user (the one instance of
        // 'owner:self' is intentional and implements this logic).
        query: 'is:closed -is:ignored (-is:wip OR owner:self) ' +
            '(owner:${user} OR reviewer:${user} OR assignee:${user} ' +
            'OR cc:${user})',
        suffixForDashboard: '-age:4w limit:10',
      },
    ];

    window.Gerrit.Nav = {
{'fraction_non_alphanumeric': 0.11594526253160792, 'fraction_numerical': 0.0019336605681987207, 'mean_word_length': 2.074302697759488, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1087705', 'n_tokens_mistral': 3922, 'n_tokens_neox': 3806, 'n_words': 1441}