Skip to content

Commit ae259f6

Browse files
committed
Show correct notification text on survey update
1 parent adf83f4 commit ae259f6

File tree

1 file changed

+11
-70
lines changed

1 file changed

+11
-70
lines changed

vue/src/views/SurveyView.vue

Lines changed: 11 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,7 @@
7171
/>
7272
<span
7373
v-else
74-
class="
75-
flex
76-
items-center
77-
justify-center
78-
h-12
79-
w-12
80-
rounded-full
81-
overflow-hidden
82-
bg-gray-100
83-
"
74+
class="flex items-center justify-center h-12 w-12 rounded-full overflow-hidden bg-gray-100"
8475
>
8576
<svg
8677
xmlns="http://www.w3.org/2000/svg"
@@ -97,39 +88,12 @@
9788
</span>
9889
<button
9990
type="button"
100-
class="
101-
relative
102-
overflow-hidden
103-
ml-5
104-
bg-white
105-
py-2
106-
px-3
107-
border border-gray-300
108-
rounded-md
109-
shadow-sm
110-
text-sm
111-
leading-4
112-
font-medium
113-
text-gray-700
114-
hover:bg-gray-50
115-
focus:outline-none
116-
focus:ring-2
117-
focus:ring-offset-2
118-
focus:ring-indigo-500
119-
"
91+
class="relative overflow-hidden ml-5 bg-white py-2 px-3 border border-gray-300 rounded-md shadow-sm text-sm leading-4 font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
12092
>
12193
<input
12294
type="file"
12395
@change="onImageChoose"
124-
class="
125-
absolute
126-
left-0
127-
top-0
128-
right-0
129-
bottom-0
130-
opacity-0
131-
cursor-pointer
132-
"
96+
class="absolute left-0 top-0 right-0 bottom-0 opacity-0 cursor-pointer"
13397
/>
13498
Change
13599
</button>
@@ -148,16 +112,7 @@
148112
id="title"
149113
v-model="model.title"
150114
autocomplete="survey_title"
151-
class="
152-
mt-1
153-
focus:ring-indigo-500 focus:border-indigo-500
154-
block
155-
w-full
156-
shadow-sm
157-
sm:text-sm
158-
border-gray-300
159-
rounded-md
160-
"
115+
class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md"
161116
/>
162117
</div>
163118
<!--/ Title -->
@@ -174,16 +129,7 @@
174129
rows="3"
175130
v-model="model.description"
176131
autocomplete="survey_description"
177-
class="
178-
shadow-sm
179-
focus:ring-indigo-500 focus:border-indigo-500
180-
mt-1
181-
block
182-
w-full
183-
sm:text-sm
184-
border border-gray-300
185-
rounded-md
186-
"
132+
class="shadow-sm focus:ring-indigo-500 focus:border-indigo-500 mt-1 block w-full sm:text-sm border border-gray-300 rounded-md"
187133
placeholder="Describe your survey"
188134
/>
189135
</div>
@@ -202,16 +148,7 @@
202148
name="expire_date"
203149
id="expire_date"
204150
v-model="model.expire_date"
205-
class="
206-
mt-1
207-
focus:ring-indigo-500 focus:border-indigo-500
208-
block
209-
w-full
210-
shadow-sm
211-
sm:text-sm
212-
border-gray-300
213-
rounded-md
214-
"
151+
class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md"
215152
/>
216153
</div>
217154
<!--/ Expire Date -->
@@ -382,10 +319,14 @@ function questionChange(question) {
382319
* Create or update survey
383320
*/
384321
function saveSurvey() {
322+
let action = "created";
323+
if (model.value.id) {
324+
action = "updated";
325+
}
385326
store.dispatch("saveSurvey", { ...model.value }).then(({ data }) => {
386327
store.commit("notify", {
387328
type: "success",
388-
message: "The survey was successfully updated",
329+
message: "The survey was successfully " + action,
389330
});
390331
router.push({
391332
name: "SurveyView",

0 commit comments

Comments
 (0)