Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
boco-frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
idatt2106_2022_02
boco-frontend
Commits
73d20459
Commit
73d20459
authored
2 years ago
by
Erik Borgeteien Hansen
Browse files
Options
Downloads
Plain Diff
Merge branch 'remove-category' into 'main'
Remove category See merge request
!53
parents
9bd60ee2
95aa1146
No related branches found
Branches containing commit
No related tags found
1 merge request
!53
Remove category
Pipeline
#177672
passed
2 years ago
Stage: setup
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/CommunityComponents/NewCommunityForm.vue
+6
-45
6 additions, 45 deletions
src/components/CommunityComponents/NewCommunityForm.vue
tests/unit/create-new-group.spec.js
+0
-5
0 additions, 5 deletions
tests/unit/create-new-group.spec.js
with
6 additions
and
50 deletions
src/components/CommunityComponents/NewCommunityForm.vue
+
6
−
45
View file @
73d20459
...
...
@@ -101,42 +101,6 @@
</div>
</div>
<!-- Select category -->
<div
class=
"mt-6"
>
<label
class=
"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-400"
id=
"selectCategoryLabel"
>
Kategori
</label
>
<select
v-model=
"v$.group.select.$model"
id=
"categories"
class=
"bg-gray-200 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
>
<option
class=
"text-gray-400"
value=
""
disabled
selected
>
Select a category
</option>
<option
v-for=
"category in group.categories"
:key=
"category"
class=
"text-gray-900 text-sm"
>
{{
category
}}
</option>
</select>
<!-- error message for select box -->
<div
class=
"text-red"
v-for=
"(error, index) of v$.group.select.$errors"
:key=
"index"
>
<div
class=
"text-red-600 text-sm"
>
{{
error
.
$message
}}
</div>
</div>
</div>
<!-- Description -->
<div
class=
"mt-6"
:class=
"
{ error: v$.group.description.$errors.length }">
<label
...
...
@@ -184,13 +148,16 @@
<!-- Button for adding an image -->
<div
class=
"inline-flex rounded-md shadow-sm"
>
<button
<div
class=
"text-red-500 uppercase text-center"
>
midlertidig fjernet
</div>
<!--
<button
@
click=
"$refs.file.click()"
class=
"text-black bg-gray-200 hover:bg-grey-800 focus:ring-4 focus:outline-none focus:ring-grey-300 font-medium rounded-lg text-sm sm:w-auto px-5 py-2.5 text-center dark:bg-grey-600 dark:hover:bg-grey-700 dark:focus:ring-grey-800 disabled:opacity-50
cursor-not-allowed
"
class=
"text-black bg-gray-200 hover:bg-grey-800 focus:ring-4 focus:outline-none focus:ring-grey-300 font-medium rounded-lg text-sm sm:w-auto px-5 py-2.5 text-center dark:bg-grey-600 dark:hover:bg-grey-700 dark:focus:ring-grey-800 disabled:opacity-50"
:disabled=
"imageAdded"
>
Velg bilde
</button>
</button>
-->
<!-- Button for removing an image -->
<button
...
...
@@ -266,9 +233,6 @@ export default {
maxLength
(
200
)
),
},
select
:
{
required
:
helpers
.
withMessage
(()
=>
`Velg en kategori`
,
required
),
},
},
};
},
...
...
@@ -276,10 +240,8 @@ export default {
return
{
group
:
{
name
:
""
,
select
:
null
,
description
:
""
,
images
:
[],
categories
:
[
"
Borettslag
"
,
"
Idrettsklubb
"
,
"
Fritidsklubb
"
],
radio
:
null
,
place
:
""
,
visibility
:
1
,
...
...
@@ -335,7 +297,6 @@ export default {
console
.
log
(
"
Navn:
"
+
this
.
group
.
name
);
console
.
log
(
"
Sted:
"
+
this
.
group
.
place
);
console
.
log
(
"
Synlighet:
"
+
this
.
group
.
radio
);
console
.
log
(
"
Kategori:
"
+
this
.
group
.
select
);
console
.
log
(
"
Beskrivelse:
"
+
this
.
group
.
description
);
console
.
log
(
"
bilder:
"
+
this
.
group
.
images
);
...
...
This diff is collapsed.
Click to expand it.
tests/unit/create-new-group.spec.js
+
0
−
5
View file @
73d20459
...
...
@@ -9,7 +9,6 @@ describe("CreateNewGroup elements rendering", () => {
expect
(
wrapper
.
find
(
"
#radioBoxOpenLabel
"
).
text
()).
toMatch
(
"
Åpen
"
);
expect
(
wrapper
.
find
(
"
#radioBoxPrivateLabel
"
).
text
()).
toMatch
(
"
Privat
"
);
expect
(
wrapper
.
find
(
"
#titleLabel
"
).
text
()).
toMatch
(
"
Gruppenavn
"
);
expect
(
wrapper
.
find
(
"
#selectCategoryLabel
"
).
text
()).
toMatch
(
"
Kategori
"
);
expect
(
wrapper
.
find
(
"
#descriptionLabel
"
).
text
()).
toMatch
(
"
Beskrivelse
"
);
expect
(
wrapper
.
find
(
"
#imageLabel
"
).
text
()).
toMatch
(
"
Bilde
"
);
});
...
...
@@ -21,10 +20,6 @@ describe("CreateNewGroup elements rendering", () => {
await
titleInput
.
setValue
(
"
Fjellgata
"
);
expect
(
titleInput
.
element
.
value
).
toBe
(
"
Fjellgata
"
);
const
selectedCategory
=
wrapper
.
find
(
"
#categories
"
);
await
selectedCategory
.
setValue
(
"
Borettslag
"
);
expect
(
selectedCategory
.
element
.
value
).
toBe
(
"
Borettslag
"
);
const
descriptionInput
=
wrapper
.
find
(
"
#description
"
);
await
descriptionInput
.
setValue
(
"
Dette er et borettslag
"
);
expect
(
descriptionInput
.
element
.
value
).
toBe
(
"
Dette er et borettslag
"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment