Skip to content

Commit 8922c41

Browse files
committed
minor: fix before and after the SlugPreviewFormField
1 parent e5bd17b commit 8922c41

File tree

9 files changed

+61
-26
lines changed

9 files changed

+61
-26
lines changed

client/src/features/dataConnectorsV2/components/DataConnectorModal/DataConnectorModalBody.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,6 @@ export function DataConnectorMount({
400400
<div className="invalid-feedback">
401401
{errors.name?.message?.toString()}
402402
</div>
403-
</div>
404-
405-
<div className="mb-3">
406403
<SlugPreviewFormField
407404
compact={true}
408405
control={control}

client/src/features/groupsV2/new/GroupNew.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,13 @@ function GroupV2CreationDetails() {
174174
>
175175
<FormGroup className="d-inline" disabled={result.isLoading}>
176176
<div className={cx("d-flex", "flex-column", "gap-3")}>
177-
<div>
178-
<div className="mb-1">
179-
<NameFormField
180-
control={control}
181-
entityName="group"
182-
errors={errors}
183-
name="name"
184-
/>
185-
</div>
177+
<div className="mb-1">
178+
<NameFormField
179+
control={control}
180+
entityName="group"
181+
errors={errors}
182+
name="name"
183+
/>
186184

187185
<SlugPreviewFormField
188186
compact={true}

client/src/features/project/components/projectMigration/ProjectMigrationFormInputs.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ export default function ProjectMigrationFormInputs({
112112
errors={errors}
113113
name="namespace"
114114
/>
115-
</div>
116-
<div>
117115
<SlugPreviewFormField
118116
compact={true}
119117
control={control}

client/src/features/projectsV2/fields/SlugPreviewFormField.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ export default function SlugPreviewFormField<T extends FieldValues>({
4444
const url = `${baseUrl}${parentPath}`;
4545

4646
const slugPreview = (
47-
<div>
47+
// Compensate for the mb-1 on the button which is needed to align with the text
48+
<div className="mb-n1">
4849
<FormText className="me-2">
4950
The URL for this {entityName} will be{" "}
5051
<span className="fw-bold" data-cy={`${entityName}-url-preview`}>

client/src/features/projectsV2/new/ProjectV2New.tsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -199,17 +199,15 @@ function ProjectV2CreationDetails() {
199199
formId={formId}
200200
name="name"
201201
/>
202-
<div>
203-
<div className="mb-1">
204-
<ProjectNamespaceFormField
205-
control={control}
206-
ensureNamespace={defaultNamespace}
207-
entityName={`${formId}-project`}
208-
errors={errors}
209-
name="namespace"
210-
/>
211-
</div>
212202

203+
<div className="mb-1">
204+
<ProjectNamespaceFormField
205+
control={control}
206+
ensureNamespace={defaultNamespace}
207+
entityName={`${formId}-project`}
208+
errors={errors}
209+
name="namespace"
210+
/>
213211
<SlugPreviewFormField
214212
compact={true}
215213
control={control}

client/src/styles/renku_bootstrap_customization.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// Functions: should be imported first
22
@import "~bootstrap/scss/functions";
33

4+
// Enable negative margins utility
5+
$enable-negative-margins: true;
6+
47
// Font
58
@import "./fonts/fonts";
69
$font-family-base: "Inter", sans-serif;

tests/cypress/e2e/projectV2setup.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ describe("Set up data connectors", () => {
207207
namespace: "user1-uuid/test-2-v2-project",
208208
visibility: "public",
209209
})
210-
.postDataConnectorProjectLink({ dataConnectorId: "ULID-5" });
210+
.postDataConnectorProjectLink({ dataConnectorId: "ULID-5" })
211+
.readProjectV2Namespace();
211212
cy.visit("/p/user1-uuid/test-2-v2-project");
212213
cy.wait("@readProjectV2WithoutDocumentation");
213214
cy.wait("@listProjectDataConnectors");
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"id": "namespace-id",
3+
"name": "test-2-v2-project",
4+
"slug": "test-2-v2-project",
5+
"path": "user1-uuid/test-2-v2-project",
6+
"creation_date": "2023-11-15T09:55:59Z",
7+
"created_by": "user-id",
8+
"namespace_kind": "project"
9+
}

tests/cypress/support/renkulab-fixtures/namespaceV2.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ interface ListManyNamespacesArgs extends NameOnlyFixture {
5353
numberOfNamespaces?: number;
5454
}
5555

56+
interface ProjectV2Args extends SimpleFixture {
57+
projectNamespace?: string;
58+
projectSlug?: string;
59+
}
60+
5661
interface UserNamespaceV2Args extends SimpleFixture {
5762
username?: string;
5863
}
@@ -308,6 +313,31 @@ export function NamespaceV2<T extends FixturesConstructor>(Parent: T) {
308313
return this;
309314
}
310315

316+
readProjectV2Namespace(args?: ProjectV2Args) {
317+
const {
318+
fixture = "projectV2/read-projectV2-namespace.json",
319+
name = "readProjectV2Namespace",
320+
projectNamespace = "user1-uuid",
321+
projectSlug = "test-2-v2-project",
322+
} = args ?? {};
323+
cy.fixture(fixture).then((namespace_) => {
324+
const namespace = {
325+
...namespace_,
326+
name: projectSlug,
327+
slug: projectSlug,
328+
path: `${projectNamespace}/${projectSlug}`,
329+
};
330+
cy.intercept(
331+
"GET",
332+
`/api/data/namespaces/${projectNamespace}/${projectSlug}`,
333+
{
334+
body: namespace,
335+
}
336+
).as(name);
337+
});
338+
return this;
339+
}
340+
311341
readUserV2Namespace(args?: UserNamespaceV2Args) {
312342
const {
313343
fixture = "namespaceV2/namespaceV2-user1.json",

0 commit comments

Comments
 (0)