She bought the dress on impulse.

Literal

She [topic-は] that dress [object-を] impulse-buying did.

衝動買い is a clean compound — 衝動 ('impulse, urge') + 買い (the masu-stem of 買う 'buy'), giving 'impulse buying'. Japanese readily turns abstract nouns into shorthand by sticking them in front of verb stems: 大量買い ('bulk buying'), 試し買い ('trial buying'), 大人買い ('adult-style mass buying' — buying multiples of something you couldn't afford as a kid). The verb form 衝動買いをする (with をする) and 衝動買いする (with bare する) are interchangeable; here the bare form is used.