User email automatically added to OT contacts list (#3339)

* Add 3 more fields for OT creation

* `stage_description` -> `ot_description`

With a more detailed description of the field and its relation to OT

* remove test line

* Add basic UI for trial creation request

* Add `ot_feedback_submission_url` to ot creation

* ot button only shows on ot stage details

* Update chromedash-feature-detail.js

* fix OT button

* cancel button returns to feature detail

* add ot milestone fields

* Update chromedash-feature-detail.js

* Squashed commit of the following:

commit 142f605e74
Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com>
Date:   Wed Sep 20 15:06:53 2023 -0700

    Update chromedash-feature-detail.js

commit 83c98ea8a9
Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com>
Date:   Wed Sep 20 15:00:01 2023 -0700

    add ot milestone fields

commit b50933fcb6
Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com>
Date:   Mon Sep 18 09:18:46 2023 -0700

    cancel button returns to feature detail

commit 9047830f20
Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com>
Date:   Mon Sep 18 09:02:06 2023 -0700

    fix OT button

commit b442dfd495
Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com>
Date:   Mon Sep 18 08:49:21 2023 -0700

    Update chromedash-feature-detail.js

commit e78ed6bab1
Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com>
Date:   Mon Sep 18 08:44:07 2023 -0700

    ot button only shows on ot stage details

commit a2d8df8047
Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com>
Date:   Fri Sep 15 16:04:52 2023 -0700

    Add `ot_feedback_submission_url` to ot creation

commit cb0b1e621f
Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com>
Date:   Fri Sep 15 14:16:22 2023 -0700

    Add basic UI for trial creation request

commit a843707680
Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com>
Date:   Wed Sep 13 12:50:19 2023 -0700

    remove test line

commit 1b471fad6f
Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com>
Date:   Wed Sep 13 12:46:44 2023 -0700

    `stage_description` -> `ot_description`

    With a more detailed description of the field and its relation to OT

commit cc0308efc7
Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com>
Date:   Wed Sep 13 10:53:06 2023 -0700

    Add 3 more fields for OT creation

* Add `ot_owner_email` and `ot_display_name` fields

* Add 3 more fields for OT creation

* `stage_description` -> `ot_description`

With a more detailed description of the field and its relation to OT

* remove test line

* Add basic UI for trial creation request

* user email automatically added to ot contacts list

* update to use new `ot_owner_email` field

* fix test
This commit is contained in:
Daniel Smith 2023-09-22 10:53:11 -07:00 коммит произвёл GitHub
Родитель 062b119a1e
Коммит 164e35bea5
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -378,6 +378,7 @@ class ChromedashApp extends LitElement {
this.pageComponent.stageId = parseInt(ctx.params.stageId);
this.pageComponent.nextPage = this.currentPage;
this.pageComponent.appTitle = this.appTitle;
this.pageComponent.userEmail = this.user.email;
this.currentPage = ctx.path;
this.hideSidebar();
});

Просмотреть файл

@ -25,6 +25,7 @@ export class ChromedashOTCreationPage extends LitElement {
return {
stageId: {type: Number},
featureId: {type: Number},
userEmail: {type: String},
feature: {type: Object},
loading: {type: Boolean},
appTitle: {type: String},
@ -102,7 +103,6 @@ export class ChromedashOTCreationPage extends LitElement {
handleFormSubmit(e) {
e.preventDefault();
const submitBody = formatFeatureChanges(this.fieldValues, this.featureId);
csClient.updateFeature(submitBody).then(() => {
window.location.href = this.nextPage || `/feature/${this.featureId}`;
}).catch(() => {
@ -153,11 +153,17 @@ export class ChromedashOTCreationPage extends LitElement {
renderFields(section) {
const fields = section.fields.map(field => {
const value = getStageValue(this.stage, field);
let touched = false;
// The requester's email should be a contact by default.
if (field === 'ot_owner_email' && !value) {
value = [this.userEmail];
touched = true;
}
// Add the field to this component's stage before creating the field component.
const index = this.fieldValues.length;
this.fieldValues.push({
name: field,
touched: false,
touched,
value,
stageId: this.stage.id,
});