Skip to content

refactor(nimbus): refactor experimenter redesign views#16003

Merged
moibra05 merged 1 commit into
mainfrom
15949
Jun 18, 2026
Merged

refactor(nimbus): refactor experimenter redesign views#16003
moibra05 merged 1 commit into
mainfrom
15949

Conversation

@moibra05

@moibra05 moibra05 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Because

  • As we continue to work on the new experimenter pages it is becoming increasingly cluttered and confusing to work between files

This commit

  • Moves views related to the new designs into nimbus_ui/new/views.py with accompanying tests in nimbus_ui/tests/test_new_views.py
  • Adds a few missing forms and respective tests used by the copied views

Fixes #15949

@moibra05

Copy link
Copy Markdown
Contributor Author

Merge after #15960

Comment on lines +109 to +130
class NimbusExperimentCreateForm(NimbusChangeLogFormMixin, forms.ModelForm):
owner = forms.ModelChoiceField(
User.objects.all(),
widget=forms.widgets.HiddenInput(),
)
name = forms.CharField(
label="",
widget=forms.widgets.TextInput(
attrs={
"placeholder": "Public Name",
}
),
)
slug = forms.CharField(
required=False,
widget=forms.widgets.HiddenInput(),
)
hypothesis = forms.CharField(
label="",
widget=forms.widgets.Textarea(),
initial=NimbusUIConstants.HYPOTHESIS_PLACEHOLDER,
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why are we adding this form here? I don't think we have added the functionality to create in the design yet

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

NimbusRolloutDetailView inherits from NimbusExperimentViewMixin and CloneExperimentFormMixin which both use those forms

Comment on lines +188 to +215
class NimbusExperimentSidebarCloneForm(NimbusChangeLogFormMixin, forms.ModelForm):
owner = forms.ModelChoiceField(
User.objects.all(),
widget=forms.widgets.HiddenInput(),
)
name = forms.CharField(
required=True, widget=forms.TextInput(attrs={"class": "form-control"})
)
slug = forms.CharField(
required=False,
widget=forms.widgets.HiddenInput(),
)

class Meta:
model = NimbusExperiment
fields = ["owner", "name", "slug"]

def clean_name(self):
name = self.cleaned_data["name"]
slug = slugify(name)
if not slug:
raise forms.ValidationError(NimbusUIConstants.ERROR_NAME_INVALID)
if NimbusExperiment.objects.filter(slug=slug).exists():
raise forms.ValidationError(
NimbusUIConstants.ERROR_NAME_MAPS_TO_EXISTING_SLUG
)
return name

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same this not using yet

@yashikakhurana yashikakhurana left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

sounds good lets merged this, thank you @moibra05

@moibra05 moibra05 added this pull request to the merge queue Jun 18, 2026
Merged via the queue into main with commit e727da5 Jun 18, 2026
26 checks passed
@moibra05 moibra05 deleted the 15949 branch June 18, 2026 18:40
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.

Group new experimenter design views

2 participants